To save money, I bought a two-piece ultrasonic sensor (which was not designed for Arduino). It does look similar to other ultrasonic sensors. I have looked around and I can't find an informative data sheet or a tutorial. I don't even know which side is negative! The codes on the sides are: UST-40T, 400SR 04 62. Please help!
Can you post a picture of exactly what you have? Is it a complete module on it's own little breakout board, or is it just the two-pin metal can? If it's the latter, you are in for a whole lot of circuit-building to get any use out of it.
There are reasons that your don't see many people using these transducers in that form. The signal need to be interpreted and processed then output in an Arduino friendly format.
Saving money is relative. You saved some buying in raw but it's going to cost you in time to figure out how to do the things that are done for you with a more expensive breakout form of the sensor.
Goofballtech:
Saving money is relative. You saved some buying in raw but it's going to cost you in time to figure out how to do the things that are done for you with a more expensive breakout form of the sensor.
Not only that, but in order to effectively build such a circuit, you need to have access to a 2-channel oscilloscope to compare the output ping to the received ping. Given the numbers of the parts, these devices likely have a 40 KHz resonant frequency (you might want to verify this, I am only guessing).
The following circuit is a homebrew system using similar devices (albeit @ 24 KHz - so you would need to compensate for this difference, likely):
http://www.kerrywong.com/2011/01/22/a-sensitive-diy-ultrasonic-range-sensor/
Note the use of the oscilloscope...
Also - if the devices you have can be used as both a transmitter and a receiver (that is - the parts aren't differentiated into "transmitter" and "receiver" parts), then you might be able to get away with a single element system, using circuits similar to these app notes:
You'll want the circuit for the "AT90S2313" microcontroller; this is a small Atmel microcontroller (http://www.atmel.com/Images/doc0839.PDF), but you could probably easily do the same thing with an Arduino.
Of course, no code is provided with this app note (you might be able to get something from Hexamite if you asked), but the idea is to basically output a pulse (on pin 14/PB2 of the AT90S2313 in the note), wait a short bit (to allow the circuit to settle), then listen to the input (in the app note, on pin 12/PB0 of the AT90S2313) for the return echo; the difference in time of course relating to the distance.
Note the "weird" back-to-back diodes in the circuit; these may appear to be "wrong", but I assure you they are very "right" - they essentially act as a voltage clamp to keep large spikes out of the system. They are necessary.
Of course, given all of the above, you would definitely need and want an oscilloscope for the project. In the end, you haven't saved yourself any money, but instead have opened up a huge learning opportunity, should you choose to pursue it...
makarov132:
To save money, I bought a two-piece ultrasonic sensor (which was not designed for Arduino). It does look similar to other ultrasonic sensors. I have looked around and I can't find an informative data sheet or a tutorial. I don't even know which side is negative! The codes on the sides are: UST-40T, 400SR 04 62. Please help!
You may have attempted to save money, but you did the opposite. It will be far more expensive and complicated to get these to work. Also, how could you possibly save money? Complete HC-SR04 sensors are like $3 shipped!
Tim
Here is how I use 40kHz Tx/Rx trancducers
Assembled Rx units
Tx unit
How I get my 40khz signal, only because I had a 30Mhz clock module handy
I use the clock circuit to provide a dual range "count clock"
This is a single "channel" counter I use
The 3 channel unit assembled
This is pretty easy to get working and you will learn a lot more!
A much simpler drive circuit can be made from a MAX232.
Receivers are always a lot trickier though.