Use the hardware Serial pins of your Arduino and the normal Serial library, set to the correct baud rate. Connect the converter's TX to Arduino RX and the other way around.
With the wiring you show you should be using SoftwareSerial.
By the way, are you sure this is an ultrasound sensor, not a capacitive sensor? Please post a link to its data sheet.
Other than it's shocking price, that's a very interesting sensor.
It is just glued to the bottom of the container, right?
Where's it's data sheet or manual?
Housing indicates it's weather proof but no claims of that on any of the many sites that sell it.
No information on how to read this sensor, at all. It's also known as DYP-1603.
It apparently can be use as level switch if mounted to the side of a tank, and as absolute level sensor (no word on calibration; unsure whether the wall thickness has any effect) for 50-1000 or even 50-2000 mm liquid depths when mounted on the bottom of (i.e. beneath) the tank.
There are various versions of the sensor: DS1603AQ (analog output), DS1603NF (level switch - only a high/low signal), DS1603DA (UART/Serial output) and finally DS1603L which appears to have UART output, and a fifth wire marked "OUT" - my best guess is that this is meant to be a level switch.
And here you go, something that closely resembles a manual on this page. The UART is apparently 9600 bps TTL compatible (provided you supply it 5V it should never get over that voltage, and it apparently will also work on 3.3V). Quite irritating that the text is in the form of images so Google Translate doesn't work.
Prices on Alibaba/Taobao are RMB85 for single units, and go down to RMB68 in volume which is a lot friendlier price already
It’s a slowish sensor: one measurement per second; no liquid detection takes 10 seconds; liquid present 2 seconds. Good enough for most practical purposes.
No word on how to initiate conversion or so. Power with 3.3-12V, typical 5V, TTL compatible UART output. So it should be possible to connect direct to Arduino’s RX/TX pins.
9600 bps, 8 data bits, one stop bit, no parity bit.
4 bytes of data:
Oh, continuous stream of data. That's why that header, then. Makes sense.
255 - 0 - 0 - 255 would be a single set of readings (header, data_h, data_l, sum). That's when the sensor is not attached to a container filled with liquid, right?
The first set of numbers doesn't make sense to me. It should for starters be series of four numbers.
I connected the sensor directly to arduino and like you said, 255-0-0-255 means no liquid present.
When liquid is detected it outputs a fixed 255 and three other numbers depending on the height of the liquid.
I'll just have to do some calibration with different types of liquids.
The package came with a glue(fluid), which I had to apply on the surface of the container before it could detect the liquid present.
Thanks for reporting back. I am definitely going to try out these sensors myself, too.
If your liquid is water, there's a fair chance little or no calibration is needed. After all the speed of sound in water is fairly constant, and it seems all parameters of the sensor are based on use with water.
Several times the manufacturer talks about measuring the level of water, and calibrating with water.
Water is probably the most common liquid on this planet, it’s cheap and readily available, and pretty safe in use. So it makes sense they use water for that.
I suppose it will work just fine with propane, they do talk all the time about “any liquid that can not be touched” such as corrosive and flammable liquids.
The principle seems to be entirely based around bouncing ultrasound waves off the liquid’s surface, so I don’t see why it wouldn’t work for other liquids. You’ll have to calibrate for your liquid (though if you look up the speed of sound in water vs. propane you should be able get a reasonable estimate on how to calculate one from the other).
Just got one of those sensors myself - reading the data is no problem but I can't get it to detect water. I tried pushing it to the bottom of various containers, but nothing seems to work.
The package did include some kind of adhesive, so maybe its not making good enough contact. How did you fare in this?
Too bad you didn't buy two - so you could dissect one and see what's inside.
wvmarle:
I tried pushing it to the bottom of various containers, but nothing seems to work.
You mean you held it tight up against the bottom (outside) of various containers? Did you use the adhesive? Seems like it probably needs the adhesive for proper coupling.
Did you try steel containers? What wall thickness and size?
But anyway, it is a bit hard to believe this could work (finding fluid depth when mounted on the outside of a vessel)...especially if the wall is thick.
But not going to dissect any before I got at least one working It seems the problem I have is in the contact with the container. Gotta rig up a test thing with batteries and LCD or so, make it more mobile. At least reading the thing is pretty straightforward, every 2 seconds it will simply transmit a reading.
You mean you held it tight up against the bottom (outside) of various containers? Did you use the adhesive? Seems like it probably needs the adhesive for proper coupling.
Did you try steel containers? What wall thickness and size?
Also, it would be interesting to hold the "business end" of the sensor slightly under the water surface (at the top of the container), pointed down toward the bottom of the container, to see if works as a typical "sonar"...bouncing a signal off the bottom of the container.
I tried a glass and a plastic container, no adhesive. I suspect that to be the problem (I suppose it's not just because that they add the stuff to the package, even though the Taobao listings don't mention it). Final application is for metal containers, just hoped to get some readings on the bench before committing to gluing it on to one of the containers.
It's for 1.2 mm stainless steel containers, max about 30 cm of water. That's all well within specs and expected to work fine. A second practical issue is the rather short wiring, which I have to do something about - and then waterproof the joint as it's an outdoor application. That's also why I didn't want to start gluing and so just yet.
You could try some K-Y jelly or similar as a temporary coupling material (before committing to the adhesive). Our ultrasonic thickness gauges (for measuring the thickness of metal components) use a fairly viscous fluid like that.