IMAG2753.jpg (830971Bytes)
IMAG2752.jpg (761543Bytes)
Hello all
I purchased some ultrasonic sensors on ebay thinking they where SRF005, but!!. I have them now but cannot get them to talk. I have looked through SRF005 Ultrasonic Range Sensor PDF from the picaxe website, the sensor has 5 pins like the ones I have. I tried the one pin and dual pin modes, nothing. I have noticed that a number of people have used ultrasonic sensors, some even the HY-SFR05, but I can't seem understand which pins need to be connected. I have taken a couple of snaps of what I have done so far. The trigger is connected to C.1 or input pin0 and the echo is connected to B.4 output pin4.
The code is straight from the PDF, here it is
symbol trig = b.4 '‘ Define output pin for Trigger pulse
symbol echo = c.0 '‘ Define input pin for Echo pulse
symbol range = w1 '‘ 16 bit word variable for range
main:
pulsout trig,2 '‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range '‘ measures the range in 10uS steps
pause 10 '‘ recharge period after ranging completes
'‘ now convert range to cm (divide by 5.8) or inches (divide by 14.8)
'‘ as picaxe cannot use 5.8, multiply by 10 then divide by 58 instead
let range = range * 10 / 58 '‘ multiply by 10 then divide by 58
debug range '‘ display range via debug command
goto main '‘ and around forever
If anyone could give some feed back as to where I am 'off' I would appreciate it, thank you Gaetano
Ultrasonic sensors.
Last year I purchased 5 very cheap SRF05 units that did almost nothing. Got one to do something by repairing a obvious bad solder joint. Can you post the purchasing info? Any pin identification for power? Vendor markings?
Hi ggallantThank you looking
Hi ggallant
Thank you looking at the post, I have taken close ups of the module and posted them. I purchased them from ebay and I have no ddetails apart from what I ahve found on the web, Gaetano
Hi OssipeeThank you for your
Hi Ossipee
Thank you for your observations. I rewrote the code and removed all symbols and still no luck. New code below
main:
pulsout b.4,2 'produce 20uS trigger pulse (must be minimum of 10uS)
pulsin c.0,1,w1 'range '‘ measures the range in 10uS steps
pause 10 'recharge period after ranging completes
let w1 = w1 * 10/58 'range = range * 10 / 58 '‘ multiply by 10 then divide by 58
debug w1 'range '‘ display range via debug command
goto main ‘and around forever
With your HCSR04 does it have 4 or 5 pins. The sensor I am trying to get work has 5, VCC, Trig, Echo, Out, Gnd. There is all sorts of advice I have read on other web pages about the ‘Out’ whether to ground it or ignore it. Aslo some people (with Arduino) pop a resistor in the same feed back when they use it as a single pin module. Its frustrating. In this current configuration I have the VCC & Gnd connected, check with multimeter and they are showing 4.5volts. The Trig is connected to C.0 and the Echo is connected to B.4. I have also connected Out to Gnd (if I do nothing with it still nothing). I have uploaded images of the module itself, perhaps they are badly made or most probably I am doing something wrong. I have noticed that other members of this forum had used the same module and appear to have worked it out. Perhaps it is the way I have connected to the the 14M2? I’'ll keep trying, Gaetano