Maker Pro
Maker Pro

Sequential Timing Circuit

OK, I think a good place to start would be to make a provisional choice of microcontroller - at least the architecture. Microchip PICs are very popular, are fairly easy to program in C, and have plenty of examples and tutorials. Many people here have experience with them, including me, Steve, Gryd3, BobK, and others, who can advise you on the hardware and firmware aspects. You will have to take quite a bit of the initiative yourself though.

Gryd3's suggestion of starting with a pre-built prototyping/evaluation board with an MCU and programmer is a very good one. Once you get the code working you can do your own stripboard circuit or PCB. Here are four PIC evaluation packages from Microchip available through Digi-Key:

http://www.digikey.com/product-detail/en/Q7442559/LPC2-PROMO-ND/3880043
USD 34. Includes a number of blank PIC devices but no programmer/debugger device.

http://www.digikey.com/product-detail/en/Q7442546/LPC1-PROMO-ND/3880042
USD 68. Includes a number of PIC MCUs (three 8-pin devices and two 14-pin devices) and a PICkit 3 programmer/debugger module, which you will need - probably your best option.

http://www.digikey.com/product-detail/en/DV164130/DV164130-ND/3671621
USD 72. Includes a PICkit 3 programmer/debugger module, which you will need, but it seems, no PIC MCUs.

http://www.digikey.com/product-detail/en/DM163022-1/DM163022-1-ND/2696124
USD 120. Evaluation board with an LCD. Includes some blank MCUs but no programmer/debugger.

This application needs no special features and very little processing power. The choice of MCU is really driven by how much I/O you need. Each MCU needs two pins for VDD and VSS, and two pins for the crystal. That leaves either 4 (for an 8-pin PIC) or 10 (for a 14-pin PIC) more pins for general I/O; one of these is only able to be an input to the device, but the others can be either inputs or outputs.

That's fine for this case, because you're going to have a pushbutton. And if you only want three LEDs, an 8-pin device is suitable, but you have no expansion opportunities. Actually you do, because three lines are enough to drive external LED driver ICs (there are several options here), but it's simpler to drive the LEDs with a 1:1 I/O mapping. Something for you to consider at a later stage.

PIC microcontrollers can be programmed in several languages. The commonest are assembly language and C. C is quicker to learn and there is a lot of sample C code for PICs. C is actually a general purpose programming language that can also be used to program PC-type computers; microcontrollers are very resource-constrained compared to PCs so you should look at sample code that is specifically written for microcontrollers.

The development environment is called MPLAB and it's a free download from microchip.com. There are two generations of MPLAB: MPLAB 8 point something, the last version of the old architecture, and MPLAB X (the 'X' means ten, like Mac OS X) which is the way of the future. Some have criticised MPLAB X but I haven't had any big problems with it. It includes various sample programs, and there's probably code there specifically written to run on those evaluation boards.

MPLAB programs PIC devices via the PICkit 2 or PICkit 3 programmer, which connects via USB. Like MPLAB, there is some argument about PICkit 2 vs. PICkit 3. PICkit 2 has some extra features, which probably won't be important for your application. PICkit 3 is supported for current and future devices. Your choice.

The out-of-box experience should be reasonably painless, and you then have a system that you can muck around with to your heart's content. Make a little change, recompile and reprogram, and see what happens. Perfect for a hands-on person. A lot of fun too. Then you can start thinking about the specific hardware and firmware requirements for your project.

For my simple ready, set, go project, I don't need arduino. The microcontroller should be adequate.
All the components are foreign to me together with engineering that goes into the project.
If someone were to give me the parts list and wiring diagram, I would be a happy camper. I cannot find a ready made component on the market that will handle my needs.

If I could buy the necessary parts on Monday, complete and test the assembly on Tuesday, I could ship out two units on Wednesday and make enough money to by gasoline for a week. I agree that the whole thing is relatively simple, but way past my education for this subject.

I'll keep the notes you sent me. Many thanks. I'm a poor old man struggling to make ends meet grasping at ideas that seem to be doable. The subject material that you address include a large vocabulary with functionality that I am slow to grasp. Even the 555 chip has so many variables that interact with each other, I cannot make working sense of it. At this point, I'm not interested in possibilities, but a specific final product I can sell to put bread on the table.
Michael
 
I would be very surprised if any of those issues was a problem for this project. Arduinos run at a similar speed to the simple PICs - plenty fast enough - apart from the more advanced Arduinos, which run faster. The screen may be slow to update, but not compared to the time periods you're talking about. And your program logic only needs a few bytes of RAM for variables. I'm not saying you should go for the Arduino - it may be a lot more than you need - but I don't think it would have any problem doing what you want.

