I'm still an arduino beginner, so this may either be a long shot or else a really basic question.. hopefully someone can point me in the right direction
I recently bought a very cheap ($12) indoor/outdoor thermometer, which didnt work right from the get go. This afternoon I took it apart and was interested to see that the wireless receiver element was a seperate board with only three pins, kindly named GND, Data and VDD.
It looks like this:
I've hooked up GND to ground, VDD to 3.3v on the arduino (unit was powered by two AA batteries) and Data to pin 7 on my arduino.
Using the following code, I can see it's receiving 'data' from the wireless sensor outside:
Is there any way I can convert this stream of data back to a number? For what it's worth, I know that the value transmitted is around 37 degrees because that's the temperature outside at the moment.
Apologies if this is a ridiculous question, I seriously have no idea what's possible with the arduino....
You need a few samples at different temps to find a pattern. I can see a BCD 3 7 in that pattern shown in the high pulses but it might be coincidence without seeing another reading also in the 30s.
Look for groups of 4 or 8 that would match the binary values and also count 2 bits for the 100s and negative. Then shave off the start and stop bits which should be obvious because they don't fit the normal 800/400 pattern. Also try looking at it as sending both MSB and LSB first. There's a definite pattern there that should become obvious with more samples.
Here's the breakdown on what I'm seing based on 37 and that single sample. The top 3 bits would hold the 100s and negative value.
It should be obvious with a different reading if this is correct.
Savitch that's brilliant, I'm trying to repeat your process to look through more data (I have loads, one example below). Forgot to mention the thermometer read out I can see on other device that receives actually has a decimal place, for the below I believe it was 37.9....
Quick question - provided I work out how to decifer the preamble, do you know of any libraries for the arduino that can interpret the data? or is this beyond the arduino?
Appreciate your help with this mate, it's fascinating for me......
Please post whatever details you can about the unit concerned... stuff we can use to try to track down a source? Hard to get enthusiastic about the work of writing code for a "one off" situation? It may well be that someone (China? ) has created modules that different retailers are putting in different pretty housings, so markings on the pcbs of interest as well as the "outer" markings.
Also you said it didn't work, as supplied... what were the problems there?
That last one is the same method but it looks like the bits are carried on the low pulse so divide up the long and short low pulses to figure out the 1 and 0. Find the numbers in BCD then the rest will fall in place as some sequence of 4,7 or 8.
This is similar to how an IR remote is decoded so if you search for that you will probably find examples of what to do.
Please post whatever details you can about the unit concerned... stuff we can use to try to track down a source? Hard to get enthusiastic about the work of writing code for a "one off" situation? It may well be that someone (China? Smiley ) has created modules that different retailers are putting in different pretty housings, so markings on the pcbs of interest as well as the "outer" markings.
Totally agree - sorry I didnt include more info at the beginning of the thread but to be honest as I said, I wasn't sure if I was asking a very basic question or a more difficult one (which it appears to be... :/)
Anyways, I've taken some more photos (below) that will hopefully give you some more info - for what it's worth I've seen many of the cheaper indoor/outdoor temp stations with the same transmitter as below which would make me think they are quite common. Interesting too that the send/receive are both breakout boards so quite likely found in other things.
I've googled all the numbers on the PCB of the receiver without any luck, perhaps someone here recognises them?
I've also just noted there's a TX/Reset button inside the transmitter, so I'm going to use that to see if I can't capture some decent data.
Cheers.
Transmitter module, branded Sontax (although I believe they're a Australian chinese goods importer, so probably oz specific)
Transmitter front
Transmitter back
Slightly skanky but working receiver... yes, it's bloody hot here, 41 degrees outside
Shell from the broken receiver that I pulled the receiver module from.
OK, apologies for replying to myself here, but have made some more progress, perhaps someone can help me here?
Using the code found here Arduino Playground - InfraredReceivers I have managed to capture the data more accurately and using gnuplot I can get the following:
Output can be found here at the, the temp should read 34.0 degrees.
Not sure if the code will be helpful, but something similar was posted on Practical Arduino:
As for what's being sent, why not just hook up the Arduino board to the transmitter pins.. since the Transmitter outputs TTL (from the looks of the RF kits), you should be able to hook up your RX on the Arduino, and just use Hypertrm or something of the sorts to read it.
Take the chip off the board, and just hook up the "data" to the TX on board. (yes the TX) And don't forget your grounds.. Then, just read data being output, and compare.
This will make sure you're not reading any random noise, which is what you get if you try reading without checksums, parity.. blah blah.
Thanks CaptainObvious - been trying to make some sense of the code in the project you linked to, to be honest, will need to learn a little more c coding to get a full understanding.
I just started playing around with using the software serial library trying to read out data received from the receiver data pin (I will get to disassembling the transmitter but that will have to come second as my wife uses the outside temp reading all the time and would kill me if I break it )
Is there value in using the software serial library? if so, any idea what would be a good baud rate to chose? I started with 1200 and can see data when I push the sync button on the transmitter however not really sure how to output/capture the data for analysis - seems the softwareserial read() method pulls a character off the line which might be incorrect?
I was hoping to generate a bunch of capture strings and then anaylse for similarity and/or changes that might help me work out the current temp.
Am I just being too optimistic with this approach?