Relay/MOSFET Sequencer Project

Thread Starter

klangst

Joined Jul 5, 2013
56
How do the timing inputs (5-10) work ?
My thought process was that each group/bank A-F, will have a 6 position selector switch for delay selection for that group/bank (0.5s, 1s, 2s, 3s, 4s, 5s). Each position of the selector switch will have a different resistance to provide a different voltage representing each delay. The center position of the switch will be connected to a ADC input on the PIC. The ADC would read the voltage and perform a conversion to determine the delay that was selected. This delay would be used for that bank.

For example:
Let's say for group/bank A (output 1 - cues 1-4) the selector switch (input 5 - Timing 1) is set to 1s and for group/bank B (output 2 - cues 5-8) the selector switch (input 6 - Timing 2) is set to 4s. Here is the sequence of events:
- Perform the ADC for input 5 and determine the delay
- Set Output 1 HIGH and Output 7 HIGH
- Pause for 1s
- Set Output 8 HIGH and Output 7 LOW
- Pause for 1s
- Set Output 9 HIGH and Output 8 LOW
- Pause for 1s
- Set Output 10 HIGH and Output 9 LOW
- Set Output 10 LOW and Output 1 LOW
- Perform the ADC for input 6 and determine the delay
- Pause for 4s
- Set Output 2 HIGH and Output 7 HIGH
- Pause for 4s
- Set Output 8 HIGH and Output 7 LOW
- Pause for 4s
- Set Output 9 HIGH and Output 8 LOW
- Pause for 4s
- Set Output 10 HIGH and Output 9 LOW
- Set Output 10 LOW and Output 2 LOW

And this would continue for each of the 6 groups/banks. What do you think, does it in theory sound plausible? I know this is extremely simplified, but I needed to lay this out to try and visualize it.
 

Brevor

Joined Apr 9, 2011
297
And this would continue for each of the 6 groups/banks. What do you think, does it in theory sound plausible? I know this is extremely simplified, but I needed to lay this out to try and visualize it.
Yes that would definitly work. You may want to consider using potentiometers instead of selector switches as they are way cheaper and you wont have to wire in all those resistors.
 
Last edited:

Thread Starter

klangst

Joined Jul 5, 2013
56
Yes that would definitly work. You may want to consider using potentiometers instead of selector switches as they are way cheaper and you wont have to wire in all those resistors.
I will definitely have to think about the potentiometers more. It could provide for much more variable timing.

Now the hard part is coming up with all the circuitry. I know I can handle the programming, but I am going to need to learn a lot and get a lot of help to put together the circuit.
 

MaxHeadRoom

Joined Jul 18, 2013
28,619
Why not use digital inputs and use internal timing for each selection, you could also use multiplexed BCD thumbwheels.
4 Inputs 8 outputs takes care of 8 BCD digits, each 0-9.
Max.
 
Last edited:

Thread Starter

klangst

Joined Jul 5, 2013
56
Why not use digital inputs and use internal timing for each selection, you could also use multiplexed BCD thumbwheels.
8 Inputs takes care of 4 BCD digits, each 0-9.
Max.
Can you explain about the digital inputs? I am really just learning this, so right now I am familiar with analog. I would really like to understand more about how digital inputs with internal timing works, if you would be willing to share with me.
 

MaxHeadRoom

Joined Jul 18, 2013
28,619
Digital inputs are the simple I/O 0v - 5v inputs. If you have used a PLC in the past that is what you dealt with mainly.
If you are not familiar with the basics, I suggest you do some tutorial on the Pic, if this is the way you are going.
e.g. http://www.winpicprog.co.uk/pic_tutorial.htm
There is a limited number of timers in a PIC but if the timing was sequential, you could daisy chain the process using one timer.
There is also a timer that can be ran off of a 32khz watch crystal input that can be set for a multiple fractional second timing.
Max.
 
Last edited:

Thread Starter

klangst

Joined Jul 5, 2013
56
Thanks Max. Rereading my request I was not clear in exactly what I was asking. I do understand the basics of digital inputs, it was the combination of digital inputs with the internal timing that I was looking for clarification on. I think I understand what you are saying now. Also, I have never used a BCD thumb wheel/switch before. That is an interesting thought.
 

MaxHeadRoom

Joined Jul 18, 2013
28,619
Also, I have never used a BCD thumb wheel/switch before. That is an interesting thought.
They each have 4 data (BCD) lines all fitted with blocking diodes so they can be paralleled up and each is selected with an enable line for individual, random or sequential, reading of the decimal selection.
As to the internal timer functions, this will depend on how the final design or operation is sequenced, but a study of Picmicro timers should give some insight.
Probably a flow chart of the sequence would also help in the programming.
Max.
 

Thread Starter

klangst

Joined Jul 5, 2013
56
They each have 4 data (BCD) lines all fitted with blocking diodes so they can be paralleled up and each is selected with an enable line for individual, random or sequential, reading of the decimal selection.
As to the internal timer functions, this will depend on how the final design or operation is sequenced, but a study of Picmicro timers should give some insight.
Probably a flow chart of the sequence would also help in the programming.
Max.
Thank you for the explanation on the BCDs. The flow chart is a good idea. I am going to do a little more research first and then I will put together a flow chart for the sequence. Then my thought is to take a piece of the circuit at a time and start designing it.
 

Thread Starter

klangst

Joined Jul 5, 2013
56
OK, this project grows everytime I learn something new! Can anyone else relate? :D
After reading and learning more about PICs and 2x16 LCDs, which are cheap, I think it may be better to add the LCD rather than all the switches for selecting timing. With the LCD I could even get down to being able to set the timing for each que. This will require a higher pin PIC and more programming, but I enjoy the programming part. Off to do more studying.

Can anyone recommend a good starter kit for PIC programming that has an LCD and some buttons to control it? Preferably the PIC18f.
 

MaxHeadRoom

Joined Jul 18, 2013
28,619
There are sample files with the Picdem 2 Plus board, you can get the files themselves from the Picmicro site, both for 16F and 18F, the old version has assembly files, the later one is in C.
Max.
 
Top