Page 1 of 1

HC-SR04 causes Raspberry Pi Reboot - Ideas?

PostPosted: Tue Jun 14, 2016 7:19 am
by alanmcdonley
HC-SR04 operation is causing occasional reboots - Ideas?

Details here: https://goo.gl/QOT9gG (with a good word for the Pi Droid Alpha there too!)

Re: HC-SR04 causes Raspberry Pi Reboot - Ideas?

PostPosted: Tue Jun 14, 2016 8:33 am
by alanmcdonley
OUCH

Now that I think about it, I need to check maybe I have the 5v Echo going straight into the GPIO - I may have reversed the trigger and echo pin allocation.


If so, lucky I didn't fry my Pi!

Re: HC-SR04 causes Raspberry Pi Reboot - Ideas?

PostPosted: Tue Jun 14, 2016 10:36 am
by mikronauts
Thank you for your kind words!

Scratching my head... the only way I can think of that happening is:

ECHO going directly to a Pi pin without voltage divider, and one of the two conditions below:

1) Pi drives pin at 3.3V, HC-SR04 pulls it to GND

2) Pi drives pin at GND, HC-SR04 drives it to 5V <--- more likely

Depending on the HC-SR04's low current limit, it might short the Pi's 5V and cause a reboot.

1 is the same thing - in reverse.

Re: HC-SR04 causes Raspberry Pi Reboot - Ideas?

PostPosted: Tue Jun 14, 2016 8:54 pm
by alanmcdonley
Fixed!!


I had the Echo going direct and the Trigger from a servo pin - exactly backward... Glad I didn't fry my board.

I've been running the switched wiring with my hcsr04.py interface code for two hours now with no reboots, even moving the tilt or pan servo that occasionally bumps the total current draw to 1.8A which is 1.4 A to 1.6A flowing to/through the Pi board (the regulator claims to be 80-90% efficient).

I'm careful not to run both tilt and pan servos at the same time, but I'm going to move the HC-SR04 Echo (and Vcc,Gnd) to the other half of servo pins, and put the servos on the 5v unregulated tap.

That will keep the Pi current draw around 500mA with everything going at once.

Re: HC-SR04 causes Raspberry Pi Reboot - Ideas?

PostPosted: Wed Jun 15, 2016 9:56 am
by mikronauts
Glad to hear you fixed it!

I'd be careful about that GPIO pin, would not rely on it.

alanmcdonley wrote:Fixed!!

I had the Echo going direct and the Trigger from a servo pin - exactly backward... Glad I didn't fry my board.

I've been running the switched wiring with my hcsr04.py interface code for two hours now with no reboots, even moving the tilt or pan servo that occasionally bumps the total current draw to 1.8A which is 1.4 A to 1.6A flowing to/through the Pi board (the regulator claims to be 80-90% efficient).

I'm careful not to run both tilt and pan servos at the same time, but I'm going to move the HC-SR04 Echo (and Vcc,Gnd) to the other half of servo pins, and put the servos on the 5v unregulated tap.

That will keep the Pi current draw around 500mA with everything going at once.