Author Topic: Hacking national geographic weather station to raspberr Pi  (Read 9291 times)

0 Members and 1 Guest are viewing this topic.

Offline shiftlineTopic starter

  • Contributor
  • Posts: 36
  • Country: ca
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 ?


 

Offline shiftlineTopic starter

  • Contributor
  • Posts: 36
  • Country: ca
Hacking national geographic weather station to raspberr Pi
« Reply #1 on: July 07, 2016, 04:47:13 am »
I put the sclk (clock I'm assuming) onto the oscope.  (Still learning how to use it ).


Board is powered with 3v

May see if I can put the data pin (green wire) on a logic analyzer and try and make sense of it
« Last Edit: July 07, 2016, 04:51:24 am by shiftline »
 

Offline shiftlineTopic starter

  • Contributor
  • Posts: 36
  • Country: ca
Re: Hacking national geographic weather station to raspberr Pi
« Reply #2 on: July 07, 2016, 05:38:54 am »
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
 

Offline Kilrah

  • Supporter
  • ****
  • Posts: 1852
  • Country: ch
Re: Hacking national geographic weather station to raspberr Pi
« Reply #3 on: July 07, 2016, 08:49:30 am »
I'd vote for phototransistors, there must be an IR LED or such on the other side and an encoder wheel inbetween.
« Last Edit: July 07, 2016, 08:51:01 am by Kilrah »
 

Offline shiftlineTopic starter

  • Contributor
  • Posts: 36
  • Country: ca
Re: Hacking national geographic weather station to raspberr Pi
« Reply #4 on: July 07, 2016, 01:54:16 pm »
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
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: Hacking national geographic weather station to raspberr Pi
« Reply #5 on: July 07, 2016, 03:04:24 pm »
Hi

Congratulations, you have a bite  ;)

Quote
I just picked up a "national geographic weather station for TV"
Can you clarify what "for TV" means?

Some of things to look into :
What does the unpopulated header next to C1 output
There are 4 optical sense (T1-4) and they seem to be at different radius position
SCLK is only the clock output, there appears to be a DAT as well - could be I2C
 

Offline shiftlineTopic starter

  • Contributor
  • Posts: 36
  • Country: ca
Re: Hacking national geographic weather station to raspberr Pi
« Reply #6 on: July 07, 2016, 05:36:36 pm »
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)

 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: Hacking national geographic weather station to raspberr Pi
« Reply #7 on: July 07, 2016, 06:39:36 pm »
Quote
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?
Yes, 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?
 

Offline shiftlineTopic starter

  • Contributor
  • Posts: 36
  • Country: ca
Hacking national geographic weather station to raspberr Pi
« Reply #8 on: July 07, 2016, 09:29:25 pm »
The data and clock are both outputting at 3v
Is 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
« Last Edit: July 07, 2016, 09:39:03 pm by shiftline »
 

Offline shiftlineTopic starter

  • Contributor
  • Posts: 36
  • Country: ca
Re: Hacking national geographic weather station to raspberr Pi
« Reply #9 on: July 07, 2016, 10:01:20 pm »
I tried using arduino to scan the i2c bus from 1-229 but it didn't find any addresses in that range
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3306
  • Country: gb
Re: Hacking national geographic weather station to raspberr Pi
« Reply #10 on: July 07, 2016, 10:30:47 pm »
I tried using arduino to scan the i2c bus from 1-229 but it didn't find any addresses in that range

If 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?
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: Hacking national geographic weather station to raspberr Pi
« Reply #11 on: July 07, 2016, 10:36:20 pm »
Quote
The data and clock are both outputting at 3v
Is this close enough?
Yes, that is fine.

Like mikerj says, what connects to the other end?
 

Offline shiftlineTopic starter

  • Contributor
  • Posts: 36
  • Country: ca
Re: Hacking national geographic weather station to raspberr Pi
« Reply #12 on: July 07, 2016, 10:56:48 pm »


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
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: Hacking national geographic weather station to raspberr Pi
« Reply #13 on: July 07, 2016, 11:09:40 pm »
Hi

You 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?
 

Offline shiftlineTopic starter

  • Contributor
  • Posts: 36
  • Country: ca
Hacking national geographic weather station to raspberr Pi
« Reply #14 on: July 07, 2016, 11:14:58 pm »
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 pins




Sadly 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
« Last Edit: July 07, 2016, 11:20:31 pm by shiftline »
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: Hacking national geographic weather station to raspberr Pi
« Reply #15 on: July 07, 2016, 11:34:44 pm »
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.

Basics
Start 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 bit
2nd bytes onwards can be anything, up to device.
All messages end with stop bit (sda goes high with scl high)
 

Offline shiftlineTopic starter

  • Contributor
  • Posts: 36
  • Country: ca
Hacking national geographic weather station to raspberr Pi
« Reply #16 on: July 08, 2016, 01:00:21 am »
I got a better shot with both Chanel's this time. 
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: Hacking national geographic weather station to raspberr Pi
« Reply #17 on: July 08, 2016, 06:56:44 am »
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?
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3306
  • Country: gb
Re: Hacking national geographic weather station to raspberr Pi
« Reply #18 on: July 08, 2016, 07:16:30 am »
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.
 

Offline AndreasF

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: gb
    • mind-dump.net
Re: Hacking national geographic weather station to raspberr Pi
« Reply #19 on: July 08, 2016, 07:17:44 am »
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.

my random ramblings mind-dump.net
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: Hacking national geographic weather station to raspberr Pi
« Reply #20 on: July 08, 2016, 12:03:08 pm »
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, SS
SPI 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.

 

Offline 1design

  • Regular Contributor
  • *
  • Posts: 162
Re: Hacking national geographic weather station to raspberr Pi
« Reply #21 on: July 08, 2016, 12:38:49 pm »
SPI works just as well with just 2 lines, at least for unidirectional communications.
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: Hacking national geographic weather station to raspberr Pi
« Reply #22 on: July 08, 2016, 12:51:24 pm »
Quote
SPI works just as well with just 2 lines, at least for unidirectional communications.
Technically NOT SPI.
There is a 3 wire version of SPI but not a 2 wire that I am aware of.
 

Offline Kilrah

  • Supporter
  • ****
  • Posts: 1852
  • Country: ch
Re: Hacking national geographic weather station to raspberr Pi
« Reply #23 on: July 08, 2016, 02:00:21 pm »
You might be able to do without MISO if the communication is unidirectional, but you do need CS to initiate each transation.
 

Offline EntropyWizard

  • Contributor
  • Posts: 28
  • Country: us
    • GitHub
Re: Hacking national geographic weather station to raspberr Pi
« Reply #24 on: July 08, 2016, 03:03:02 pm »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf