I'm getting to my wits end here. Hopefully I'm over looking something, but I'd appreciate a suggestions or two. This is where I'm at:
The main PCB is the AXE035A.
I'm using C.0 as the trigger, and C.1 as the echo.
C.7 is the LCD output (AXE133).
B.0, via a FET, is driving two LED's through a resistor.
I'm using 5 "AA" batteies for the project, I have the 78L05 installed on the AXE035A and the "shorting resistor" removed.
I'm using an HC SR-04 from E-Bay. It has 4 pins, trigger to C.0, Echo to C.1, Vcc to +5 on the 18M2+ side of the PCB, and ground
I also tried removing R7 and R8 from the AXE035a (10K pull down resistors). I get the same results with and witout the resistors
I've tried four different SR-04 sensors from three different soucres.
I've buzzed everything out and everything appears to be connected correctly. The PICAXE and sensor are getting 5.0 VDC
The 18M2+ programsd correctly based on the flashing LED's and correct text being displayed.
The readout I'm getting is always "0". This includes the "raw" read out on the LCD, the conversion to inches (obviously), and on the debug readout.
Is there something special about the SR-05 from Techsupplies?
The code I'm using is shown below:
#Picaxe 18M2
‘ ********************************************
‘ Display clear and initialization
serout C.7, N2400_4, (254,1) ; clear display
Pause 500 ; initialization pause
serout C.7, N2400_4, (254,1) ; clear display
Pause 50 ; initialization pause
‘ ********************************************
‘ PICAXE-18M2 input/output pin definitions
Symbol PingOut = C.0 ; Send out a Ping (output C.0)
Symbol ReadPing = C.1 ; Read Ping back (input C.1)
‘ ********************************************
‘ Variables
Symbol Range = W1
Symbol Repeat = W3
‘ ********************************************
‘ Text introduction
serout C.7,N2400_4, (254,1) ; clear display
Pause 50
serout C.7,N2400_4,(254,128,"Name of Team")
Pause 4000
serout C.7,N2400_4,(254,192,"How a Bat Sees")
Pause 3000
serout C.7,N2400_4, (254,1) ; clear display
‘ ********************************************
‘ Ultrasonic Measurement and Conversion
main:
pulsout Pingout,1 ; produce 20uS trigger pulse
pulsin Readping,2,range ; measures the range in 10uS steps
pause 20 ; recharge period after ranging completes
serout C.7,N2400_4,(254,128,#W0) ; display raw range
pause 2000 ;delay for raw display
serout C.7, N2400_4, (254,1) ; clear display
Pause 50 ; initialization pause
let range = range * 10 / 58 ; Convert range to inches
debug range ; display range via debug command
serout C.7,N2400_4,(254,128,"Wall distance is")
serout C.7,N2400_4,(254,192,#range, " inches" )
pause 2000 ; Delay so you can see the answer
low B.0 ; Turn on the eyes
pause 1000 ; Keep the eyes on for a second
high B.0 ; Turn off the eyes
pause 1000
goto main ; Do it again