18
Embedded Lab An online teaching laboratory for Microcontrollers and Embedded Systems To search, type and hit en Home Products Theory PIC Experiments PIC Projects Tips & Tricks dsPIC chipKIT Tutorials Contact Running message display project for Christmas R-B Dec 8th, 2010 Like 10 people like this. Be the first of your friends. Introduction As Christmas is coming people have already lightened their houses. I thought of doing something different for this Christmas besides the festive Christmas lights. I made a running message display using LEDs, and thought of sharing it with you. This is a very simple running message display project that displays the message ‘MERRY XMAS’, where each letter is created with 5mm diameter red-color LEDs. The 9 letters in the message are individually turned on or off through a PIC16F688 microcontroller’s I/O pins. Therefore, a variety of display patterns can be generated through the software inside the microcontroller. Ads by Google LED LCD LED Project LED Lights 12V LED Lighting Used Digital Multimeter www.sdtechnologies.co.in/Get_Quo Buy Used Digital Multimeter & Other Test Equipments at Affordable Price Wahl DST600 www.palmerwahl.com Digital Reference Thermometer self checking accuracy for peace of mind electronic design service www.embionics.com embedded system development video analytics design Brushless Motor-Drives www.alliedmotion.com New EnduraMax brushless DC motors with integrated drive electronics

Running Message Display Project for Christmas _Embedded Lab

Embed Size (px)

Citation preview

Page 1: Running Message Display Project for Christmas _Embedded Lab

Embedded Lab

An online teaching laboratory for Microcontrollers and Embedded Systems

To search, type and hit enter

HomeProductsTheory

PIC ExperimentsPIC ProjectsTips & TricksdsPICchipKIT Tutorials

Contact

Running message display project for Christmas

R-B

Dec 8th, 2010

Like 10 people like this. Be the first of your friends.

Introduction

As Christmas iscoming people have

already lightened theirhouses. I thought of

doing somethingdifferent for thisChristmas besides the

festive Christmaslights. I made arunning messagedisplay using LEDs,

and thought of sharingit with you. This is avery simple runningmessage display

project that displays the message ‘MERRY XMAS’, where each letter is created with 5mm diameter red-color LEDs. The9 letters in the message are individually turned on or off through a PIC16F688 microcontroller’s I/O pins. Therefore, avariety of display patterns can be generated through the software inside the microcontroller.

Ads by Google LED LCD LED Project LED Lights 12V LED Lighting

Used Digital Multimeter www.sdtechnologies.co.in/Get_Quote

Buy Used Digital Multimeter & Other TestEquipments at Affordable Price

Wahl DST600 www.palmerwahl.com

Digital Reference Thermometer self checkingaccuracy for peace of mind

electronic design service www.embionics.com

embedded system development video analyticsdesign

Brushless Motor-Drives www.alliedmotion.com

New EnduraMax brushless DC motors withintegrated drive electronics

Page 2: Running Message Display Project for Christmas _Embedded Lab

Christmas running message display

Theory

LED Math

The forward voltage of an LED depends on its type. If the LED is red, the forward voltage is usually between 1.7 – 2.1 V.

For green and blue LEDs, this value is higher. An LED requires a resistor in series to limit the current in the LED to a safevalue. Most 5mm LEDs operate close to their peak brightness at a drive current of 20 mA. In this project, I am driving my

LEDs at 15 mA and they still glow pretty bright. So, all of my calculations are based for 15 mA current through the LEDs.

I measured the forward voltage across my LEDs and they are about 1.95 V. Calculating the value of the series resistor foran LED is simple. Suppose, if you want to drive a LED through a 5 V power source, you need a resistor of value (5-

1.95)V/15 mA = 203 Ω to limit the current to 15 mA. The closest available resistor (on the higher end) is of 220 Ω.

Now, let’s see how to make display letters with LEDs. The first letter of the message (MERRY XMAS) is shown below.17 LEDs are used in creating the letter M. If you drive each LED through a 5V supply, you require 17 series resistors, and

the current will sum up to 17×15 = 255 mA. If you add the current requirements of other letters in the message, the net

current would go up to 2 A, which is quite a bit of current and you probably need a bigger heat sink for your voltageregulator. I didn’t want to do any of these. So I thought of doing it differently that would save me from soldering to many

resistors and also lower the net current requirement of the project. How can I do that? Yes, you are right, by using highersupply voltage.

Page 3: Running Message Display Project for Christmas _Embedded Lab

I still have my old printer’s external power supply that has that has 3 output pins for +15 V, +32 V, and Ground, and it can

deliver current up to 800 mA. I thought of connecting LEDs in series and drive them through 32 V. This way I can connectat most 16 LEDs in series with only one current limiting resistor. So, here is how I arranged the 17 LEDs for the letter M. I

can’t connect all of them in series as that would require more than 17×1.95 = 33.15V. So I connected the first 9 LEDs in

series (cathode of one is connected to the anode of other) to form a chain. The remaining 8 LEDs are used to form anotherchain. For the first chain, the value of the series resistor would be,

R1 = (32.0 – 1.95 x 9) V/15 mA = 963 Ω.

I used 1 K. Similarly, for the other chain of 8 LEDs, the estimated resistor value is R2 = 1.1 K. Now let’s compute thepower dissipation in the resistors. The current through R1 is (32 – 1.95 x 9)V/1K = 14.45 mA. The power dissipation is

14.45 mA x 14.45 mA x 1000 Ω = 0.21 Watts. Similarly, R2 will dissipate 0.24 Watts. So, the resistors with power rating

1/4 Watts will work fine. Next, by connecting the two anode terminals together and two cathodes together as shownabove, completes the letter M. The anode terminal will be connected to 32 V supply and the cathode will be connected to

the collector of a NPN transistor. The base of the NPN transistor will be driven through a PIC16F688 I/O pin with abase-current limiting resistor, whereas the emitter will be grounded. When the PIC16F688 I/O pin outputs logic high, the

transistor is turned on and all the LEDs will glow and display M. This whole process is repeated for other letters in themessage. The series resistor values will be calculated in exactly the same way by considering the number of LEDs in each

of the chains formed. The table below shows the number of LEDs in my message letters with the number of chains and theseries resistors I used.

Page 4: Running Message Display Project for Christmas _Embedded Lab

Selecting transistor

Each transistor used in this project will have to sink at most 30 mA current (for letters with two series chains). If there isonly one chain of LEDs, then it would have to sink only 15 mA. So, no special power transistor is required. But, theselected transistor must have junction breakdown voltage higher than 32 V, for both collector-emitter and collector-base

terminals. The specification of a BC547 NPN transistor says the breakdown voltage is about 45 V, and so it is appropriatefor this project. But I experienced problem with a couple of BC547 transistors that I had to replace. They just get turnedon by default without applying any voltage to its base resistor. I don’t know the cause.

Soldering LEDs on a cardboard

I didn’t solder the LEDs on a prototyping circuit board to make the letters, that would be a lot of money. I rather took a0.25″ cardboard and drilled holes where the legs of LEDs are inserted. The legs are bent on the backside of the cardboard

and then soldered to form a chain of LEDs. This holds the LEDs fairly tight. In order to drill the equidistant holes, first Iprinted the letters with round circles on papers and sticked them on the board as shown below. The circles are 0.5″ apart.

Page 5: Running Message Display Project for Christmas _Embedded Lab

Next, I drilled two holes inside each circle at about 4 mm distance apart so that I can insert the two legs of an LED. It’s acardboard, so drilling was not so painful. It took me about 30 minutes to drill holes for all 134 LEDs.

After that, I took the paper out from the cardboard and inserted the LEDs. I bent the legs of the LEDs and soldered theappropriate terminals of adjacent LEDs to make the serial chains. I also soldered the resistors to each anode terminals ofthe chains.

Page 6: Running Message Display Project for Christmas _Embedded Lab

Circuit Diagram

The circuit diagram is very simple. I am using my PIC16F688 breadboard module as the brain of this project. The figurebelow shows the pin RC0 is driving the first letter M. Rest of the letters also require similar transistor drivers that are

controlled through other port pins of PIC16F688. The +5 V supply for the PIC microcontroller is derived from the +15 Vpower supply (note the printer power supply has two voltage output, +15 V and 32 V) using an LM7805 regulator IC.

Page 7: Running Message Display Project for Christmas _Embedded Lab

PIC16F688 breadboard module inserted into the transistor driver board. The board gets +15 V and +32 V fromthe printer’s power supply.

