|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Ultrasonic sensor help needed
Hey guys
Been playing around with the ultrasonic sensor for a few days now. We have it set up plugged into the analog port 1. I initially used the labview example to test it, but the number given never changed. Today, I worked with new code that I found online. Attached is this code. It correctly gets the voltage like it is programmed and displays it to the dashboard, but in lays a tougher problem. Once again the number never changes. The voltage shown sticks at something like 4.56 for the sensor and never changes if I move it around. Any ideas? |
|
#2
|
||||||
|
||||||
|
Re: Ultrasonic sensor help needed
Your code looks fine. How did you wire the sensor? Do you have a DMM that you can use to measure the sensor independently?
|
|
#3
|
|||
|
|||
|
Re: Ultrasonic sensor help needed
We soldered pwm wires to the sensor according to the diagram given on the sensor website for analog, so it's correct. The soldered wires are a part of a pwm cable that ends with a male connector. This male connector is then connected to a female to female pwm cable that is put into the analog breakout on the cRIO.
We do probably have a DMM lying around. How would i go about testing the sensor? |
|
#4
|
|||||
|
|||||
|
Re: Ultrasonic sensor help needed
Quote:
If yes, then put something about feet from the sensor - the ceiling makes a nice target if you're working on a table. The voltage at tha AN pin, again with the black DMM lead on the GND pin, should be about 0.6 volts - more precisely, it should be 0.01 volt per inch. 60" = 0.6 V If all that is fine, the sensor is working properly. |
|
#5
|
|||
|
|||
|
Re: Ultrasonic sensor help needed
Quote:
What should I do if the sensor still remains at the constant 4.56 volts or so? |
|
#6
|
|||||
|
|||||
|
Re: Ultrasonic sensor help needed
Quote:
All assumes that you know what you're saying when you wrote "so its correct". Maybe have someone look real carefully for solder bridges and other issues? |
|
#7
|
|||
|
|||
|
Re: Ultrasonic sensor help needed
I sure hope it's fine! Do you think it may be a "dead" one because of the constant voltage it shows?
|
|
#8
|
|||||
|
|||||
|
Re: Ultrasonic sensor help needed
My suspicion is that you're reading the supply voltage. Particularly because the sensor has a maximum range of 255 inches (2.55 volts). But it's fed with about 5 volts...
Little solder globs can do that sort of thing. As can little 'hairs' of copper wire. and so on. |
|
#9
|
|||
|
|||
|
Re: Ultrasonic sensor help needed
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|