I finally made it: Got my weather station up and running. Well, actually it's been running for about two weeks now but I've been too lazy to post it and I've been making little improvements here and there.
The whole system has remote unit, main unit and a Linux PC. Communication between remote and main units is done with RFM12B RF-modules. Main unit communicates with PC via USB serial connection. And of course there's Twitter connection via http (thanks CtC and Glen the Stove for the idea).
Weather station system
The system and communications in general:
All communications use datagrams that have 16-bit CRC included. Remote unit sends new measurements to main unit about every 20 seconds. Main unit’s main loop waits until it receives a datagram containing measurement data from remote unit. Then the main unit reads its own SHT15 sensor, adds that data to datagram and sends the datagram to PC. After that the main unit asks min/max values and current time from PC. Min/max values have minimum and maximum temperatures for 12 and 24 hours from both inside and outside (main and remote unit).
RFM12Bs use SPI for communication with ATMegas. Both BMP085 and SHT15 use I2C. Well, SHT15 uses “I2C compatible” protocol that is not exactly I2C but it doesn’t mess up other “real I2C” devices on the same bus. Check SHT15 datasheet for more information.
Remote unit runs on ATMega168. It has BMP085 pressure sensor and SHT15 humidity sensor. Temperature is measured with SHT15 (BMP085 measures temperature too). LDR is used to measure light level. Battery voltage is measured too. ATMega talks to RFM12B via SPI. Remote unit is power by 4AH lead acid battery.
Remote unit opened
Remote unit closed and ready to go out.
Yeah, I know it looks kinda funny Those yellow ping pong balls contain BMP085 and SHT15 sensors. The casing for remote unit has a lot of unused space because I was planning to make wind speed and direction measuring thingy too but never got it ready (maybe in V2).
Main unit run on ATMega168 too and like remote unit it has SHT15 sensor for measuring humidity and temperature. RFM12B comms is similar to remote unit. Main unit has FTDI FT232RL USB UART chip for USB serial communication with PC. Main unit’s display is 20x2 character LCD. LCD’s data is transferred via 74HC595 serial-in-parallel-out shift register. 2 direct IO pin connection are used to control LCD (E and RS pins). Main unit gets its power from USB bus.
Main unit has main display, min/max displays and a couple of displays for error statistics.
LCD in the box
Solder side on main unit’s perfboard (inside the box)
Component side of main unit’s perfboard
Buttons and SHT15 connected
Main unit front
Main unit’s SHT15 sensor is hanging on its wires because it seemed to show a bit too high temperature is it was placed nicely on the side. Maybe it was the heat from components (or just my imagination).
PC is running Ubuntu 10.04 server edition. Weatherlogger daemon uses (USB) serial port to communicate with main unit. It logs measurements sent by main unit to Postgresql database and sends min/max and time information back to main unit. PC also updates Twitter status and profile image every 10 minutes.
That’s about it:
Yup, that’s about it. Schematics are missing because didn’t draw them and I think I’m too lazy to draw them afterwards, sorry. Source code package (https://www.robotshop.com/letsmakerobots/files/weather-station.zip) includes README.txt file that has some (very brief) instructions how to compile the source. Source code includes with abraham-twitteroauth (https://github.com/abraham/twitteroauth) that has been patched to support image updating (https://github.com/vsr/twitteroauth/commit/06306eb17c748bfff0215bc7580baf38360a78f0) to handle Twitter’s OAuth. Some BMP085 code has been adopted from examples made by Bosch Sensortec GmbH.
Check out the latest weather here: http://twitter.com/saamies