Check my newbie circuit. Lighting leds in sequence with delay

Thread Starter

replicaprops

Joined Jul 1, 2017
28
Well, in the last couple weeks I've learned allot (I think)
Decided to go with an arduino set up, sending to a atmega328p-au.

Would any of you mind double checking my work and let me know if this looks ready to goto PCB
light up key_schem.png
 

AnalogKid

Joined Aug 1, 2013
11,055
C1 and C2 are not needed with an integrated oscillator. However, there should be a decoupling capacitor near its power and gnd pins.
Can an ATMEGA I/O pin source enough current to drive 4 LEDs in parallel?
There are no GND connections on the schematic.

ak
 

Thread Starter

replicaprops

Joined Jul 1, 2017
28
C1 and C2 are not needed with an integrated oscillator. However, there should be a decoupling capacitor near its power and gnd pins.
Can an ATMEGA I/O pin source enough current to drive 4 LEDs in parallel?
There are no GND connections on the schematic.

ak
Ok so c1 and c2 are eliminated.
Decoupling capacitor, not sure I understand. Can you elaborate?
I left all the grounds as seeds for a common ground plane. Is that not a good idea?
 

panic mode

Joined Oct 10, 2011
2,757
there are LEDs that operate with different current
typical LED will be working in 10-20mA range.

suppose yours works with 15mA... there are 4 such LEDs driven from same MCU pin which means that PIN must be able to drive 4x15mA=60mA. this is significantly more than what digital circuits can handle, digital circuits are used as logic elements, not drivers. this means you need to consider either separating the LEDs so each is driven from another MCU IO pin (they can be controlled simmultaneously) or you need additional components to drive the increased loads (transistor circuits).
 

Thread Starter

replicaprops

Joined Jul 1, 2017
28
there are LEDs that operate with different current
typical LED will be working in 10-20mA range.

suppose yours works with 15mA... there are 4 such LEDs driven from same MCU pin which means that PIN must be able to drive 4x15mA=60mA. this is significantly more than what digital circuits can handle, digital circuits are used as logic elements, not drivers. this means you need to consider either separating the LEDs so each is driven from another MCU IO pin (they can be controlled simmultaneously) or you need additional components to drive the increased loads (transistor circuits).
I thought putting resistors on reduced current draw? I used this http://ledcalc.com/ to calculate using 4 leds and limiting their combined current to 40mA.
 

dendad

Joined Feb 20, 2016
4,478
The 10K resistor from the battery is in series with the supply. That will not work.
The +ve supply needs to to to Vcc and Avcc, then the 10K resistor connects from that to Reset.
40mA from the processor pin sounds a bit high to me. It is a much better idea to drive a logic level FET and have that drive the LEDs.
https://arduinodiy.wordpress.com/2012/05/02/using-mosfets-with-ttl-levels/

The bypass capacitor is to prevent noise getting to the processor and interfering with its operation.
Put a capacitor between the Vcc to ground pins as close to the processor as you can.
To save space, you could also use SIP resistors packs for the LEDs, with the common pin of the SIP resistor pack connected to +V, and the LEDs between the other pins and the FET.
Google "sip resistor network" and you will see them.
There are a couple of types, one with a common pin, and the other with separate resistors.
 

dendad

Joined Feb 20, 2016
4,478
You cannot run the circuit through a 10K resistor!
That will limit the max total current to BattV/10,000 and if it is 3.3V, then it is 3.3/10000 = 0.033 mA
There should be no resistance between the battery and the processor power supply pins.
The battery needs to be connected (via the reed switch) directly to the processor power pins. Then the 10 K resistor is from the +ve supply to the reset. You have the resistor in the wrong place.
 

Thread Starter

replicaprops

Joined Jul 1, 2017
28
You cannot run the circuit through a 10K resistor!
That will limit the max total current to BattV/10,000 and if it is 3.3V, then it is 3.3/10000 = 0.033 mA
There should be no resistance between the battery and the processor power supply pins.
The battery needs to be connected (via the reed switch) directly to the processor power pins. Then the 10 K resistor is from the +ve supply to the reset. You have the resistor in the wrong place.
Like this?
light up key_schem.png
 

Sensacell

Joined Jun 19, 2012
3,453
While I totally appreciate your 'can-do' attitude, a word of caution is in order.

Since this object will be made in some quantity, with money invested, it's unwise to blast ahead without thinking this through a bit more.
While it seems simple, there are many subtleties waiting to bite you.
Take some time to think this through, create a clear detailed specification, pay someone who really knows this stuff to design it for you.

A friend of mine lost his shirt trying to manufacture a simple LED product with a quick and dirty approach, the customers loved the prototype, but 30% of the units did not work in the customers hands- he lost the customer, all the investment, and the opportunity.

A bad design from the start.
 

Thread Starter

replicaprops

Joined Jul 1, 2017
28
While I totally appreciate your 'can-do' attitude, a word of caution is in order.

Since this object will be made in some quantity, with money invested, it's unwise to blast ahead without thinking this through a bit more.
While it seems simple, there are many subtleties waiting to bite you.
Take some time to think this through, create a clear detailed specification, pay someone who really knows this stuff to design it for you.

A friend of mine lost his shirt trying to manufacture a simple LED product with a quick and dirty approach, the customers loved the prototype, but 30% of the units did not work in the customers hands- he lost the customer, all the investment, and the opportunity.

A bad design from the start.
That is what I am doing. I just paid for this to be designed and apparently that was the wrong step because everyone here is saying it is wrong. So who do I trust? The person whom I paid, or the people telling me it is wrong?
 

WBahn

Joined Mar 31, 2012
30,074
If someone you paid is telling you to use a 28-pin $2 MCU like that for a product like this, pay someone else. You can almost certainly get along just fine with a 6-pin $0.40 MCU (and that's Digikey's single-quantity price) such as the PIC10F200. You don't need an external oscillator -- it has a precision 4 MHz internal oscillator that is almost certainly more than good enough for your needs. That gives you four I/O pins, one input for your switch and three outputs for your LEDs that are specifically intended to drive LEDs. Each output can source/sink 25 mA and all three can do it at the same time.
 

Thread Starter

replicaprops

Joined Jul 1, 2017
28
If someone you paid is telling you to use a 28-pin $2 MCU like that for a product like this, pay someone else. You can almost certainly get along just fine with a 6-pin $0.40 MCU (and that's Digikey's single-quantity price) such as the PIC10F200. You don't need an external oscillator -- it has a precision 4 MHz internal oscillator that is almost certainly more than good enough for your needs. That gives you four I/O pins, one input for your switch and three outputs for your LEDs that are specifically intended to drive LEDs. Each output can source/sink 25 mA and all three can do it at the same time.
He used an arduino to create the program for the mcu. The arduino uses the atmega328p but my pcb is too small for that mcu so I am using the atmega328p-au instead. This is what the program does https://www.facebook.com/replicapropscom/videos/1694983457191508/

Do you think the PIC10F200 can be used instead to do what is happening in that video?
 

Sensacell

Joined Jun 19, 2012
3,453

WBahn

Joined Mar 31, 2012
30,074
Top