Close

Building the Display Driver

A project log for Weather Display

A WiFi-enabled wall-mounted lighted display for current weather conditions

techavtechav 11/28/2015 at 18:550 Comments

I definitely should have gone for another PWM chip. The TLC5940 has very specific clock requirements. It needs a steady clock on the GSCLK pin, and every 4096 clock pulses it needs a pulse on the BLANK pin. The ESP8266 is powerful enough that I'm sure that in the hands of a good programmer, it could handle this with ease. I am not a strong programmer. So I've decided to divide the control into two sections. The ESP8266 will download and parse the METAR data, encode it for display, then go into deep sleep when idle. I'll use an AVR for driving the display; it will receive the encoded data from the ESP8266 and use it to drive the TLC5940.

I'm using everyone's favorite - the Arduino Uno for prototyping the display driver. The TLC5940 library is dead simple to use, and it took no time at all to have five RGB LEDs fading beautifully between colors. I also have a TCRT5000 optical sensor on the AVR to use as a proximity sensor. I don't want the LEDs to be lit all the time, but I also don't like the idea of having a visible button for triggering the display. I had considered attempting a capacitive button behind the glass of the display, but previous experiments with capacitive buttons were not very promising. I stumbled on the TCRT5000 looking through the eBay listings of the seller from whom I purchased the TLC5940. So to trigger the display, I'll have an IR proximity sensor.

At this point, I have the AVR code just about ready. Since the TLC5940 library uses the hardware SDI, and I wanted to leave the UART free for debugging purposes, I've built an interrupt-driven soft SDI. The AVR INT0 is the clock; on each rising edge it will shift in one bit from PB0, and when 8 bits have shifted in, it will update the display with the new data. This arrangement lets the ESP8266 send the data to the AVR at any time without the need for stepping down any 5V signals from the AVR down to 3V3 for the ESP. For testing the display, I've added a crude serial menu and command system that allows directly setting individual channels on the TLC5940, or sending a data byte as though it came from the ESP.

The next step from here will be programming the ESP8266 and getting it to interact with the AVR.

Discussions