Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Designing a PIC Light Sequence Selector

Status
Not open for further replies.

ghpg

New Member
Hello!

I'm here to ask for help in a project that I'm working on.
Brief description:
I need a circuit capable of switching between 8 programmed channels, by reading 8 switches and giving the visual output on 8 LEDs.
I plan to use this circuit to create and select between static light sequences.

Each switch will be called as a channel, and each channel will need to have its own program, made by a smart programing interface running in the PIC.

Example:
before anything, I can program the circuit using pushbuttons and a led display (numeric or not) to select which LEDs will be lit in channels 1, 2, 3, 4, 5, 6, 7 and 8. This data should be easy to edit and be stored in non-volatile memory.

Finally, when I press the #1 channel switch, the selected leds for that channel will be lit. Pushing the #2 channel switch, the sequence will be overriden and the selected leds for the #2 channel will be lit. And so on.

I have plenty of experience with complex audio analog and simple digital circuits, but I need to use as less as possible components to make this device; that's why i'm trying to use a PIC.
I have no experience in programming, only in PICBasic.
I would appreciate if it could be made with a 16F628A or any other readly avaliable or cheap PIC.

Any ideas will be welcome! I want to learn doing this, and I wish to be able to help too!

Thanks in advance.

GHPG, Brazil.

PS.: If it can be made using few common IC's instead of microcontrolers, no problem too!
 
One way to do this is to use data selector/multiplexer IC's (8 of them for the pattern) and put the pattern in DIP switches.

This easily gives you a 4 bit binary code which will select your outputs. You can use a Priority encoder IC to go from the push buttons to address the data selectors.

3 bits will get you patterns 0 through 7. 4 bits are required for 0 through 16. I'llhave to look at possible chips.

See https://www.electro-tech-online.com/custompdfs/2010/11/MC14512B-DPDF.pdf for some ideas. You might still be able to do it with 3 bits, since there is an inhibit line.

If you don't need to latch them, your done. e.g. You must hold the button for the lights to light.

The PIC solution would be simpler. You can still use the priority encoder to save inputs from 8 to 4.
 
Thanks a lot for your reply!
The outputs needs to be latched, but a simple flipflop would do the job. (more 4 IC's in the board...)

To be honest, the hardest part to me is to be able to program the channels without having to use a DIP switch on each channel, saving room and money. I even have a concept on mind, but it is far beyond my knowledge.
In my imagination, using a LED matrix and some pushbuttons can be used to make the programing, but, as I stated, i have no knowledge in all this kinds of interfacing.

I'm working in a prototype using a single PIC for each function. That will help me on how to imagine how the final tool will look like, and what I can remove/add. I'll post photos/schematics/Basic codes here ASAP.

Thanks!

GHPG, Brazil
 
You are aware that 3 bits can make up 8 patterns:

0 000
2 010
3 011
4 100
5 101
6 110
7 111

So, it's really the representation of a decimal number in binary and each digit has weights of 2^0, 2^1 and 2^2 from left to right.

Thumbwheel switches could be used to select the pattern. See **broken link removed** A simple pattern table can make visualization easier.

Not sure if your looking for arbitrary, possibly repeating patterns for each button.
 
Use 8 leds to show your pattern
Use 1 momentary switch for each led. Push it to indicate the led is on during pattern programming.
Use 1 switch per mode. Play/Program/Next/Prev etc
Use 1 led per mode switch to indicate it is active

etc

no extra logic chips. No fancy switches.
 
Last edited:
I guess i'm not beeing able to describe exactly what I need. I'm still designing all the concept.
I'll finish an analog prototype and then post here.
Anyway, thanks for all the replies.

GHPG, Brazil.
 
Are you saying that you'd like to press switch 1 and see a certain pattern on the eight LEDs? Press switch 2 and see another pattern on the eight LEDs? And so on?
 
exactly.
but this pattern is programmed into the device in real-time, using puchbuttons or any other thing. So the pattern are user made.

CircuitMaker is making me nuts, I still haven't finished the prototype.
Thanks!
GHPG, Brazil.
 
That's the problem, I don't know how to code nothing more than some switch routing. My main problem is the user interface! The rest of the device is designed and working, but with 8 DIP switches, one to program each channel...

Thanks!

GHPG, Brazil
 
I gave you two alternate and the DIP user interfaces:
1) The fact that all of the patterns exist as binary digits
2) They can be encoded with a BCD thumbwheel switch which can be
a) lever operated
b) inc/dec push putton operated
c) Can be an actual thumbwheel

Although you used a DIP switch, BCD encoded switches are availabe in rotary form.

The Lever operated BCD switch is very robust and is very quickly moved from position to position.
 
An analog version will not provide much if any insight into micro controller based version, which will be much less complex.

Break the problem into parts.

1. Learn to turn LEDs on and off
2. Learn to read momentary switches.
3. Learn to store data in the EEPROM (if you want to preserve the patterns with power off)
4. Determine the logic needed to use the above to write your program.

None of these are difficult.

There should be tutorials for 1-3 in most languages.
If you need help with 4 we can do that here.
 
Allright!
Thanks to everybody that helped me.
Today I started making the program using Basic. Soon I'll have the first prototypes done and I'll post info about it here.
But I'm still sure that I'm best with audio tubes than these programable things...

Thanks!
GHPG, Brazil.
 
Thay have been made for prop controllers with timing, one used a PICAXE witch may be easyer to program. Andy
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top