Powering ATMega328 in project safely without UNO board?

Hi all,

Background spiel
I've been working on a arduino project involving a servo, some LEDs and an LCD module. For the development I've been using the Arduino UNO board and a breadboard for all the components. Now I'm ready to make the project more permanent, however I don't want to put the entire UNO board in the project as it 's a bit of a waste putting the entire thing in when I only need a few pins. So I went on and used the "bareduino" schematic and managed to get the ATMega328 chip working on there without the UNO board. However I want to further shrink the components needed in the permanent project.

Currently I'm using a 4x AA batteries (6V total) to power the ATMega328 using a 7805 regulator with some capacitors to reduce the voltage to 5V for the ATMega328 and the servo power is plugged in before the regulator so it can use higher current (7805 will cap to 1A max).

Instead of using batteries I wanted to instead use a 5V DC mains supply (one used for a phone where it outputs 5V DC and 2.5A max current). As I'm using a 5V DC plug, I want to remove the 7805 portion of the circuit. I've attached a basic strip board of what I'm trying to do minus the LEDs and LCD.

Questions

  1. As I'm using a DC mains supply that is already capped to outputting 5V and 2.5A max, can I remove the 7805 regulator?
    As the mains supply is 5V DC it doesn't need to reduce the voltage further, but I wasn't sure if having a 7805 regulator between the mains and IC added some other layer of protection I'm overlooking.

  2. As the servo is being plugged into the same "power rails" do I need to add anything like a rectifier diode (1N4007) to protect the ATMega328 at all (as I hear people saying motors can cause reverse power spikes that can damage ICs)?
    If so, where should I put it or is it unnecessary?

Thanks for your time and advice!

  1. Yes. I use 5V wallwarts all the time, with just a 10uFcap where 5V comes into the board.
    Can add a 5.1V Zener diode just in case.

  2. Yes - put the diode from servo gnd (anode) to servo power (cathode), just in case servo internals don't have similar.

Cheers CrossRoads, appreciate the help. I know programming quite well, but still learning the hardware side of things.

At the risk of revealing my amateur knowledge level of electronics, can I confirm the screenshot attached is how I should add those components to the power portion of the circuit (I just made it a simple LED circuit for the sake of example). I'll probably buy a pack of zener diodes from ebay, so I'll have plenty to hand and I'll one to input power to be safe.

Thanks again

no, you need to reverse the protection diode

Here's a writeup on it.