PIC16F688 module controls the switching patterns of the letters

Page 8: Running Message Display Project for Christmas _Embedded Lab

The circuit board is fixed on the backside of the cardboard using screws.

Software

Now it’s time to write the program for PIC16F688. I am demonstrating a simple display pattern that first switches all theletters on sequentially, then blinks the whole message twice, and finally shows the entire message for 2 sec. Then it repeats

the sequence for ever. I wrote this program in C and compiled with MikroC Pro for PIC compiler from MikroElektronika.

/*

Project: Merry XMAS Running Message

Internal Clock @ 4MHz, MCLR Enabled, PWRT Enabled, WDT OFF

Copyright @ Rajendra Bhatt

Dec 4, 2010

*/

// Define letter connections.

// MERRY XMAS

sbit M1 at RC0_bit;

sbit E1 at RC1_bit;

sbit RR1 at RC2_bit;

sbit RR2 at RC3_bit;

sbit Y1 at RC4_bit;

sbit X1 at RC5_bit;

Page 9: Running Message Display Project for Christmas _Embedded Lab

sbit X1 at RC5_bit;

sbit M2 at RA2_bit;

sbit A1 at RA1_bit;

sbit S1 at RA0_bit;

// End connection definition

void GetDelay(void){

Delay_ms(200);

}

void main() {

ANSEL = 0b00000000; //All I/O pins are configured as digital

CMCON0 = 0x07 ; // Disbale comparators

TRISC = 0b00000000; // PORTC All Outputs

TRISA = 0b00000000; // PORTA All Outputs, Except RA3

PORTA = 0x00;

PORTC = 0x00;

do {

M1 = 1;

GetDelay();

E1 = 1;

GetDelay();

RR1 = 1;

GetDelay();

RR2 = 1;

GetDelay();

Y1 = 1;

GetDelay();

X1 = 1;

GetDelay();

M2 = 1;

GetDelay();

A1 = 1;

GetDelay();

S1 = 1;

GetDelay();

PORTC = 0x00;

Page 10: Running Message Display Project for Christmas _Embedded Lab

PORTC = 0x00;

PORTA = 0x00;

GetDelay();

PORTC = 0xff;

PORTA = 0xff;

GetDelay();

PORTC = 0x00;

PORTA = 0x00;

GetDelay();

PORTC = 0xff;

PORTA = 0xff;

Delay_ms(1000); // Wait for 1 sec

PORTC = 0x00;

PORTA = 0x00;

GetDelay();

GetDelay();

} while(1); // Infinite Loop

}

Download the HEX File

Output

I have a video shoot of my running message display that I took with my digital camera. Have fun watching it.

Page 11: Running Message Display Project for Christmas _Embedded Lab

I have fixed the display board behind the glass of my window. It looks really great during night time. The picture below is

taken from the street in front of my house, which is about 50 feet away.

Here’s another version of this project without using a microcontroller.

027 15 1 56

Page 12: Running Message Display Project for Christmas _Embedded Lab

Related Posts

Revised version of LM35 based digital temperature meterThis is a revised version of my LM35 based digital thermometer project that I posted last year. Although it is one of th...

Lab 16: Understanding Interrupts

Interrupts are powerful concept in embedded systems for controlling events in a time-critical environment. In a typical ...

How to measure capacitance with a microcontroller?Microcontrollers are widely used in measuring various physical variables. The techniques involved in the measurements co...

Filed under: PIC Projects

RSS feed for comments on this postTrackBack URI

13 Responses to this post

1. Giorgos Lazaridis on December 9th, 2010 2:29 am

Nice project. It is a very good example of how to interface multiple LEDs and control them with a transistor. Niceexplanation. It will be featured in pcbheaven.com today.

2. Electronics-Lab.com Blog » Blog Archive » Christmas Message Display Board using LEDs on December 9th, 20106:50 am

[...] Message Display Board using LEDs – [Link] Tags: 16F688, Christmas, Led, PIC 16F688 Filed in Led | 1views No Comments [...]

3. Fola on August 24th, 2011 6:15 am

Nice project! Pls, could u be kind enough to attach/send me the source code. i would like to see the code sequence.

Thanks.

4. adithyan on September 24th, 2011 9:25 pm

dear,

can I see the software listings and also the hex codes for the running message”

