Arduino Standalone Power Handle (Atmega328P)

Hello Everyone, :slight_smile:

I am new to this forum as well as Arduino. :roll_eyes: I know about Arduino since sometimes ago but actually put my hands on it very much recently.

So, I have done few testing and got very interesting results. And want to do more. And I came across with the idea of bringing Arduino project out of the development board and run it standalone using Atmega328P U micro-controller chip. I want to try this.

I have a small project tested and running ok with Arduino UNO R3.
It is a distance measuring (Water level meter purpose) using the HC-SR04 Ultrasonic Sensor.
And I have added 6 LED’s to identify several range of distances from the sensor to object. (Water)

Now my Question is…
I wish to add 3 more LED’s to this and run it standalone.
How can I handle the power with 9 of total LED’s (Normal LED’s for now) including Ultrasonic Sensor. I have to place the sensor approx. 6 1/2 meters away. I’m hoping to use a telephone cable between the sensor to the circuit. Do I have to plan a circuit to manage the current with some components? I am still new to this so hoping anyone can help me with this. :-![

Anyone with some guidance? Attached my project as an image below…

First the mega 328 data sheet (section 26.2 page 313) lists the absolute maximum allowed current for each pin at 40mA. The recommended max current is 20mA per pin. And the absolute maximum current for the chip is 200mA (the total current through the supply or ground rails).

HCSR-04 data sheet says working current is 15mA and quiescent current is 2mA. Use the 15mA to be conservative.

Each LED draws (Vcc - LED Vf) / Rlimit or (5 - 1.7) / 330 = 10mA.

So the LEDs are well under the 20mA per pin. The total current for the chip is 60mA (10mA/LED times 6 LEDs) + 15mA = 75mA and that is under the 200mA total. You should be good to go current wise.

I have to place the sensor approx. 6 1/2 meters away.

That is pretty far for the HCSR-04 signal. It may or may not work with phone cable. Testing will tell. I don't know what to do if it does not work except shortening the distance.

manojdhr:
So, I have done few testing and got very interesting results. And want to do more. And I came across with the idea of bringing Arduino project out of the development board and run it standalone using Atmega328P U micro-controller chip.

OK, I think you have got matters a bit confused here.

The Arduino UNO as illustrated above is not a practical form. To some extent it is indeed a “development board” or perhaps more appropriately a “demonstration” or “experimental” form. But the alternative is not to make a “standalone” version.

For serious “real world” projects, what you want to use is either an Arduino “Nano”

or if you do not need the USB interface and can program it using an adapter, a “Pro Mini


These are ready-assembled and (“clones”) inexpensive so you can connect to them either by soldering to the terminals, or soldering the pin headers to them and mounting them either to stripboard or your own custom-made PCB. There are also “screw shields” and other shields to spill out the various connections using “Dupont” cables.

What makes no sense is to try and purchase all the necessary parts separately. Even though the regulator on these boards is essentially useless and you may not want the “pilot” LEDs (or USB interface chip on the Nano) if operating from batteries, it is generally cheaper to purchase the ready-built modules which are a reasonably well-designed and tested PCB pattern using SMD parts.

manojdhr:
How can I handle the power with 9 of total LED’s (Normal LED’s for now) including Ultrasonic Sensor.

Well, you use a regulated 5 V power supply, don’t you? (Do not try and use the “Barrel jack” on the UNO or “Vin”/ “Raw”.)

manojdhr:
I have to place the sensor approx. 6 1/2 meters away. I’m hoping to use a telephone cable between the sensor to the circuit. Do I have to plan a circuit to manage the current with some components?

It’s not the current, it is the need to supply sufficient signal over such a distance. In respect of an ultrasonic sensor, it makes more sense to locate the Arduino reasonably near the sensor and run less critical connections - to LEDs - over the cable. “Cat 5” - readily available - has 8 wires, so power and 6 LEDs. It might be better to use two separate Pro Minis and serial communication between them, but if you do not need all 9 LEDs to be on at once, then six wires is probably sufficient.

@groundFungus

Thank you for your helpful info.

Also as you have suggested, I need to do testing with the distance. I will try to make it work.

@Paul__B

Much appreciate with your detailed info. You have given a direction I never thought of.

When I search for off development board solutions, I saw separate circuit build with ATMega328 with adding 16 MHz oscillator but it is still something I need to research more.

But with your idea of "real world" project, I will focus on experiment with the "Nano" or "Pro Mini" board. That's a handy way of making a finished product.

I have to do more testing with that along with LEDs and with 5v. Also use of a Cat 5 is a good idea. At some point all 9 LEDs will be turned on at once. So that serial communication would be a good solution.

QUESTION: Why did you say 'Do not try and use the "Barrel jack" on the UNO or "Vin"/ "Raw" '?

6.5m of wire can pick up a lot of interference. That's a concern. OTOH both the Arduino and the HC-SR04 use push/pull signals so good chance it will actually work. You have to try this out. It also depends on the general electric environment - noisy motors or so nearby.

manojdhr: QUESTION: Why did you say 'Do not try and use the "Barrel jack" on the UNO or "Vin"/ "Raw" '?

It's more trouble than it's worth. An overheating regulator is a common effect. Just use an old mobile phone charger (you very likely have a bunch of those around).

wvmarle: It's more trouble than it's worth. An overheating regulator is a common effect.

That's it. The regulator on the Arduino UNO/ Nano/ Pro Mini/ Leonardo/ Pro Micro has very little heatsink, so will not pass very much current (depending on the input voltage and thus, how much voltage it has to drop) before it overheats and (hopefully reversibly) shuts down.

It is essentially a novelty provided in the very beginning of the Arduino project when "9V" power packs were common and this was a practical way to power a lone Arduino board for initial demonstration purposes. And even then it was limited because an unloaded 9 V transformer-rectifier-capacitor supply would generally provide over 12 V which the regulator could barely handle.

Nowadays, 5 V regulated switchmode packs are arguably the most readily available in the form of "Phone chargers" and switchmode "buck" regulators are cheap on eBay so these can be fed into the USB connector or 5 V pin to provide adequate power for most applications. Unfortunately, many tutorials or "instructables" are seriously outdated or misleading and have not been updated to reflect the contemporary situation.