Potentiometer problems with different power levels

I'm trying to build a specialized DMX controller for controlling lights.
The circuit looks something like this:
http://fritzing.org/projects/arduino-to-dmx-converter/

The main difference is that the power to the Arduino comes from the same 24V power that runs the light.
In order to do this, my first plan of attack was to use a 5V linear regulator to step down the power for the Arduino and the transceiver chip.
The Arduino's PWR light is not quite at full bright, but it seems good enough to run pre-programmed shows.

However, the next stage of the project has not been going so well.
The next thing I want to do is a add a potentiometer to control speed.
In the initial phase, I connected the pot to the Arduino, disconnected the Arduino from the light power supply, and connected the Arduino to the computer so I could look at the serial dump. Pot was showing values going from 0-1024 as it should.

Failure mode 1:
I disconnected the Arduino from the computer, hooked it up to the light power supply... and the pot stopped working.

Failure mode 2:
I tried hooking the Arduino to the light and the computer at the same time, which seems to make it so the pot works, BUT, the values of the pot only use up a fraction of the total pot. What I mean by that is it still goes from 0-1024, but you only need to rotate the pot to about 1/4th of its available rotation to get to 1024.

For failure mode 1, I thought maybe the Arduino just wasn't getting enough power.
So I tried buying a 9V linear regulator:

The Arduino was hooked up to the 9V regulator, while the transceiver was hooked up to the 5V regulator.
When I did that it just stopped working at all.

For failure mode 2... well, I'm guessing that the levels from the 24V power supply is confusing the Arduino about where exactly the bounds of the pot are. But I'm not sure. Either way, this isn't really an acceptable solution, as the whole point is to use the Arduino without being connected to a computer.

Does anyone have an idea of what the correct way to deal with this problem is? Or how I could go about diagnosing it?

It sounds to me like you are running the pot between +24V and ground, with the wiper to the ADC input.

Bad.

The pot should go between the +5V pin of the Arduino and ground.

majenko:
It sounds to me like you are running the pot between +24V and ground, with the wiper to the ADC input.

Bad.

The pot should go between the +5V pin of the Arduino and ground.

Nope, I have it wired up as indicated by this tutorial:
http://arduino.cc/en/Tutorial/AnalogInput

But, that does give me the idea to measure what voltage is actually coming out of the pot. If it's not between 0-5V then I imagine there is something wrong.

A linear regulator dropping from 24V to 5V is going to dissipate a huge amount of power. Very wasteful.

You really need a switching regulator for that kind of voltage drop.

24-5 = 19V drop. Typical 50mA consumption of the Arduino.

P=VI = 19 * 0.05 = 0.95w dissipated, 0.25w used. That's a huge waste - about 20% efficiency.

What I usually suggest (and use myself) is a car USB phone charger. These typically can run off up to around 40V or so (some even higher), and are 85-95% efficient.

And the 5V - were you feeding that in to the barrel jack, or the 5V pin of the Arduino?

majenko:
A linear regulator dropping from 24V to 5V is going to dissipate a huge amount of power. Very wasteful.

You really need a switching regulator for that kind of voltage drop.

24-5 = 19V drop. Typical 50mA consumption of the Arduino.

P=VI = 19 * 0.05 = 0.95w dissipated, 0.25w used. That's a huge waste - about 20% efficiency.

What I usually suggest (and use myself) is a car USB phone charger. These typically can run off up to around 40V or so (some even higher), and are 85-95% efficient.

And the 5V - were you feeding that in to the barrel jack, or the 5V pin of the Arduino?

I'd rather focus on getting it working and then worry about efficiency.

I added a volt meter to the output of the pot and ran some experiments.

Arduino connected just to the computer:
Pot rotation off: Voltage=.005 Serial output=0
Pot rotation full on: Voltage = -.005 Serial output=1024

Arduino connected to computer and light:
Pot rotation off:: Voltage=Between 0.05 and 0.80 (jumps around pretty wildly) Serial output=Between 0 and 500
Pot rotation 1/4: Voltage=0.012 Serial output=1024
Pot rotation full on: Voltage=-0.90 Serial output=1024

Arduino connected just to light:
Pot rotation off: Voltage=-.358V
Pot rotation full on: Voltage=-3.450V
Obviously can't read serial on this one because it's not connected to the computer.
I have a program where I can control the color of the light by turning the pot, but it stops working if the Arduino is not connected to the computer. I also just tried connecting a 9V power supply to the barrel jack while Arduino is connected to the light, and that still doesn't make the pot work. If the Arduino is not connected to USB power, the pot won't work.
Clearly the power levels are severely different for the case where the power is only coming from the 5V regulator.

