You Are Here: Home » AVR ATmega Projects » LED Projects » Weather Canvas Using Atmega644

Weather Canvas Using Atmega644




Introduction

The Weather Canvas is a robust outdoor weather monitoring system coupled with an indoor LED display. The outdoor system consists of a microcontroller, temperature sensor, humidity sensor, home-made anemometer, a Hot Wheels radar gun modified to measure precipitation, and a solar panel to measure sunlight and charge the microcontrollers power source. Once per minute, the system transmits the data it has collected to the indoor microcontroller by a 433 MHz RF signal, where the signal is decoded and the information is displayed as a sequence of five vibrant images on the 8×8 RGB LED matrix. The images chosen by the system depend of the weather conditions transmitted. The indoor system uses pulse width modulation (PWM) to provide millions of potential colors to each pixel, allowing for limitless image possibilities.

Weather Canvas Using Atmega644

High Level Design

Rationale

This project was a combination of several core components we wanted to include. Radio frequency communication seemed like an interesting concept to implement, and we were trying to figure out ways to integrate the Hot Wheels radar gun for a long time. Its ability to detect motion was appealing, and we considered doing an invisible fence that is not painful to pets. The Weather Canvas idea came from browsing the Spark Fun website, where we saw an 8×8 RGB LED matrix, and we wanted our project to use it after watching some YouTube videos. Our shared interest in renewable energy led us to solar power, and these ingredients came together for the perfect recipe: a weather monitoring system. After we had decided on the concept, all of the pieces started falling into place: RF to communicate with an indoor unit using the RGB LED display, radar to measure rainfall, and solar power to measure and harness sunlight. The temperature, humidity, and wind sensors followed naturally. We knew integrating these several separate parts would be a challenge but were willing to undertake it to see the final result.

Logical Structure

The most important feature of this project is the RF communication between the outdoor and indoor unit. Without it, the LED matrix would have nothing to display and the outdoor monitoring unit would keep the information for itself. The data path starts at the sensors, whose information is collected by the outdoor MCU. It relays this information indoors with the RF encoder/transmitter. The receiver/decoder unpacks the data for the indoor MCU, which then determines the images to display on the LED matrix based on the data it is has received.

Hardware/Software Tradeoffs

Early in our project design, we had to decide how to implement RF. Our first instinct was to replicate the system used by Meghan Desai in her Wireless Telemetry project. We had allotted the price of the RCT-433 transmitter and RCR-433 receiver and were preparing to write all the encoding/decoding code, which appeared intimidating. Bruce Land made a comment as an addendum to his talk about RF regarding an integrated circuit by Holtek which encapsulates the encoding and transmitting protocols into one hardware unit. After being redirected by several companies including Digikey, we found a supplier at Rentron who was eager to sample us the Linx Technologies RXD-433-KH2 receiver/decoder and TXD-433-KH2 transmitter/encoder modules. The units eliminated the need for software encoding or decoding protocols, solving a software problem in hardware. The fact that they were free made our decision even clearer. One can simply drive the data line with the data to be transmitted, the address line with a unique address (which can be a series of hardcoded ones, zeros or floating) and assert the TE (transmission enable) pin. Any receiver with its address pins configured the same way will have its VT (valid transmission) pin go high and its output data line mirror that of the transmitter.

Indoor Display Unit

Hardware Design

The LED Canvas is an 8×8 LED matrix, where each pixel actually consists of 3 discrete LEDs: one red, one green and one blue. It is connected to a prototype board fitted with a regulator to allow the microcontroller to power from a wall socket, so no batteries are required. Figure 2 shows the pin configuration of the LED matrix. The black square shows the location of each pixel. The pixels require 4 pins for control: the three color controls, shown by pins 2, 1, and 32 in Figure 2 for the first pixel, and a base pin (or row pin), which is grounded when the pixel is on. Each pixel can simply be made to take on 8 different colors by asserting ones and zeros across the pins of each LED. For example, the first pixel can be made purple by asserting ones on pins 1 (red) and 2 (blue), and zeros on pins 32 (green) and 26.

As is evident from Figure 2, controlling each pixel individually becomes an interesting task since each column of pixels shares the same color control pins (2, 1, and 32 are color control pins, with pin 2 controlling the blue LEDs in the first column, etc), with only the base pin to differentiate pixels in a column. The way around this control issue is to cycle through the rows, asserting the control pins appropriately based on the desired color value of the pixel in the given row. Hopefully, this can be done quickly enough so that the viewer does not notice flickering. In the case of the Atmel Mega644 microcontroller used in this project, the 16 MHz crystal clock was indeed fast enough.

