All About Circuits Forum  

Go Back   All About Circuits Forum > Circuits and Projects > The Completed Projects Collection

Notices

The Completed Projects Collection A collection of completed projects from All About Circuits forum members. Comment, ask questions, and add to their ideas.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 03-18-2012, 01:38 AM
MMcLaren's Avatar
MMcLaren MMcLaren is offline
Senior Member
 
Join Date: Feb 2010
Location: Michigan, USA
Posts: 646
Default Project: PIC LED Sequencer

For my very first project submission I'd like to present a relatively simple PIC based LED sequencer project. By "relatively simple" I mean each LED is directly driven from an I/O pin, and while this method generally uses more pins when compared to multiplexing to drive the same number of LEDs, it does make the PIC program much simpler.



Prerequisites
While you don't need to be a micro controller expert to build this project and create nifty LED FX (effects), you will need the (free) Microchip MPLAB IDE (integrated development environment) installed on a PC and a programmer such as the PICKIT2 to "burn" the program which contains your LED 'FX' sequences into the PIC device. You also need the basic skills and tools necessary to build the project on a solderless breadboard or a prototype board.

Hardware
While the project requires very few parts, you need to decide how you want to build it. I used an inexpensive phenolic prototype board available from Radio Shack (sku 276-149) with a plastic coated paper silkscreen glued onto the top, but you might decide to build the circuit on a solderless breadboard or perhaps etch your own printed circuit board.



Code:
Parts List

1 ea. - C1, 0.1uf monolithic ceramic capacitor
8 ea. - D1-D8, generic discrete LED
8 ea. - R1-R8, 470 ohm, 1/8th watt carbon film resistor
1 ea. - R9, 10 kohm, 1/8th watt carbon film resistor
1 ea. - SW1, generic PCB momentary contact switch
1 ea. - U1, PIC16F628A micro controller
1 ea. - prototype board or solderless breadboard
1 ea. - regulated 5 volt D.C. power source
Select All
Software
The program is designed to continuously display LED sequences contained in one of eight FX (effects) tables. Each table can contain up to 255 sequences or steps and each step contains two parts, (1) the LED <pattern>, and (2) the <duration> for that pattern. The <pattern> part of each step is simply eight bits which match the position of the eight LEDs on the project board. A '1' bit will turn an LED on while a '0' bit will turn an LED off. The <duration> part of each step must contain a value from 1 to 255 which corresponds to the time the pattern will be displayed in 10-ms increments (1..255 duration = 10..2550 msecs) before going on to the next step. When the program has finished displaying the last step in an FX table, it wraps around to start again at the first step in that table. When you press the push button switch, the program will move on to displaying the next FX table. Here's what one of the program FX tables looks like (for a Knight Rider type effect);

Code:
fx2
        dt      (fx3-fx2)/2     ; <steps>                         |B0
        dt      b'00000001',8   ; <pattern>, <duration>           |B0
        dt      b'00000010',8   ;                                 |B0
        dt      b'00000100',8   ;                                 |B0
        dt      b'00001000',8   ;                                 |B0
        dt      b'00010000',8   ;                                 |B0
        dt      b'00100000',8   ;                                 |B0
        dt      b'01000000',8   ;                                 |B0
        dt      b'10000000',8   ;                                 |B0
        dt      b'01000000',8   ;                                 |B0
        dt      b'00100000',8   ;                                 |B0
        dt      b'00010000',8   ;                                 |B0
        dt      b'00001000',8   ;                                 |B0
        dt      b'00000100',8   ;                                 |B0
        dt      b'00000010',8   ;                                 |B0
fx3
Select All
Using MPLAB, the user can edit or modify any line in an FX table or insert and delete lines in an FX table and the program will automatically keep track of the number of steps in each table.

Summary
Short of teaching someone how to use MPLAB, which is beyond the scope of this article, feel free to ask questions if, as I suspect, I've left out some important piece of information.

Cheerful regards, Mike
Attached Images
File Type: png Sequencer Top.png (266.1 KB, 492 views)
File Type: png Sequencer Bottom.png (275.5 KB, 120 views)
File Type: png Sequencer Silkscreen.png (24.9 KB, 72 views)
File Type: png Simple 8-Chan LED Sequencer.png (32.5 KB, 10 views)
Attached Files
File Type: txt 16F628A LED Sequencer.asm.txt (13.2 KB, 96 views)

Last edited by MMcLaren; 06-02-2014 at 11:14 PM.
Reply With Quote
The Following User Says Thank You to MMcLaren For This Useful Post:
RRITESH KAKKAR (03-19-2012)
  #2  
Old 03-18-2012, 04:05 PM
Sparky49's Avatar
Sparky49 Sparky49 is offline
Senior Member
 
Join Date: Jul 2011
Location: Cambridgeshire
Posts: 765
Blog Entries: 12
Default

Hi,

I am interested in your project, but it looks like your image links are broken.
__________________
"Has anyone really been far even as decided to use even go want to do look more like?"
Reply With Quote
  #3  
Old 03-18-2012, 07:56 PM
Bill_Marsden's Avatar
Bill_Marsden Bill_Marsden is offline
Super Moderator
 
Join Date: Mar 2008
Location: Dallas, TX (GMT-5 w/ DST)
Posts: 19,045
Blog Entries: 5
Default Nice Job!

