Hacking national geographic weather station to raspberr Pi  - Page 1
Forum section: electronics / projects

author: shiftline
author_rank: Contributor
timestamp: July 07, 2016, 02:23:19 am
content: I just picked up a "national geographic weather station for TV" and want to hack the wind sensor to work with arduino or raspberry Pi. Does anyone have a recommendation of where to start to translate the output to something useable ?

author: shiftline
author_rank: Contributor
timestamp: July 07, 2016, 04:47:13 am
content: I put the sclk (clock I'm assuming) onto the oscope. (Still learning how to use it ).Board is powered with 3vMay see if I can put the data pin (green wire) on a logic analyzer and try and make sense of it

author: shiftline
author_rank: Contributor
timestamp: July 07, 2016, 05:38:54 am
content: I'm starting to think it may be easier to ignore the built in output and Tap In to the sensors my self. The cups appear to just use a Reid switch so I should somehow be able to count the pulses to figure out wind speed.Now for wind direction what exactly are these little guys?There is 4 of them. One for North east west and south sides. They have a - and +Side

author: Kilrah
author_rank: Unknown
timestamp: July 07, 2016, 08:49:30 am
content: I'd vote for phototransistors, there must be an IR LED or such on the other side and an encoder wheel inbetween.

author: shiftline
author_rank: Contributor
timestamp: July 07, 2016, 01:54:16 pm
content: There is some form of a wheel on the other side.Is there any good way to tap into them to read it with arduino or a Pi? I'll do some research on them today

author: MosherIV
author_rank: Super Contributor
timestamp: July 07, 2016, 03:04:24 pm
content: HiCongratulations, you have a biteQuoteCan you clarify what "for TV" means?Some of things to look into :What does the unpopulated header next to C1 outputThere are 4 optical sense (T1-4) and they seem to be at different radius positionSCLK is only the clock output, there appears to be a DAT as well - could be I2C

author: shiftline
author_rank: Contributor
timestamp: July 07, 2016, 05:36:36 pm
content: If it's i2c I should be able to read it from the Pi. Do you think it's easier to try and read the i2c or tap into sensors on their own?For thr photo transistors the positives all connect and the grounds connector to r15,r13,r11,r9. Then I to the transistor?(days sl6 on it)

author: MosherIV
author_rank: Super Contributor
timestamp: July 07, 2016, 06:39:36 pm
content: QuoteYes, the Pi does do I2C, though you may have use a level shifter, the Pi gpio is 3V3.What volts is logic 1 on the weather station?

author: shiftline
author_rank: Contributor
timestamp: July 07, 2016, 09:29:25 pm
content: The data and clock are both outputting at 3vIs this close enough? Does it just read high or low or does it need to be matched to 3.3v?I also got this with a cheap logic analyzer

author: shiftline
author_rank: Contributor
timestamp: July 07, 2016, 10:01:20 pm
content: I tried using arduino to scan the i2c bus from 1-229 but it didn't find any addresses in that range

author: mikerj
author_rank: Super Contributor
timestamp: July 07, 2016, 10:30:47 pm
content: Quote from: shiftline on July 07, 2016, 10:01:20 pmIf the weather station is outputting a clock and data, then it is a master device. Connecting another I2C master such as your Arduino will not work!What is this circuit supposed to connect to at the other end?

author: MosherIV
author_rank: Super Contributor
timestamp: July 07, 2016, 10:36:20 pm
content: QuoteYes, that is fine.Like mikerj says, what connects to the other end?

author: shiftline
author_rank: Contributor
timestamp: July 07, 2016, 10:56:48 pm
content: Other side connects to this. It's a battery operated transmitter (4xAA Runs at 3v). It lets you connect the wind as well as a rain sensor than wirelessly transmits to a box connected to the tv to display weather data. I picked it up yesterday off a classified site as I really just needed the wind speed/direction sensor for my internet project

author: MosherIV
author_rank: Super Contributor
timestamp: July 07, 2016, 11:09:40 pm
content: HiYou have a logic analyser, conect the weather station together and use the logic analyser to capture the I2C between the wind vein and the transmitter.You should be able to reverse eningeer the protocol.Capture what hapoens when you turn it to each diection N, E, S, W.Capture what happens when you blow in the wind speed sensor and what happens when it stops.How familiar are you the I2C protocol?

author: shiftline
author_rank: Contributor
timestamp: July 07, 2016, 11:14:58 pm
content: It's a very basic logic analyzer that I only partially know how to use. (sainsmart dds140)Is it for sure i2c with the sclk/data ports? (That's my guess anyways)The last capture was off the back of the plug pinsSadly there doesn't look to be any decoding in the software. I downloaded one called sigrok that decodes it as well but haven't been able to get it working with the sainsmart yet