Here's how I have the wiring set up:
24V+ = Voltage regulator In
24V- = Voltage regulator GND
Arduino Vin = Voltage regulator Out
Arduino AREF = Voltage regulator GND (other side)

Does that look right?

Here's how I have the wiring set up:
24V+ = Voltage regulator In
24V- = Voltage regulator GND
Arduino Vin = Voltage regulator Out
Arduino AREF = Voltage regulator GND (other side)

Does that look right?

Urk... no - that is very wrong.

Try this:

24V+ = Voltage regulator In
24V- = Voltage Regulator Ground
Arduino Vin = Voltage Regulator Out
Arduino Ground = Voltage Regulator Ground

Do not connect Aref to anything unless you are using an external voltage reference source.

Oh that totally fixed it.
Now that I've looked it up that pin totally did not do what I thought it did.
No wonder it stopped working when I hooked it up to a 9V regulator. Oops.
Thank you.

So, if I were to use a switching regulator, what voltage should I use? I'm assuming something between 6-12V.
I'm not sure how to figure out the optimum amount.

If you just get a car USB charger (5V) you can just plug it straight in to the USB socket on the Arduino, or connect it direct to the 5V pin on the Arduino's header. That is the most efficient way as it doesn't use the linear on-board regulator.

Otherwise yes, something between about 7 and 12 volts - the closer to 7 the better.

I would go with the USB charger but I want it to be charged from the device it's plugged into... I'll look into switching regulators.
Thanks again.

The buck mode (step down) regulators sold on Ebay typically will accept ~30 Vin and output the voltage set by the adjust pot on the switcher board. The Adjust pot is usually a 10 turn Bournes 3296 type pot and will adjust the output voltage between 1.2V to about 1 - 2V volts below the input voltage, typically @ 1 - 2 A output current. Because of the efficiency they are to be preferred for most projects as with a switcher the wasted POWER is the load POWER X the efficiency. For example @ 24Vin and a load of 5V @ 1A, the load power is 5 watts X 1.02 (1 - 98% = .02 + 1) or 5.1 watts power in. or 5.1/24 or 0.2125 A power supply current @ 24Vdc into the switcher.

Doc

Quote from: majenko on Today at 09:26:18 AM
A linear regulator dropping from 24V to 5V is going to dissipate a huge amount of power. Very wasteful.

....
24-5 = 19V drop. Typical 50mA consumption of the Arduino.

P=VI = 19 * 0.05 = 0.95w dissipated, 0.25w used. That's a huge waste - about 20% efficiency.
....

I'd rather focus on getting it working and then worry about efficiency.

Actually, in this case, wasting 0.95W in the voltage regulator is probably not
even gonna be noticeable, given you're controlling lights/whatnot.

Of MUCH greater concern is how hot the dinky little smt voltage regulator on the
Arduino board is getting. 1W is already a lot, and if you start drawing load current
off the v.reg, lighting Leds/etc, it can easily go to 2-3W, which is way too much.
You probably shouldn't be dropping more than 3-4V max across the v.reg, in
general.

oric_dan(333):
Actually, in this case, wasting 0.95W in the voltage regulator is probably not
even gonna be noticeable, given you're controlling lights/whatnot.

Of MUCH greater concern is how hot the dinky little smt voltage regulator on the
Arduino board is getting. 1W is already a lot, and if you start drawing load current
off the v.reg, lighting Leds/etc, it can easily go to 2-3W, which is way too much.
You probably shouldn't be dropping more than 3-4V max across the v.reg, in
general.

I specifically bought these two regulators that can handle up to 35V in the hope that they could handle all that voltage:
http://www.digikey.com/product-detail/en/KA7805ETU
http://www.digikey.com/product-detail/en/LM7809CT

Would it help if I attached a big piece of metal to the voltage regulator to act as a heat sink?
How would I figured out the right way to dissipate the heat?

Would it help if I attached a big piece of metal to the voltage regulator to act as a heat sink?
How would I figured out the right way to dissipate the heat?

Probably, not. Those are just garden variety linear regulators that the other guys were
warning against. You probably need to do something better.

They can handle 35V and handle 1A, but not at the same time. The other factor is
power dissipation like I was talking about. The spec says 65 degC/W, So, just 1W
drives the temp from 25degC up to 90degC, which is almost boiling water temperature.
That's hot.

