Distance Sensor Preference

Gramps

Senior Member
Looking for a couple of distance sensors that can accurately detect an approaching object from 12 to 6 inches away (15 to 30 cm)
Specs: outdoor, waterproof, on the cheaper side and easy to use.

The IR sensors I have do work but they are noisy, and sunlight really makes them go nuts.

Are the Time of Flight sensors even doable by a novice like me?
Please advise. Thanks , Gramps
 

Gramps

Senior Member
Using an old ultrasonic sensor found here:
The sample code,
Behold it works!!!!

Code:
;Testing Ultrasonic sensor with sxample code
#picaxe 08m2
#no_data
;C.2 connects to sounder
symbol trig = C.1 ; Define pin for Trigger & Echo (All M2, X2 parts)
symbol range = w1 ; 16 bit word variable for range

main:    pulsout trig,2 ; produce 20uS trigger pulse (must be minimum of 10uS)
pulsin trig,1,range ; measures the range in 10uS steps
pause 20; 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
if range <12 then high C.2;sounder on
end if
if range >12 then low C.2;sounder off
End if 

goto main; and around forever
 

johnlong

Senior Member
Is the 6 to 12 inches set in stone
if not you could have a look at
Microwave Doppler Radar Motion Detector Sensor RCWL-0516 Module Board
on flea bay
they can pick up small movements upto 7m
just supply vin and grd and pickup the outpin (3.3v) with the picaxe via hint pin or pins on the x2 chips the 28x2 has 3 hints that you could use to triangulate where the motion is comming from
regards john
 

Gramps

Senior Member
you could have a look at
Microwave Doppler Radar Motion Detector
Thanks John. Appreciate that link.
We need to detect when our 5th wheel camper gets too close to the roof of the pickup on tight turns.
Want the sounder to activate when 6 inches away.
 

premelec

Senior Member
I think doppler radar implies motion only rather than static distance - there are other units I think for static sense - for your purpose perhaps a leaf spring mounted wheel and micro switch could work...
 

johnlong

Senior Member
Hi Gramps
have a look at this
1Set JSN-SR04T Ultrasonic Distance Measuring Transducer Sensor Waterproof RC
The test distance = (high level time * speed of sound (340M/S)) /2
from the discription looks like it would fit nicely into the bumper without too much difficulty
and all weather protection
 

Gramps

Senior Member
Hi Gramps
have a look at this
1Set JSN-SR04T Ultrasonic Distance Measuring Transducer Sensor Waterproof RC
The test distance = (high level time * speed of sound (340M/S)) /2
from the discription looks like it would fit nicely into the bumper without too much difficulty
and all weather protection
Thanks again for the link.
Some time ago I bought a parking sensor set. It looks like the same sensor you suggested..
EKYLIN Car Auto Vehicle Reverse Backup Radar System with 4 Parking Sensors
Sorry I couldn't get the link to post.🙄 perhaps two of these could be hacked for my purpose.
 

The bear

Senior Member
Gramps,
I like the leaf spring idea.

Have you got an anti-jackknife device on your vehicle?
If so, you could tap into that. Just a thought, as Tex would say.
Good luck, Bear..
 
Top