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

Experience the transformation – subscribe to Synthiam ARC Pro and watch your robot evolve into a marvel of innovation and intelligence.

PRO
USA
#9  

its the port names only I have reversed..does that matter...the wiring is correct

#10  

The green wire and the white wire shouldn't they be plugged into D0,D1 white pins? Looks like from your picture you have the green wire plugged into the RED pin on the EZB...

Black wire goes to black pin on EZB (D0) Red wire goes to red pin on the ezb (D0) White wire will be either white pin of the EZB on D0 or D1 Green wire will be on white pin of the EZB either D0 or D1

#11  

Forget my last post... Try reversing green and white... Look at the back of the Ping make sure the trigger goes to the EZB on the correct pin meant for the trigger and the same for the echo wire... D0 is your trigger (white or green) and D1 is your echo (white or green)...

#12  

From your last post (picture)... Green is your echo (plug it into the echo on the back of the ping) D1... White is your trigger (plug it into the trig on the back of the ping) D0... make sure your ping control in ARC reflects that setup...

PRO
USA
#13  

I have white on trigger going to d0 white Then I have green on echo going to d1 white

nothing 255.

#14  

Ok... one last thing to check... is the voltage regulator outputting 5V? I see the led on in your pics, but that may not mean anything... Can you confirm with a multimeter?... If it is maybe you do have a duff ping sensor.... You'll need to contact ez robot and I am sure they will mail you out a new one right away...

PRO
Canada
#15  

Hi @dbeard,

Thanks for your photos they really help! A couple other quick checks for you:

The Default value of the Ultrasonic is 255 until an object passes in front of it, have you tried placing your hand in front of the sensor at a fairly close distance (ex: 6 inches)?

How high of voltage input are you providing to the EZ-B?

Do you have the voltage input (Vin) side of the provided Ultrasonic 5V regulator connected to the EZ-B side or to the Ultrasonic side? It should be on the EZ-B side.

#16  

Awesome Jeremie.... Never thought about the possibility the voltage reg could have been connected backwards... that might be it...