As can be seen from Figure 2 and the schematic in Appendix B, fully controlling the LED matrix requires 32 pins, the full pin complement of the Atmel Mega644 used for this project. Each color control pin must also have a corresponding current-limiting resistor (for a total of 24), as seen in the schematic. Table 1 shows the original pin mapping from the matrix to the Mega644 microcontroller. Unfortunately, two pins of the Mega644 were required for receiving RF signals relaying weather data from the outdoor unit. Pins D.6 and D.7 were chosen for this task, since they represent the red and green color control pins for the last column, localizing the damage. This left only 30 pins to control the matrix. An interesting solution to this problem was an increased length RF data transmission, which in addition to conveying the binary conditions outside (sunny/not sunny, raining/not raining, hot/cold, etc), would display the severity of the condition using the available blue pixels of the last column. The severity meter will be discussed at length in the software section.

Weather Canvas Using Atmega644 Schemetic

The pin-out of the Linx Technologies 433 MHz RF receiver is shown below in Figure 3. It is not necessary to delve into the meaning of each pin since only a select few are necessary. ANT refers to the antenna, made from 16.5 cm of standard wire, sufficient for our purposes. GND refers to the microcontroller ground and likewise VCC refers to the microcontroller Vcc. VT refers to the valid transmission bit, which will be asserted if the decoder/receiver hardware determines that a valid transmission is being received. The value of VT is determined by the A0-A9 bits, which refer to the address. These pins must be synchronized between the transmitter and the receiver in order for a signal to be received. Finally, D0 through D9 refer to the data bits received during the transmission. If a valid transmission is received, these pins will mirror the data bits asserted on the receiver. To minimize the number of pins needed on the receiving side (so as to not cripple the LED matrix), only D0 is used. That is, the transmitter conveys all the necessary information bit by bit on D0, and the receiving side decodes and stores these bits (in software) until the full transmission is received. As seen in schematic Figure 2, the VT pin is connected to the microcontrollers D.7 port and D0 is connected to D.6. The address bits are hardcoded with a combination of floating and ground values. Also necessary on the RF receiver was a voltage dropping resistor to bring the voltage down since the maximum Vcc voltage of the receiver is 3.6 V. As seen in Figure 2, a 330 Ohm resistor was used. Finally, a simple RC circuit is set between the microcontrollers Vcc and that of the RF input to filter out noise, as recommended by the manufacturer. They recommended a 10 Ohm resistor and a 10 micro Farad capacitor, which corresponds to 300 nano Farads when using the 330 Ohm resistor. A 300 nano Farad capacitor was not available, so three 100 nano Farad capacitors were set in parallel.

 Parts List:

Part
Quantity
Unit Cost
Total Cost
RGB LED 8×8 Matrix (YSM-2388CRGBC)
1
$12.00
$12.00
Linx Technologies TXE-418-KH (encoder/transmitter)
1
Free Sample
$0.00
Linx Technologies RXD-418-KH (decoder/receiver)
1
Free Sample
$0.00
LM34 Temperature Sensor
1
$1.95
$1.95
PWR1241 Sun Power Solar Panel
2
$3.20
$6.40
12V power supply
1
$5.00
$5.00
NiMH AA 1800 mAh rechargeable batteries (4-pack)
1
Ultimately Did Not Use ($9.00)
$0.00
9V battery
1
$2.00
$2.00
9V Battery Clip
1
$0.75
$0.75
Prototype Board
2
$4.00
$8.00
Mega644 PDIP Package
2
Free Atmel Sample
$0.00
SIP/Header Socket
100
$0.05
$5.00
Mega644 socket
4
$0.50
$2.00
Small solder board
3
$1.00
$3.00
Humidity sensor (480-2903-ND)
1
$4.82
$4.82
Hot Wheels Radar Gun
1
$10.00 from eBay
$10.00
PVC Pipe and Elbows
1 collection
$3.00
$3.00
Cereal tupperware enclosure
1
$1.50
$1.50
DC Motor, shaft
1
Prior ownership
$0.00
Shadow Box
1
Prior ownership
$0.00
Nuts and Bolts for Tower
4
0.10
$0.40
Wooden Base
1
Free from Home Depot
$0.00
Dinosaur Eggs
2
$0.25
$0.50
Total Project Cost:
$64.32

For more detail:  Weather Canvas Using Atmega644

Leave a Comment

You must be logged in to post a comment.

Read previous post:
Autonomous Self-parking car Using Atmega644

Introduction We created an RC Car that can identify a parking space and parallel park by itself. The RC Car...

Close
Scroll to top