Electronic – Schematic critique

schematics

I designed my first electronics project and I'd be thankful if you could give me any feedback on it.

I'm specially looking for any beginner mistakes, anything wrong or inefficient with my circuit, and on the way I built the schematic.

The project is a kitchen timer controlled by a Arduino. It has three timers that can run at the same time and it beeps when it reaches zero. It is powered from the wall, but when it's disconnected a battery must assume, without rebooting the timer.

The first schematic is the power supply. If connected to the wall, it should not use power from the battery, but it must switch to the battery if disconnected.

Schematic 1

The second schematic contains the microcontroller and the switches and buttons used to control the timer.

Schematic 2

The third schematic contains the display.

Schematic 3

I understand that evaluating a schematic is a lot to ask, so I'm really thankful for any feedback.

EDIT

I'm very grateful to everyone who took their time to comment on my schematic. I don't have any engineer friends around so your feedback is highly valuable.

I tried to make the changes according to what you suggested. I haven't tried it on the breadboard yet, so I'm not sure if everything will work. I still need to make a few tests to find out the best value for R5.

Here's the updated schematic:

Schematic 1

Schematic 2

Schematic 3

Best Answer

Kudos for using a refdes (reference designator) for (most) components. Especially if you want to discuss a schematic they're needed for decent communication.

The power supply

  • you use the refdes "L1" and "L2" for the LEDs. Don't. "L" is the standard designator for inductors. Use "LD" or "LED" or, as I do, "D" for diode.
  • the value of R1 is too low. It will give the LED 45 mA which is too much for an indicator LED. Increase the value to 560 Ω and you'll have a safe 18 mA; they're usually rated at 20 mA. Check the datasheet. By the way, do you really need that LED? It will always consume power.
  • C1 and C2 are indicated as "10 mF", where I presume they should be "10 µF", that's a factor 1000 difference. They'll most likely be electrolytic capacitors, which are polarized. Use a symbol which indicates the polarization and clearly indicates which is the positive side. Also for electrolytics it's good practice to mention the voltage in the schematic as well. C1 should be at least 20 V, C2 10 V.
  • Place a 100 nF parallel to C1 and C2
  • draw C2 closer to the regulator's output than the LED. Electrically it makes no difference, but that's how you should place them on the PCB. The 100 nF should be closest to the output.

The microcontroller

  • the ATmega328 doesn't have a VREF pin. That should probably be Vcc. Add a 100 nF decoupling capacitor between Vcc and ground, as close as possible to the pins. Always decouple an IC's power supply.
  • Reset is connected to ground. That's OK if you use the internal reset circuitry, but don't forget to program the the RSTDISBL bit to "1".
  • you can't drive a speaker directly from an I/O pin. You'll need a transistor there.
  • you can save a resistor if you use the internal pull-up of PC0 and connect the switch to ground. R4 won't be needed then. Remember that the logic will be inverted.
  • same for PB2 to PB5 and switches S2 and S4: internal pull-ups and switches to ground instead of +5 V.
  • switches S2 and S4 are confusing. You have 2 contacts on the lower side, and 5 on the high side. Are they supposed to be change-over contacts? If so, you won't need that: one input will always be complementary to the other, so you'll only need one. In any case the lowest of the pull-down resistors serves no function.
  • I would use more descriptive names for the nets on Port D, like "Digit1", "Digit2", etc.

The display

  • Again, decouple the power supply with a 100 nF capacitor.
  • the resistor values for R4 are way too high. Swap them for 150 Ω types.
  • the 5 R5 resistors can be dropped. They serve no function.
  • the microcontroller can't drive the display common cathodes directly: with all the LEDs on you'll have 7 \$\times\$ 20 mA = 140 mA, that's much more than an I/O can sink. You'll need 5 NPN transistors here, or a transistor array like the ULN2803.

Conclusion
This is a long list, but I think you did a fine job, considering it's your first project. I've seen much worse schematics. Success!


edit Re the update of the question
Your circuit around Q1 and D3 is not quite OK: the battery will feed the LED, but not the rest of the circuit. I'm not sure the LED as battery indicator is a good idea: especially with battery power you have to be economical, and not waste power on a LED.

How about this: keep the diodes like in your first version, but control the LED from the microcontroller. Use one of the free pins to detect the presence of the 12 V through a 5 V zener diode and a series resistor. You can then blink the LED when you're running on battery power. A short flash once every second is much more economical.