weather-station.zip (102672Bytes)
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:
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:
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
Ā