Go to advanced search

by joan
Wed Nov 26, 2014 8:34 am
Forum: Automation, sensing and robotics
Topic: HC-sr04
Replies: 6
Views: 1312

Re: HC-sr04

Can't say I've ever bothered to measure the voltage on the trigger pin as it's an input to the sonar ranger.

How did you measure the voltage? Could you detect any current flow?
by rpdom
Wed Nov 26, 2014 8:18 am
Forum: Automation, sensing and robotics
Topic: HC-sr04
Replies: 6
Views: 1312

Re: HC-sr04

That sensor works on 5V which is not good for the Pi and could destroy the GPIOs. You need to put a level shifter of some sorts to get the input and output down to 3.3V. A simple voltage divider with a couple of resistors would work for the input from the sensor. ECHO---[2K2]---GPIO---[3K3]---GND Yo...
by carphone
Tue Nov 25, 2014 11:41 pm
Forum: Automation, sensing and robotics
Topic: HC-sr04
Replies: 6
Views: 1312

HC-sr04

... and when measuring voltages i found the trig pin to be (what i would call) back-feeding 5v to the gpio pin on the pi. I have tried another hc-sr04 and it does the same thing. can't be good for the pi surely?? am i missing something simple? Thanks in advance
by toxibunny
Sat Nov 22, 2014 11:49 pm
Forum: Automation, sensing and robotics
Topic: HC SR04 Ultrasonic Ranging Module driver
Replies: 1
Views: 1333

Re: HC SR04 Ultrasonic Ranging Module driver

I'm busy with other stuff right now, but will certainly be downloading/bookmarking this for later. Thanks for sharing!
by zhanisch
Sat Nov 22, 2014 1:19 pm
Forum: Automation, sensing and robotics
Topic: HC SR04 Ultrasonic Ranging Module driver
Replies: 1
Views: 1333

HC SR04 Ultrasonic Ranging Module driver

Hi everybody! I wrote a driver for the HC SR04 ultrasonic ranging module. You can download from here: https://github.com/zhanisch/hc-sr04_driver I attached a readme file to help with the installation process. In nutshell: the measurement can be ...
by mikronauts
Thu Nov 20, 2014 5:09 pm
Forum: Beginners
Topic: ultrasonic + 16x2 LCD
Replies: 8
Views: 2465

Re: ultrasonic + 16x2 LCD

You cannot use the same Pi pins for both the LCD and the HC-SR04 Move the ultrasonic sensor to other GPIO's Don't forget to use a voltage divider on the Echo output so you don't feed a 5V signal to a Pi pin If you ran the ultrasonic sensor at 5V and did ...
by DougieLawson
Wed Nov 19, 2014 7:11 pm
Forum: Python
Topic: HC-SR04 Ultrasonic Sensor run a script at specific distance?
Replies: 4
Views: 3108

Re: HC-SR04 Ultrasonic Sensor run a script at specific dista

It's only code. If you've got the sample code running and generating a sensible distance then it's only a while loop, a timer and an if statement that's needed to make it periodically test for a range of distances (9.5m to 10.5m to allow for errors and variations in the speed of sound). That's going...
by pmap93
Wed Nov 19, 2014 7:03 pm
Forum: Python
Topic: HC-SR04 Ultrasonic Sensor run a script at specific distance?
Replies: 4
Views: 3108

Re: HC-SR04 Ultrasonic Sensor run a script at specific dista

Take a look at http://www.themagpi.com/issue/issue-27/ there's an article in there about sensing distance with a HC-SR04. Thank you for this. However this part about the Ultrasonic Sensor is similar to what I did. and the code i use continuously reads the distance once per second. ...
by joan
Wed Nov 19, 2014 5:21 pm
Forum: Python
Topic: HC-SR04 Ultrasonic Sensor run a script at specific distance?
Replies: 4
Views: 3108

Re: HC-SR04 Ultrasonic Sensor run a script at specific dista

Any ideas about what?

I'm sure the script works. What have you tried during your attempts to change it to do what you want?
by DougieLawson
Wed Nov 19, 2014 5:15 pm
Forum: Python
Topic: HC-SR04 Ultrasonic Sensor run a script at specific distance?
Replies: 4
Views: 3108

Re: HC-SR04 Ultrasonic Sensor run a script at specific dista

Take a look at http://www.themagpi.com/issue/issue-27/ there's an article in there about sensing distance with a HC-SR04.
by pmap93
Wed Nov 19, 2014 5:09 pm
Forum: Python
Topic: HC-SR04 Ultrasonic Sensor run a script at specific distance?
Replies: 4
Views: 3108

HC-SR04 Ultrasonic Sensor run a script at specific distance?

'm relatively new in programming and the Raspberry Pi. I'm working on a small beginner project for my university, it involves an Ultrasonic Sensor and the RPi, and I would like to program the RPi to run a script at a specific distance detected from the Ultrasonic Sensor. For example, it should run s...
by raspmangobr
Sun Nov 09, 2014 8:55 am
Forum: Advanced users
Topic: How to detect if someone touched a door locker
Replies: 13
Views: 3000

Re: How to detect if someone touched a door locker

... 5- Ultrasonic 4-pin Sensor Monitoring - http://www.instructables.com/id/Easy-ultrasonic-4-pin-sensor-monitoring-hc-sr04/ Depending on a combination of events, the system will take the following actions: 1- SMS me 2- Play a pre-recorded mp3 3- Trigger a 130db siren ...
by TOKN59
Thu Nov 06, 2014 4:04 pm
Forum: Troubleshooting
Topic: Ultrasonic measurements
Replies: 4
Views: 1488