author: MosherIV
author_rank: Super Contributor
timestamp: July 07, 2016, 11:34:44 pm
content: Cannot tell from the pictures of the logic analyser, looks like only captured 1 signal at a time, need both sda and scl at the same time.Look up i2c protocol on Wikipedia, gives reasonable explaination of what the format is.BasicsStart bit (sda goes low scl high)1st byte is device 7bit address, last bit of byte is read/write bit, all bytes are 9 bits, 8 data bits 1 ack bit2nd bytes onwards can be anything, up to device.All messages end with stop bit (sda goes high with scl high)

author: shiftline
author_rank: Contributor
timestamp: July 08, 2016, 01:00:21 am
content: I got a better shot with both Chanel's this time.

author: MosherIV
author_rank: Super Contributor
timestamp: July 08, 2016, 06:56:44 am
content: Hmmmmmmm, it does not look like a good clean I2C signal.Does the thing work if you set it up and connect it to the TV?

author: mikerj
author_rank: Super Contributor
timestamp: July 08, 2016, 07:16:30 am
content: If the receiver isn't connected when you captured those traces then I have doubts about it being I2C. Assuming no receiver, SDA line must have a local pull-up since this is an open collector output in an I2C system. Without a slave device connected you would expect every ninth bit (ACK bit) to be high, and any half reasonable I2C implementation would abort the transmission at that stage.It may well be a proprietary protocol, in which case you'd need to do a bit of reverse engineering e.g. spin the anemometer at different speeds and see which bits change.

author: AndreasF
author_rank: Frequent Contributor
timestamp: July 08, 2016, 07:17:44 am
content: I don't think it's I2C, as both the clock and data line seem to be low when idle (I2C is an "open-drain" bus - devices can only pull lines low and when idle passive pull-up resistors pull the lines high). It's probably some variant of SPI. In one of your first LA posts there seemed to be exactly 48 clock cycles, i.e. a package of 6 bytes. If this is consistent, it shouldn't be too difficult to figure out what's going on.

author: MosherIV
author_rank: Super Contributor
timestamp: July 08, 2016, 12:03:08 pm
content: I am beginning to think it may not be I2C either. I2C was designed primarily to work locally, not down long wires and has poor noise immunity.I also doubt it is SPI (or some variant) for similar reasons. In addition SPI need a minimum of 4 lines : SCLK, MOSI, MISO, SSSPI has even less tolerance for noise than I2C.We need to see what the lines show when the system is working and something happens with the wind vein.

author: 1design
author_rank: Regular Contributor
timestamp: July 08, 2016, 12:38:49 pm
content: SPI works just as well with just 2 lines, at least for unidirectional communications.

author: MosherIV
author_rank: Super Contributor
timestamp: July 08, 2016, 12:51:24 pm
content: QuoteTechnically NOT SPI.There is a 3 wire version of SPI but not a 2 wire that I am aware of.

author: Kilrah
author_rank: Unknown
timestamp: July 08, 2016, 02:00:21 pm
content: You might be able to do without MISO if the communication is unidirectional, but you do need CS to initiate each transation.

author: EntropyWizard
author_rank: Contributor
timestamp: July 08, 2016, 03:03:02 pm
content: You may be able to get more information here:http://www.weewx.com/docs/usersguide.htm,esp. if they have a forum somewhere. weewx is an open source python program for reading many different weather stations and sensors; they may at least have an idea what you are dealing with or even know the protocols already.

author: shiftline
author_rank: Contributor
timestamp: July 08, 2016, 03:11:45 pm
content: MosherIV- I'm assuming it works as t was brand new but I haven't tested it yet. I can try hooking it up to the tv laterMikerJ. If it's property I may be better off going back and trying to tap into the sensors?Wind speed is just a reed switch so I could count the pulses. It would hist be figuring out how to read from the phototransistorsI'll hook up the full thing first and give it one more whirl of capturing bits then decide . That capture was just the wind sensors talking to the base station (base station transmits signals to tv box)

