Arduino Powered Weather Station

This is my first real Arduino project and my first blog post/tech write-up, so I hope everyone can follow along ok.

Recently while looking for something to do in my down time, I came across the Arduino and it looked to be the perfect item for me to play with. I like to tinker and build things. I am memorized by pretty blinking lights, and I code write code that left the screen. So I asked for one as a gift.

Browsing the web one day I came upon this post from RobotRoom.com that explained in some detail about a 14-segment led display that could be driven with just 5 pins, and best of all it was just $1. Figuring you can never go wrong for a $1, I ordered 4. Using the details laid out in the Robot Room article, I was amazed at how simply I was able to control the leds on the display. After a bit of trial and error, I left a nice scrolling message for my girlfriend to see the next morning and went to bed.

At that point, one display was nice, but I had 3 others, and if I could drive 1 display, how hard could 4 be. I decided to mount them together and mount them into a 4×6 frame and have it display me the weather. The 7 segment alphanumeric characters on the first line is perfect for displaying the conditions, while the 4 digit numeric characters on the 2nd line would be good for temperature. 4 displays means I can show todays forecast, plus the forecast for the next 3 days.

Onto the technical stuff.

Each display has 5 pins. one ground and power, one reset pin, a data pin and a clock pin. Only the data pin per display needs its own unique Arduino pin, the ground, power, reset and clock pins from each display can all be tied to each other. As mentioned in the Robot Room write-up, each display has 5 scan lines each with 36 bits of data. This means only about 1/5 of the display can be lit at any time, but updating faster then the eye can see makes the entire display look “always on”.

The first code I wrote to update all 4 displays, 5 scan lines of the first display, moved on to the 2nd display and updated all 5 lines and so on. While this worked, the 5th line of each display was “on” while the other displays were being updated. This caused the other 4 scan lines to flicker and the 5th to burn bright. Scan lines 1-4 of each display were on 1/20 of the time, while the 5th line was on 16/20 of the time. To solve this, I rewrote the code to update the first scan line over all 4 displays, then the 2nd scan line over all displays and so on. Making each line on the same 1/5 of the time. I also realized since the clock line where all tied together, it was silly to send 36 bits to the first display, toggling the clock between each bit for all 4 displays, when I could send a bit for all 4 displays and toggle the clock and do that 36 times. Thats 36*3 less clock toggles per line.

After getting the 4 displays to show anything I wanted, it looked a bit boring just static, so I decided to enable it to have a few different frames. Switching between 2 or 3 frames of different text. This would allow me to show which date the forecast was for and switch between high and low temp for the day. After getting that to work, the problem was now that it wasn’t dynamic. All the text to show was stored in the Arduino program. Time for some trusty Perl.

I’m not sure if I did this the best way or what, but it works. I decided to create my own little protocol for a serial connection to update the displays. It goes something like (display)(line)(frame)(text)\n Display, line and frame being numerals. So if I wanted to update the 7 characters that make up the 3rd displays 1rst line and 2nd frame with “ARDUINO”, I would send over the serial line 312ARDUINO\n The Arduino code picks that up and displays it in the proper position and time. The Arduino code itself knows nothing about weather, it can show anything you send it. It just happens the perl script sends weather data.

Issues:

I hate that it is tied to a computer. I can’t see spending the money on a xport or wireless solution just yet. And it is now using my $30 arduino that I still want to play with for other projects. I need to make it quick disconnect for now, or get a boarduino.

From here:

I need to mount it in the frame a bit better and somehow hide the whiteness of the leds when off. I think smoked Plexiglas would be nice. There are still free pins on the ardunio. I’m fairly certain it could handle another 4 displays. All the code would need is a few variable changes. Or I could arrange the new 4 in a line and have a 28 character display that I could scroll text across. Or I could use the three PWM pins to add some glowing ambiant orb that displays another vairable.

Code

Arduino code
Perl: weather_station.pl

6 Comments

  1. Andy Said,

    February 22, 2008 @ 5:50 am

    I get a 500 error when trying to view the perl code, and I’d really like to take a look!

  2. TimW Said,

    February 22, 2008 @ 9:01 am

    Andy..

    I made a new text file with the perl code:
    http://www.82smugglers.com/blog/wp-content/uploads/2008/02/weather_station_pl.txt

    Fairly simple… let me know if you have any questions about it.

  3. salsa Said,

    February 22, 2008 @ 5:44 pm

    maybe replace the arduino with a boarduino or just a stripped-down breadboard version with a chip…?
    http://www.adafruit.com/index.php?main_page=index&cPath=19

  4. TimW Said,

    February 22, 2008 @ 5:50 pm

    Yeah, at some point I will get a few boarduinos or the like. The only issue with that is that they require the $20 FTDI cable.

    I’d like to get an xport and see just how many different things I can control with a single arduino.

  5. Roland Latour Said,

    March 5, 2008 @ 2:44 pm

    I use a Diecimila under Kubuntu, via shell scripts I have
    developed. Pls see my mini-site, 207.14.167.161 for the
    tarfile. Not 24/7, only works when my PC is booted, so
    pls keep trying. Or email rolandl@cavenet.com.

    Full IO & PWM control. AD is scaled to mV, formatted for
    import to most spreadsheets. Modular/Expandable. Pls
    give it a try. Thanks.

  6. dave Said,

    July 2, 2008 @ 1:17 pm

    I was having issues getting the perl script to update the Arduino. Soon as it finished it would just show the initial text “Arduino Powered Data Display…”

    I had an issue with my particular Diecimila board. It appears that some were incorrectly loaded with the NG bootloader. This caused issues for me as it causes the Arduino to reset when the Serial connection is opened/closed.

    There are a couple of modifications you can make if you search around the forums enough (desolder a capacitor, burn the updated bootloader, etc.)

    Not sure if this is the correct way of doing this, but I found that the reset is initiated using the DTR functionality, so adding the following command helped me out…maybe it will help somebody else with the same issue:

    $port->dtr_active(0);

    -Dave

RSS feed for comments on this post