Ultrasonic measurements

Hello, I have create a small program that determines the distance with an ultrasonic board. HC-SR04 board. It works fine but when I create a loop which checks the distance to be greater than 25 cm or stop then I run into problems. The measurements continue to be displayed ...
by mikronauts
Wed Oct 22, 2014 8:39 pm
Forum: Automation, sensing and robotics
Topic: Elf - my RoboPi + Raspberry Pi 2WD robot
Replies: 3
Views: 1554

Re: Elf - my RoboPi + Raspberry Pi 2WD robot

... article since I first posted about it. Today, I added: - wiring info and photos for the L9110S motor driver - wiring info and photos for the HC-SR04 range sensor - sample Python code for RoboPi controlling the motor driver via PWM and reading the range sensor Elf: http://www.mikronauts.com/robot-zoo/elf-2wd-pi-robot/ ...
by DougieLawson
Wed Oct 22, 2014 2:29 pm
Forum: Graphics, sound and multimedia
Topic: Looking for specific sensor
Replies: 1
Views: 406

Re: Looking for specific sensor

Use a HC-SR04 ultrasonic sensor board.

There's an article about that sensor in issue #27 of The MagPi magazine.
by zombierobots
Tue Oct 21, 2014 8:35 pm
Forum: Graphics, sound and multimedia
Topic: Sensor driven jpg stream
Replies: 0
Views: 258

Sensor driven jpg stream

Hello everyone, for my first pi project I'm using an ultrasonic sensor (HC-SR04) as input for driving some outputs. I already managed to write a python program that changes the angle of a servo and the color of an rgb-led depending on the distance an object is ...
by Arne Baeyens
Wed Oct 15, 2014 9:28 am
Forum: General discussion
Topic: most used sensors
Replies: 2
Views: 708

Re: most used sensors

... use of the sensors: robot, weather station, ... The Pi camera can also be considered as a sensor. My guesses: For robotics: - ultrasonic sensor HC-SR04 - microswitches PIR sensors are also popular. regards, Arne update 20/10: DS18B20 1-Wire digital temperature sensor: http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/temperature/
by MtnBiker
Wed Oct 15, 2014 4:48 am
Forum: Troubleshooting
Topic: Ultrasonic distance sensor errors
Replies: 12
Views: 4930

Ultrasonic distance sensor errors

Ultrasonic Distance Sensor, HC-SR04. Rasberrry Pi B+. I'm using the set-up and script from TheMagPi Issue 27. http://people.ds.cam.ac.uk/mcj33/themagpi/The-MagPi-issue-27-en.pdf Set up is straightforward with minor exception of the voltage ...
by mikronauts
Sat Oct 11, 2014 6:49 pm
Forum: Automation, sensing and robotics
Topic: Announcing RoboPi advanced controller for the Raspberry Pi
Replies: 43
Views: 14990

Re: Announcing RoboPi advanced controller for the Raspberry

Update: I just finished Python versions of the C/C++ RoboPiLib sample code: analogRead.py analogWrite.py digitalRead.py digitalWrite.py servoWrite.py readDistance.py Here is readDistance.py to whet your appetite: #!/usr/bin/python import RoboPiLib as RoboPi import time as time RoboPi.RoboPiInit("/d...
by B.Goode
Fri Oct 10, 2014 1:22 pm
Forum: Beginners
Topic: Ultrasonic distance measurement+ voice warning
Replies: 12
Views: 2046

Re: Ultrasonic distance measurement+ voice warning

A Google search for "raspbian ultrasonic.sensor" quickly found this -

https://www.modmypi.com/blog/hc-sr04-ul ... spberry-pi
by festrada007
Fri Sep 19, 2014 3:36 am
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

the HC-SR04 has a VCC, a ground, a trigger pin and an echo pin. To fire off the device you need to turn the trig pin to high for a specified time then return to low. The Echo pin will will go from low to high in a short pulse ...
by blavery
Wed Sep 17, 2014 5:31 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Virtual-GPIO for Raspberry Pi
Replies: 6
Views: 9505

Virtual-GPIO for Raspberry Pi

... data8 = GPIO.read8AVR(register) data16 = GPIO.read16AVR(register) GPIO.write8AVR(register, datdata8) GPIO.write16AVR(register, datdata16) SR04 (4pin) support (strobeWrite and PulseIn run together!) mySonar = GPIO.Sonar(4,6) trig/echo pins print "sonar %d" %mySonar.ping() Regular arduino ...
by BrujoPi
Sun Aug 24, 2014 11:37 pm
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

Hi Ame, I thank you for this, i will dig this part, it can be interesting, Anyway i thank you both of you, it's my first time in this forum and I feel really welcome . Thank you so much Hi, do you have solved this issue? ok, something in the code is bad, if you try to "put nothing" in front the sen...
by BrujoPi
Sun Aug 24, 2014 7:14 pm
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

aurelazy wrote:Hi Ame,
I thank you for this, i will dig this part, it can be interesting,
Anyway i thank you both of you, it's my first time in this forum and I feel really welcome .
Thank you so much
Hi, do you have solved this issue?
by joan
Mon Aug 18, 2014 11:13 am
Forum: Python
Topic: Ultrasonic Sensor Problems
Replies: 18
Views: 7245

Re: Ultrasonic Sensor Problems

... results. You need to change the ECHO and TRIGGER constants to reflect the Broadcom numbers of the gpios you are using. You need to power the HC-SR04 from 5V and make sure you have a voltage divider to lower the echo line from 5V to 3.3V. If you power the HC-SR04 from 3.3V it will not give reliable ...

Go to advanced search