IOW, with input = 35V, it only takes I = Pd/V = 1W / (35V-5V) = just 33mA to produce
1W. You'll get a little farther using a heatsink, but not all that far. Like I said, in
actual practice you cannot put more than a few volts across such devices before
they start getting pretty darn warm.

It would make sense to get a 5v switching power supply instead of a 7-9v one, just feed the 5v to the 5v pin and save the wasted 2v on the arduino regulator

oric_dan(333):
Actually, in this case, wasting 0.95W in the voltage regulator is probably not
even gonna be noticeable, given you're controlling lights/whatnot.

Of MUCH greater concern is how hot the dinky little smt voltage regulator on the
Arduino board is getting. 1W is already a lot, and if you start drawing load current
off the v.reg, lighting Leds/etc, it can easily go to 2-3W, which is way too much.
You probably shouldn't be dropping more than 3-4V max across the v.reg, in
general.

I went back and read this and I don't get it.
What is it that makes it jump from 1W to 2-3W?
If some part of the circuit starts drawing more power, are you saying that the current increases everywhere in the system?

jfenwick:

oric_dan(333):
Actually, in this case, wasting 0.95W in the voltage regulator is probably not
even gonna be noticeable, given you're controlling lights/whatnot.

Of MUCH greater concern is how hot the dinky little smt voltage regulator on the
Arduino board is getting. 1W is already a lot, and if you start drawing load current
off the v.reg, lighting Leds/etc, it can easily go to 2-3W, which is way too much.
You probably shouldn't be dropping more than 3-4V max across the v.reg, in
general.

I went back and read this and I don't get it.
What is it that makes it jump from 1W to 2-3W?
If some part of the circuit starts drawing more power, are you saying that the current increases everywhere in the system?

I was puzzled by that statement too. The power would only increase in that regulator if you were running it from a high voltage and connecting loads of lights and things direct to the Arduino 5V.

if you start drawing load current
off the v.reg, lighting Leds/etc, it can easily go to 2-3W, which is way too much.
You probably shouldn't be dropping more than 3-4V max across the v.reg, in
general.

I went back and read this and I don't get it.
What is it that makes it jump from 1W to 2-3W?
If some part of the circuit starts drawing more power, are you saying that the current increases everywhere in the system?

I was puzzled by that statement too. The power would only increase in that regulator if you were running it from a high voltage and connecting loads of lights and things direct to the Arduino 5V.

That's what I said. "if you start drawing load current off the v.reg, lighting Leds/etc".
You said 50mA is the basic Arduiono draw, 3 Leds might be another 50-60mA,
increasing dissipation to 2W, &etc.

It's not "increases everywhere in the system", just off the v.reg.

oric_dan(333):

if you start drawing load current
off the v.reg, lighting Leds/etc, it can easily go to 2-3W, which is way too much.
You probably shouldn't be dropping more than 3-4V max across the v.reg, in
general.

I went back and read this and I don't get it.
What is it that makes it jump from 1W to 2-3W?
If some part of the circuit starts drawing more power, are you saying that the current increases everywhere in the system?

I was puzzled by that statement too. The power would only increase in that regulator if you were running it from a high voltage and connecting loads of lights and things direct to the Arduino 5V.

That's what I said. "if you start drawing load current off the v.reg, lighting Leds/etc".
You said 50mA is the basic Arduiono draw, 3 Leds might be another 50-60mA,
increasing dissipation to 2W, &etc.

It's not "increases everywhere in the system", just off the v.reg.

I'm not connecting any load directly to the Arduino other than a transceiver that sends DMX, but that draws hardly anything at all, so I think it should be OK.

A linear regulator acts in many ways like a resistor - it adjusts the resistance (dynamically) across its terminals to maintain 5V across the outputs. The regulator looks like resistance with a voltage across it, E=IR is Ohms Law. R of the Regulator = (Supply V - OutputV)/ load current (R= E/I) (Basic Algebra). The Power Law is P=IE or by substtution P=E/R *E or P=E^2/R so the power disipated by the linear regulator = (Supply V - OutputV)^2/Load Current. Thge higher teh Supply voltage tothe regulator, the more power is disipated as heat in the regulator.

I'm not connecting any load directly to the Arduino other than a transceiver that sends DMX, but that draws hardly anything at all, so I think it should be OK.

What I said applies in general to every linear v.reg in the system, if you
power them from 35V.

The tiny smt Arduino v.reg will be dissipating 1W with just the loads on
the bd, and will already overheat "badly". If you use a separate 7805 like
you mentioned for other loads, again you can only load it to 50-mA or so and
already you get a 65 degC temperature rise.