author: shiftline
author_rank: Contributor
timestamp: July 08, 2016, 05:37:21 pm
content: To tap into the circuit after the phototransistor would I want to tap into the output of the transistor?

author: shiftline
author_rank: Contributor
timestamp: July 08, 2016, 06:14:52 pm
content: I hooked the logic analyzer up to the negative side of the phototransistorsEastWestSouthNorth

author: shiftline
author_rank: Contributor
timestamp: July 08, 2016, 06:46:18 pm
content: Here's the signal after the transistors

author: MosherIV
author_rank: Super Contributor
timestamp: July 09, 2016, 09:28:08 am
content: I do not think the logic analyser is the best instrument to use for probing transistors. Logic analysers only detect logic 1 ( >2.7V) and logic 0 ( < 0.3V). An oscilloscope would be the instrument to use so we can understand what is going on.What does before and after the transistors mean?The designers have already done the hard work of interfacing to the sensros, I would not try to work around their design. It would be better (and easier) to figure out what the outout is.It could be a lot of work to figure out the sensors and how to interface to them reliably.

author: AndreasF
author_rank: Frequent Contributor
timestamp: July 09, 2016, 09:35:31 am
content: Quote from: shiftline on July 08, 2016, 06:14:52 pmI wouldn't use the logic analyzer for that. It's going to be an analogue signal that may not even be in logic level range. All the back and forth that you see at the end (and sometime beginning) is probably the voltage slowly transitioning the logic level threshold. Most likely it will feed into a Schmitt-trigger type input at whatever controller the board is using to avoid this sort of thing.

author: shiftline
author_rank: Contributor
timestamp: July 11, 2016, 02:48:33 pm
content: Thanks for the feed back. I'll try putting it on the scope tonight (data/sclk pins)Before transistor meant pulling the signal fromThe phototransistor And after meant pulling it from the output of the phototransistor > resistor transistorAs a disclaimer I still don't fully know what I'm doing.. So it's a learning process!

author: Perry L
author_rank: Newbie
timestamp: July 01, 2017, 02:40:11 am
content: Hi there.I just got my weather station today at a used store in town.If you are not sure and don't want to mess the inside up I would add my own switch and save the rest of the guts for another day.For me what I'm doing with mine is connecting it up to my surveillance system so the family can see it from anywhere over the network and internet.I have 2 8 channel DVRs for surveillance. 1 is just connected to my network and the other one is over the internet.I had just started printing all the parts last week. But now that I have this I don't have to. I just have to wire it in and for the most part done.But I might have to do what I said up top because I need to monitor the wind.I have to know when the wind is to strong so that I can flatten my solar panels. So the wind does not rip them off my roof.I have just started looking for the manual. It looks like that is the only thing missing. If you know were I could find it that would be great.Good luck And if you have any questions just ask.

author: Perry L
author_rank: Newbie
timestamp: July 01, 2017, 02:45:00 am
content: Perry here again.Did you think of the data lines being rs485.And I know its been a little bit but did you find any new info about the way the data is moving?Thanks again.

author: Perry L
author_rank: Newbie
timestamp: July 01, 2017, 02:56:55 am
content: Perry here Again.Me with out a manual. What is the Antenna for in the connection box for out side?Any Ideas.I have not opened any of my parts yet. It is late and I just cant be up all night tonight. So I cant open anything or really get started.Canada Day tomorrow. Big Big party. Lots to drink and eat 30-40 people coming over. And Its going to be a very late night.I do feel very sorry for the poor DOGS in the neighborhood. (Not really! Now its my turn.)Thanks again.

author: shiftline
author_rank: Contributor
timestamp: August 14, 2017, 06:21:55 am
content: Hey perry! Did you ever get anywhere with yours? This project is on the side burner but your inspiring meTo break it out again and finish getting it goingSent from my iPhone using Tapatalk

author: C
author_rank: Super Contributor
timestamp: August 14, 2017, 03:02:51 pm
content: Let me state what others have already suggested a different way.If you have all the parts, set it up so that it works as intended.Now you have two easy spots to spy on what it is doing and gain from all that is already done.You could spy on connections between outside unit and outside transmitter.You could spy on connections between inside unit and inside transmitter.Why spy, because the unit will keep functioning if your spy connections do not do something like draw to much current to prevent normal operation.You now have what is shown on TV to see if your guess is correct with the data format on spy connections is correct.