Nice job! It is approved. I'll post a link in the index ASAP.

Much better submission than most. It sets the standard.

I put it in the Lighting, LED Flashlights, Etc catagory.

If you want me to move it to the Microprocessors / Micro Controllers class let me know.
__________________
..
"Good enough is enemy of the best." An old engineering saying, Author unknown.

General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input. Thanks for the verbage Wookie.
Reply With Quote
  #4  
Old 03-18-2012, 10:07 PM
Georacer's Avatar
Georacer Georacer is offline
Super Moderator
 
Join Date: Nov 2009
Location: Athens, Greece (GMT +2)
Posts: 4,875
Default

Neat project, very compact.

I wonder: Am I the only one who uses stripped wires on the underside of the perfboard? I feel they 're more manipulable this way.
__________________
.
I am a prisoner of high standards and low social skills
____________________________________

I wish I was the best at what I would do, and what I would do wouldn't be pretty.
Reply With Quote
  #5  
Old 03-19-2012, 01:11 AM
Bill_Marsden's Avatar
Bill_Marsden Bill_Marsden is offline
Super Moderator
 
Join Date: Mar 2008
Location: Dallas, TX (GMT-5 w/ DST)
Posts: 19,045
Blog Entries: 5
Default

I like the insulation. I did buy some specialty teflon ultra fine wire though, both 28 and 30 gauge. Teflon won't melt when soldered, but it is expensive and soft (cold flows).
__________________
..
"Good enough is enemy of the best." An old engineering saying, Author unknown.

General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input. Thanks for the verbage Wookie.
Reply With Quote
  #6  
Old 03-19-2012, 01:36 AM
DerStrom8's Avatar
DerStrom8 DerStrom8 is offline
Senior Member
 
Join Date: Feb 2011
Location: Vermont, U.S.A. (GMT-5)
Posts: 1,883
Blog Entries: 12
Default

Well done, MMcLaren.

@Geo, I use insulated wire for a few reasons--One, it prevents shorts, two, it prevents shorts, and three, it prevents shorts.
Reply With Quote
The Following User Says Thank You to DerStrom8 For This Useful Post:
Sparky49 (03-19-2012)
  #7  
Old 03-19-2012, 02:39 PM
gerty gerty is online now
Senior Member
 
Join Date: Aug 2007
Location: Tennessee GMT -5
Posts: 914
Default

Quote:
Am I the only one who uses stripped wires on the underside of the perfboard
I use 30 gauge wire wrap wire (insulated) for jobs like this. I use standard sockets and solder the connections.

Edit: here's a couple of lousy pics of the sequencer we made in class here for future students to learn programming.
It shows the type of wire I'm referring to.
Attached Images
File Type: png front.png (156.5 KB, 64 views)
File Type: png back.png (189.3 KB, 65 views)

Last edited by gerty; 03-19-2012 at 03:49 PM.
Reply With Quote
  #8  
Old 04-09-2012, 01:37 PM
RRITESH KAKKAR's Avatar
RRITESH KAKKAR RRITESH KAKKAR is offline
Senior Member
 
Join Date: Jun 2010
Location: Earth
Posts: 1,351
Send a message via MSN to RRITESH KAKKAR
Default

Nice work!
Reply With Quote
  #9  
Old 04-10-2012, 01:26 AM
BillO BillO is offline
Senior Member
 
Join Date: Nov 2008
Location: Canada
Posts: 974
Default

Cool.

I also use wire wrap wire to hook up circuits.
__________________
Bill

--------------------------------------------------
Facts just don't care if you ignore them.
--------------------------------------------------
Reply With Quote
  #10  
Old 04-26-2012, 09:00 AM
Bill_Marsden's Avatar
Bill_Marsden Bill_Marsden is offline
Super Moderator
 
Join Date: Mar 2008
Location: Dallas, TX (GMT-5 w/ DST)
Posts: 19,045
Blog Entries: 5
Default

If someone could go through the programing steps that would be useful.

That, and I'm eradicating a spammer trace.
__________________
..
"Good enough is enemy of the best." An old engineering saying, Author unknown.

General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input. Thanks for the verbage Wookie.
Reply With Quote
The Following User Says Thank You to Bill_Marsden For This Useful Post:
DerStrom8 (04-26-2012)
Reply   Post New Thread

Tags
, , ,


Related Site Pages
Section Title
Textbook Ring counters : Shift Registers
Textbook Parallel-in, parallel-out, universal shift register : Shift Registers


Similar Threads
Thread Thread Starter Forum Replies Last Post
20 LED project (1.9 - 2.4 in) - is my math wrong aerogal The Projects Forum 29 02-06-2011 04:18 PM
pic16f877 led arrays project chaudhryali Embedded Systems and Microcontrollers 3 01-18-2011 03:24 AM
LED lamps getting hot MingJae Homework Help 20 02-25-2010 01:54 PM
pic 12f675 to light on led sovannarith Embedded Systems and Microcontrollers 12 02-23-2010 08:34 AM
Running Light Project (LED) markidgmgig Programmer's Corner 3 03-01-2008 12:47 PM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:40 PM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin
Copyright ©2000 - 2014, vBulletin Solutions, Inc.