Arduino Question

Friends,

It's been a while! I have come a long way since I started, and now that I am onto more complicated projects, I have a question that I hope you can help with.

I created a cat tower for... well my cat.

It is running off of an Arduino Micro with the following components.

USB powered water fountain that is hooked up to a 5v relay.

A laser Pointer that is around 2.5 Vs (about 2 grams)

Two Tower pro servo SG90s (the are connected to make a X Y arm for the laser pointer, so the load must be small)

HC-SR04 Ultrasonic Distance Sensor Module

The Water Pump's USB is connect to a wall adapter,everything else is powered by 4 AA batteries.

As you could already guess, this is not enough power. The result is the Ultrasonic sensor is giving wrong data, and the relay is tripping endlessly. However, if I plug the USB cable into the Arduino while the batteries are also plugged in, everything works fine.

So finally to get to my questions, does having the USB plugged into the Arduino while also having the batteries plugged in mean I am giving the circuit more power?

What is the best way to determine the power needed for a project? Is it, to get the specs for everything and just add up the voltage? (I know very little about power needs and consumption, as you can tell with my 4 AA battery fail)

Thank's for all your help! :slight_smile:

If you are connecting the 6V from the 4 AAs to the micro’s raw pin, that’s not enough, needs 7 to 12, try 6 AAs (9V), do NOT connect to the 5V (Vcc) pin. Where is the servo power coming from? Not from the 5V pin I hope, it cannot supply current for 2 servos, 1 is really too much and 9V is too high for the servos, get yourself a 5V, 2 to 3 Amp wall wart.

Well...standard reply. It's very hard to assess your situation without a diagram. Your verbal description is fairly good, but it's hard to sort out missing details and incorrect assumptions merely from a verbal description. But, things to consider:

  • Make sure there's an EMF Absorption diode on that Relay.
  • Make sure the Arduino output that is driving that Relay, is capable of driving that relay.
  • Make you have your layout properly routed for delivery of higher currents. For instance, all Ground lines to the same point, and all Power lines to the same point. Sufficiently large gauge wire to handle the higher currents.
  • Decoupling capacitors in strategic positions in your circuit, to supply local power, on demand, and prevent current spikes in the rest of the power lines that might induce voltage noise in the more sensitive electronics.

Also, I'm not sure what the statement:

A laser Pointer that is around 2.5 Vs

means. But that could just be my ignorance showing :wink:

fodelement:
...does having the USB plugged into the Arduino while also having the batteries plugged in mean I am giving the circuit more power?

Probably not, but without a diagram, it's hard to say what is happening -- for instance, how do you have those two sources tied together? Also, have you tried it with just the USB connection?

fodelement:
What is the best way to determine the power needed for a project? Is it, to get the specs for everything and just add up the voltage? (I know very little about power needs and consumption, as you can tell with my 4 AA battery fail)

Again, hard to advise without a diagram. But, generally, you determine the power needs of each item, and add it up. But, since you are controlling the Pump with a Relay, not sure what power source you using to power the pump, and how you have that all arranged. The arrangement can be critical, in such a setup. So, a photo would also be nice.

fodelement:
...everything else is powered by 4 AA batteries.

If you are connecting these batteries to the Vin pin, the voltage regulator dropout will, likely, reduce that to a voltage too low for the Arduino to function properly -- especially if the relay is loading the batteries down enough to drop their voltage even lower than the nominal 6V -- also, as the batteries drain, their voltage is going to go below 6V, and the situation will get even worse. And, if you are connecting those batteries to the +5V pin, well, then, you are risking the destruction of your Arduino.

And a few of these:

does having the USB plugged into the Arduino while also having the batteries plugged in mean I am giving the circuit more power?

Actually, NO. the standard arduino board has a voltage switching circuit that will disable the 5V from USB when it sees the voltage form the DC JACk. There is no “adding” here.

Hello guys,

Thank you so much for your input! I admit, I am no expert in this.

I am not home, so this is the best I can come up with in a pinch.

Link to Thinker Cad

I hope this explains it better than I could. (I kept the relay and fountain out)

The led is the laser pointer.

pwillard:
Actually, NO. the standard arduino board has a voltage switching circuit that will disable the 5V from USB when it sees the voltage form the DC JACk. There is no “adding” here.

Interesting… I have no idea why it works when I add the USB power then. (I have tested it, and it works 100% of the time with the USB cable connected and the batteries)

ReverseEMF:
And, if you are connecting those batteries to the +5V pin, well, then, you are risking the destruction of your Arduino.

Well… that’s exactly what I was doing! I see what was wrong with my assumption on this part… I will fix this as soon as I can.

outsider:
Your link don't work, is your micro the full size board or a micro Mini?

I wish I could say I know the answer to this question, but I got it from school.

Is the exact one I am using.

I don't know why the Thinker Cad link won't work for you, so here is a picture of it.

https://1drv.ms/u/s!Auh_y1EF3Qyc22mzELkr3dcLKc4d