I would like to use the Arduino for my large project. If I could develop the equipment and the program, I could sell at least 100 units per year. So far, the Arduino components don't work for me. Programming cost me $1,500 for something I cannot use. Right now, I don't have funds to invest in research and development. Purchasing the Arduino products at retail is too expensive to resell to the market. And I can't justify buying a large quantity if the pieces I've already purchase can't be made to work. I've tried to trouble shoot via the forums, but I get no results.
Michael
 
If you tell me what PIC you decide to use and what LEDs you are thinking of using I don't mind drawing up the circuit for you and supplying a parts list. You need to let me know if you want any switches also.
Cheers
Adam
 
If you tell me what PIC you decide to use and what LEDs you are thinking of using I don't mind drawing up the circuit for you and supplying a parts list. You need to let me know if you want any switches also.
Cheers
Adam

Adam:
This is very generous of you.
Look at this page from Microchip. Is it what I need? http://www.microchipdirect.com/ProductSearch.aspx?Keywords=DV164121

I use strip LEDs and panel LEDs. All operate 12vdc. The strip LEDs are high intensity. When lit, One strip LED runs parallel with one panel LED.
I will be using a SPST on/off switch. I'm looking to mount it as a plug in at the end of a coiled cord similar to a phone cord. (remote operation). I can make something suitable for the remote switch.

MichaelLED-Strip.jpg LED-Panel.jpg
 
How much current do the LED panels draw each? The Dev PCB will have a surface mount device on it, this is going to be difficult for you to solder to a PCB. I would think you will require a dip package.

Kris can you suggest a dip PIC for Michael that you think will do it. I am thinking 1320 or similar.
Adam
 
How much current do the LED panels draw each? The Dev PCB will have a surface mount device on it, this is going to be difficult for you to solder to a PCB. I would think you will require a dip package.

Kris can you suggest a dip PIC for Michael that you think will do it. I am thinking 1320 or similar.
Adam

About 150ma.
The strips and panel LEDs mount elsewhere. I'll run wire to the board for connection. Same for batteries. I use a 12AAbattery pack and may use an AC adapter.

Michael
 
...
http://www.digikey.com/product-detail/en/Q7442546/LPC1-PROMO-ND/3880042
USD 68. Includes a number of PIC MCUs (three 8-pin devices and two 14-pin devices) and a PICkit 3 programmer/debugger module, which you will need - probably your best option.
...
I second this package from Digikey.
Its got the evaluation board you can work on to fine tune your program, and has multiple PICs to allow you to build multiple devices right off the get go.
I don't want to mention Arduino for your application if you intend to make multiple devices to sell... Many Arduino are simply pre-made kits with ATTiny or other MCUs that are wrapped up in additional code. This bring the cost up, and there is more to go wrong which could explain your difficulty getting it to work depending on your OS. (Which I am still unsure of)

I am still in the dark for exactly how you want this to function. My previous question has gone unanswered.
When you envision the controls for your timer, how do you imagine controlling it?
Remember that buttons and dials are easier to interface, as well as simple displays (Like something from a VCR). Once you move into touch screens, you add a large layer of complexity and added cost which I'm sure you would like to avoid.

I always have a hard time encouraging this process, as the common reply is "I'm not sure what is possible".
Anything is possible, don't think about how just yet, only think about the final product and we can work backward from that.
The only thing that will hinder your development is time and cost if you want a complicated device, or indecision.
If this is something you want to accomplish sooner rather than later, you will need to provide a complete description detailing exactly how you want your timer to function... How many buttons, lights, number, dials, how you want each one to work.
Alternatively, you can hire a designer/developer to do it for you. Luckily for you, there are some bright minds on the forum who will help with the design aspect because it is fun for them ;)
However, I do not plan to design the circuit or program for the PIC if I only have a general idea of the finished product.
I will either over simplify and my work will be discarded, or I can over engineer it and have the same problem. Even if I hit the nail on the head with the design and function, I would be doing work that if your responsibility.

Of course, if you plan to buy a PIC and learn on your own, then keep the secret sauce a secret ;) but we can't supply you with a material list otherwise.
 
I think he wants it to be automatic. The way I see it is press a button and it start the timer, press again and it could stop. Press again and it starts a gain. Am I over simplifying things?
Adam

