How to display data using TLC5940 drivers

Hello,
I want to display temperature on 7-segment displays using Arduino board and TLC5940 drivers. I've already received temperature data from Yahoo Weather API and saved it in a variable. Now I'd like to show the "number" using 5 separate 7-segment displays. I control them via TLC5940 drivers (http://www.ti.com/lit/ds/symlink/tlc5940.pdf) and use existing library for arduino.

I've already defined temp variable and each numbers:

int temp; //variable (temperature value)

int numbers[10][8] = {{1,1,1,0,1,1,1,0},
{0,0,1,0,1,0,0,0}, //0
{1,1,0,0,1,1,0,1}, //1
{0,1,1,0,1,1,0,1}, //2
{0,0,1,0,1,0,1,1}, //3
{0,1,1,0,0,1,1,1}, //4
{1,1,1,0,0,1,1,1}, //5
{0,0,1,0,1,1,0,0}, //6
{1,1,1,0,1,1,1,1}, //7
{0,1,1,0,1,1,1,1}}; //8

but I don't know what to do next...
Maybe some of you already do something with 7-segment displays and TLC5940 drivers? If so, it would be great to give me some advice...
Thank you :slight_smile:

Why do you want to use a TLC5940 to drive seven segment displays?
It is most unsuited to the job.
Using 5 displays gives you a total of 35 LEDs, it is such a waste of that chip just to control LEDs to be on or off. It's strength is in the fading ability it has.
There are much better chips to use like the max7219.

Do you mean one display consisting of 5 single-digit 7 segs, or 5 displays each containing 2/3/4-digit 7 segs? Are they common cathode or common anode?

5 digits for the temperature sounds too many, unless you are displaying in Farenheight to 2 decimal places. 2 decimal places is really one too many for outdoor/forecast temperature i would say.

As Mike says, tlc5940 is not really the right chip for this.

I'm using 5 led displays (http://www.digchip.com/datasheets/download_datasheet.php?id=5779660&part-number=BS-AD12RI) with common anode. It works correctly using example from library but now I have problems with displaying the "value" stored as int variable in my code.

It works correctly using example from library

You sure of that?
It has several LEDs connected in series in a segment , you need about 12V to run this, so how have you wired this up? You can not just drive it from the Arduino pins. The best bet would be to use a TPIC6B595 Power Shift, chained, one for each display digit.

but now I have problems with displaying the "value" stored as int variable in my code.

That is just a matter of software, post yours if you want help, but you have to get it wired up correctly first.

Oh, I forgot to mention that displays are powered by 12V external supply. The picture of my circuit is in attached image (sorry for the form...I made it hastily).
I found some code regarding to similar project, but that guy used Arduino Uno and ESP8266 wifi module in order to get data from the internethttp://www.instructables.com/id/DIY-Big-7-Segment-Internet-Display/?ALLSTEPS
In my case, I'm using Arduino Yun board (with integrated wifi module) and I'm receiving data from Temboo service, but I think the part of his code responsible for displaying the number would be almost the same in my code as well.

No decoupling capacitors anywhere on this circuit. :o

Any chance of a schematic Fritzing diagrams are crap, one only has to try and convert them into a schematic in your head.

Now we know why you are using tlc5940! You should really give important details like this in your first post.

max7219 would not be your best alternative. It has a maximum of 5V. There are circuits you can build around max7219, but they are quite complex. The only other alternative I can suggest would be saa1064. You would need 2 of these for 5 digits, so not much simpler than your tlc5940 circuit, except that the saa chips would perform the multiplexing for you.

One more post regarding to this issue...I attached arduino code with separated part which I used from similar project (displaying data from the internet on 7-segment dislpays using Tlc5940 drivers...link in one of previous posts). I'm not sure what to change to make my data display. I've already tried to modify it but still no success...

get_temp.zip (2.21 KB)

I attached arduino code

where?

It's there...I didn't notice that I can't upload .rar file

CUL8R:
It's there...

Ummmm.....