background preloader

Ultrasonic Distance Measurement Using Python – Part 1

Ultrasonic Distance Measurement Using Python – Part 1
LEDs, buzzers and switches are the most common items people attempt to interface to their Raspberry Pi’s. Something I found in eBay that is a little bit different is an ultrasonic measurement module. This allows you to measure the distance to the nearest wall or solid object. The modules are easy to buy, cheap and relatively straight forward to interface to the GPIO header. So here is some information on my experiments with an Ultrasonic measurement module and Python. In future projects I can see these modules being a great way to add some intelligence to a Pi powered robot or car. The HC-SR04 module cost approximately £3 ($5) and is the size of a box of matches. Connecting To The Pi Powering the module is easy. The input pin on the module is called the “trigger” as it is used to trigger the sending of the ultrasonic pulse. You can use any GPIO pins you like on your RPi but you will need to note the references and amend your Python script accordingly. Ultrasonic Module Circuit Python Script

Related:  Tutos niveau d'eauRaspberry Pi and ArduinoRaspberry Pi - TrucsIT

Ultra cheap ultrasonics, and a bit of a challenge joan wrote:Excellent.I think the physics of sound waves rather limits the update rate of acoustic sensors. If you had some more they'd probably interfere with each other. I think you'd have one transmitter and the rest would be passive listeners.Given what you have achieved do you now think it possible to extend the idea to motor/LED PWM? Heh, I take your point about the physics, but if I point the thing at a table 10cm away and get an echo in 0.5ms, it seems a shame that I apparently have to wait 59.5ms before I can trigger it again. Interfacing with a Wiimote - Physical Computing with Raspberry Pi Difficulty: intermediate This tutorial will show you how to connect a Wiimote to the Pi over Bluetooth. You will then be able to read input from it, including the state of the buttons and accelerometer and send it output, e.g. changing the LED state and playing with rumble. It is recommended to use one of our SD cards or images, if you are not then you will need: python-cwiid and to set your Bluetooth in discoverable mode with sudo hciconfig hci0 piscan. Log into your Pi and start a Python console (or ipython if you want tab completion and other extra features).

Distance sensor data gathering So I was able to start gathering sensor data last night. I wanted to start gathering information on the two distance sensors in order to be able to calibrate the system. I have enough errors propagating around, I just wanted to understand a little more about the IR and Ultrasonic Distance Sensors themselves and how they behave and how well they measure distance. Pololu Sharp GP2Y0D810Z0F Digital Distance Sensor 10cm Breakout This small digital distance sensor detects objects between 2 and 10 cm (0.8" and 4") away. With its quick response time, small size, and low current draw, this sensor is a good choice for non-contact object detection, and our compact carrier PCB makes it easy to integrate into your project. The GP2Y0D810 is Sharp’s smallest and fastest distance sensors, and our tiny carrier board for these sensors includes all of the external components required to make them work. With a sample rate of almost 400 Hz the sensor detects objects between 2 cm and 10.25 cm away.

Steves Computer Vision Blog: Playing YouTube videos in the browser on the Raspberry Pi This will allow you to stream up to 1080p youtube videos in the browser on the Raspberry pi using omxplayer. It's a crude hack but it seems to work pretty well on my system. Install instructions and a demonstration video are shown below.You can install this by pulling the git repository and running the scripts below.Commands to install are below (your user should have sudo privileges but you don't need to be root):You may have to enable user scripts in Midori by going to Menu>Preferences>Extensions>UserScripts and clicking the check box. sudo apt-get install git-core git clone cd PiAUISuite/Install/.

Ultra cheap ultrasonics with the HY-SRF05, Part 2. In my previous Ultra cheap ultrasonics posting, I made a plea for someone to write a C based implementation, in the search for more stable results. I was very pleased to find that Joan, over on the raspberry pi forums responded within hours with a C implementation for this sensor. I have run through the same test with the C implementation, and documented my results. Interestingly the additional speed of C implementation doesn't have appeared to have made it noticeably less susceptible to fluctuations. Below I have graphed the readings from both the python and C implementations on the same axes for direct comparison.

How to build a Raspberry Pi media centre This article was taken from the July 2013 issue of Wired magazine. Be the first to read Wired's articles in print before they're posted online, and get your hands on loads of additional content by subscribing online. Fancy an alternative to a streaming-content home-theatre setup? You can convert the Raspberry Pi into a media centre -- and you don't need to learn how to code. Proximity Detection The Explorer PCB has an infrared proximity sensor at each of it's four corners. This consists of three little LEDs (or LED like things). Two of them are side by side hanging from under the board. One of these is the IR emitter and the other is the reader. On the top of the board is a little LED that lights when the IR emitter is active (since you can't see IR).