I have already said I will do it for free, this is simple and it doesnt seem he is making money out of it. But hey my company makes £12,000,000 a year from my designs and I get a wage.And your right I enjoy it.

Adam
 

KrisBlueNZ

Sadly passed away in 2015
The Dev PCB will have a surface mount device on it.
No, it has DIP positions.
Kris can you suggest a dip PIC for Michael that you think will do it. I am thinking 1320 or similar.
Literally anything in the PIC family will be fine. Based on cost from Digi-Key, the two clear options are:

PIC12F1571 http://www.digikey.com/product-detail/en/PIC12F1571-I/P/PIC12F1571-I/P-ND/4739307 USD 0.77 1-up; USD 0.52 100-up; enhanced mid-range architecture; 8-pin device (I/O would be maxed out);

PIC16F505 http://www.digikey.com/product-detail/en/PIC16F505-I/P/PIC16F505-I/P-ND/613195 USD 0.96 1-up; USD 0.66 100-up; baseline architecture; 14-pin device (spare I/O for expansion).
 

KrisBlueNZ

Sadly passed away in 2015
The 8-pin device, using an external crystal, has four GPIOs, one of which must be an input. That would be one input for the pushbutton and three outputs for the LEDs.

The 14-pin device, using an external crystal, has ten GPIOs, one of which must be an input. That would be one input for the pushbutton, three outputs for the LEDs, and six spare general I/O pins.

I don't know what you mean by "reg". Both of those devices will work at 5V. A 4 MHz crystal would be plenty fast enough. I wouldn't use a ceramic resonator; they're not accurate enough. The pushbutton would need an external pullup but can be directly connected; debouncing would be done in firmware. All of the LED control outputs would need to be buffered with transistors or MOSFETs.

Edit: If you're asking about the development board, yes, it has a pushbutton and four LEDs already on it! Ideal for prototyping this project. Also the accompanying documentation is structured as a tutorial, starting with simple projects and moving to more complicated topics. It looks like the ideal starting point for the OP.
 
Last edited:
I think he wants it to be automatic. The way I see it is press a button and it start the timer, press again and it could stop. Press again and it starts a gain. Am I over simplifying things?
Adam

I have already said I will do it for free, this is simple and it doesnt seem he is making money out of it. But hey my company makes £12,000,000 a year from my designs and I get a wage.And your right I enjoy it.

Adam
Automatic yes,but with multiple modes.
The first page has two of the desired timing modes. I am unsure if there will be more. If there will be a single button to toggle modes, or a button for each mode etc...
Don't get me wrong, I enjoy this kind of thing too, but we are twice removed from the client of the product. Anyone on here could whip together the circuit in a basic form that would function as intended with a 3 minute timer (1 min warning) and a 90 second timer (5 second warning)
There have been hints at other desired features/functions...
Otherwise a switch, a button, 3 LEDs, and 3 current limiting resistors will do. (Add 3 transistors, and 3 more resistors if higher power LEDs are required... or a relay for larger loads...)
 
The 8-pin device, using an external crystal, has four GPIOs, one of which must be an input. That would be one input for the pushbutton and three outputs for the LEDs.

The 14-pin device, using an external crystal, has ten GPIOs, one of which must be an input. That would be one input for the pushbutton, three outputs for the LEDs, and six spare general I/O pins.

I don't know what you mean by "reg". Both of those devices will work at 5V. A 4 MHz crystal would be plenty fast enough. I wouldn't use a ceramic resonator; they're not accurate enough. The pushbutton would need an external pullup but can be directly connected; debouncing would be done in firmware. All of the LED control outputs would need to be buffered with transistors or MOSFETs.

Regulator. He is running this from 12 volts. The room I meant was physical space.
Adam
 
Regulator. He is running this from 12 volts. The room I meant was pysical space.
Adam
I don't see why not... the enclosure picture he posted looked to have plenty of room.. and a 5V DC regulator with a couple filter caps wont take up much space.
At 150mA per lamp, at most he'll probably draw 500mA momentarily for a self-test lighting all 3 LEDs at the same time.
 
@ Gyrd3
I meant on the dev PCB.
Good call.
Yeah there will be room to comfortably fit the parts on the prototype area... I would sooner suggest buying a protoboard though. I have not yet soldered anything onto my PicKit prototype are and I dont plan too... It looks clean as it, and if I muck with it, it may interfere with future projects.
 
Michael
I need to know your plans. What do you intend to do with this development PCB? Do you plan to use it just to write the software for the prroject or use it as the PCB in the project?
Adam
 
Top