I started out by writing some simple code for the Arduino that tests out the basic capabilities. I can read analog values from the fake temperature probe and convert them to actual temperatures using a lookup table. I can control the fan and adjust its speed by adjusting the duty-cycle of the output pin. Then I made the system 'smart' by adjusting the fan speed to according to the temperature error value.
With the Ethernet board, I can also communicate over TCP/IP. For now it's a wired connection; once the code's all figured out, I'll add wireless capabilities either by adding a Wifi bridge or by using a Wifi module instead of the Ethernet board.
I wrote some very simple code to implement a basic web server, and I can serve up a simple web page to show basic info about the temperature and fan speed. The html includes a refresh tag so that the browser automatically reloads it every five seconds. Pretty cool. :-) Next, I'll write a bit of code to send alerts via email or Twitter.

So far I've already used about 9k of my available 30k code budget; granted, nothing's optimized yet, but I'm gonna need to write some pretty tight code to cram everything in there!
No comments:
Post a Comment