Asked — Edited
Resolved Resolved by Dunning-Kruger!

Hc-Sr04 Shows Only 255

I am trying to get the HC-Sr04 sonar to work with the EZB. I use the add for my project, select radar view and the value stays at 255. I am using port D0 and D1. Could the sensor be bad? It is brand new, just received it in box with other components.

thanks


ARC Pro

Upgrade to ARC Pro

Unleash your robot's full potential with the cutting-edge features and intuitive programming offered by Synthiam ARC Pro.

#25  

Hi, old thread here but just wondering, i picked up the 4 wire sensor utrasonic with no regulator so,can I just hook up ping and echo to the white signals on EZB-v4 but the +5v and ground separately to a 5 volt battery external,do I need to attach another ground also to EZ-B? Or just leave it absent? (signals ony)

edit.....So I tried it out with no other ground than the 5 volt ac adapter on the sensor with the radar window,it is showing multiple red dots near bottom but hand in front of sensor then shows a red ping further to top of radar window and motors go into obstacle turning so I guess I can just run the sensor with it's own battery and nothing but signal wires to white ports EZ-B?will his cause any future harm if no extra ground to EZ-B?

next edit.....so since I was getting crazy random pings everywhere,thought I would add the ground wire on eZ-B and then $$bingo all the random pings stopped,now i was getting accurate steady red dot line showing the roof as my sensor was facing the roof and when I put my hand in front of sensor it showed up a red dot on radar closer to bottom,think that's it ,working good! :D

#26  

Yes, this is a very common oversight/mistake for folks newer to robotics and electronics, you always need interconnected grounds or "commons". This is the return path for electronics, with out a shared common connection for the ground the circuit would not be complete.

Good job solving your own question @RoboRad

Also (you already appear to know this) but as a reminder, do not exceed the 5volts for your ultrasonic sensor or you will damage it.