Page 13: Running Message Display Project for Christmas _Embedded Lab

can I see the software listings and also the hex codes for the running message”

regards,

adithyan

5. R-B on September 24th, 2011 10:29 pm

It’s in the software section of the article.

6. vijayadattaa on November 6th, 2011 1:19 pm

Hi

I really impressed with your idea of developing this project and making it online, i used your hardware circuit andsincerely i say thanks to you. good work, please continue doing the same for innovative projects.

ThankyouDatta

7. Make your own animated LED Christmas sign » Geko Geek on November 18th, 2011 3:44 am

[...] year I made a simple LED Christmas sign with very basic animation effects controlled by a PIC MCU. One of

my friends, who visited us [...]

8. badranwar on December 19th, 2011 5:04 pm

dearthank you for this project but i want to aske tow quistion

1- can you tell me the equivalent of pic16f688 .2- what the meaning of the aprivation of pin nc in the prototypof the project without pic controlle

thank you again waiting your anser

badranwar

9. p.naveen on February 15th, 2012 6:42 am

i will be do a project on running message display a letter ” site eee ” pls help me and also give some guidence to me

10. john kwanta on May 22nd, 2012 5:48 pm

this project is very pls which kind of connection did u used. Serial in parallel out.?

11. kimani from kenya on June 1st, 2012 4:16 pm

Good job. Detailled explanations

12. Muazu JIbrin musa on June 8th, 2012 4:30 am

What a nice simple display.

It really give me an interest to build one.

How can I pls. Write:

Page 14: Running Message Display Project for Christmas _Embedded Lab

How can I pls. Write:

“HEARTLINEFARMS”

Pls. Do assist mel with the source code and diagram, to make one for my farm.

Thanks a lot.

I really appreciate your effort.Muazu

13. kimani from kenya on June 19th, 2012 6:44 am

[color='red']red[/color]

Leave a comment

Name (required)

Email Address (required)

Website

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <deldatetime=""> <em> <i> <q cite=""> <strike> <strong>

Post your comment

Page 15: Running Message Display Project for Christmas _Embedded Lab

........................................................................

Subscribe through email

Sign Up

0 FollowFollow

Featured Project

Multi-purpose dual power supply (5.0V and 3.3V) regulator board

Mohamed Swed A nurag Kusnandar Beucã

Thillai Ev ert Boy eje Hadeer A llwy n

Embedded Lab on Facebook

1,235 people like Embedded Lab.

Like

Facebook social plugin

Page 16: Running Message Display Project for Christmas _Embedded Lab

All embedded systems require electric power to operate. Most of the electronic components inside them, including theprocessors, can operate at a wide range of supply voltage. For example, the operating voltage range for the PIC16F1847

microcontroller is 2 to 5.

Experimenting with PIC

These tutorials are aimed to provide you an introductory level theory and practice of embedded system design

through the application of PIC microcontrollers.

Browse our PIC Tutorials

Most Popular Posts

Heart rate measurement from fingertipProgrammable digital timer switch using a PIC MicrocontrollerPIC-based Digital Voltmeter (DVM)

A very simple IR remote control switch for an electrical applianceA Digital temperature meter using an LM35 temperature sensor

chipKIT Programming and Interfacing

Ads by Google

LED LCD

LED Project

LED Lights

Page 17: Running Message Display Project for Christmas _Embedded Lab

Browse our chipKIT Tutorials

Categories

555 Timer (6)Analog (1)

Arduino (10)AVR Projects (25)AVR Tutorials (5)chipKIT (10)

dsPIC (1)Embedded Lab Projects (26)Embedded Labs (25)

Embedded Lessons (33)MCU develeopment tools (2)Microcontroller Programmers (6)

MSP430 Launchpad (1)PIC Projects (55)PIC Tutorials (42)

PIC18F (10)Power Supply (6)Processing (2)

Product Review (11)Products (4)Robotics (4)

Tech News (29)Tips and Tricks (37)Uncategorized (1)

Blogroll

Dangerous PrototypesEEWebElectronics-Lab

Hack A Day

Visitors

Page 18: Running Message Display Project for Christmas _Embedded Lab

Visitors

flag counter

© 2012 Embedded Lab. All Rights Reserved. | Theme Provided by Best Wordpress Themes