Powering from external source?

trying to power the arduino from a device connected to USB. OTher than rigging a USB adapter how can I get it to power from this source? there's a Vin pin but I don't know what I would hook up ground to.

Any ideas?

Thanks

Vin just has to be enough to drive the regulator; ground is always ground -- also known as "common".

HTH

You don't want to wire to the Vin pin on the Arduion as it must be at least around 8.5 volts to power the Arduino on board voltage regulator correctly. USB is 5vdc only so you would wire the +5vdc from somewhere inside your external USB thingy to the Arduino 5V pin. Also wire from an Arduino gnd pin to the USB thingy's inside ground.

Lefty

Take a look at this:- http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies.html

Thank for the link Grumpy_Mike.

I guess this is newbie electronics stuff, but doesn't the 5v pin OUTPUT current? hooking a +5 to it seems weird.

Also in the link they connect a 12 vto the arduino's ground.. how high can the ground pin take?

ALSO why do they use a diode around the relay? I was actually planning on on doing something similar (send 2.3 volts though a pot controlled by the arduino's 5v)

Thanks again guys.

The diode next to the relay is there to protect the transistor from high voltage "spikes" which are generated whenever a coil (relay, solenoid, motor) is de-energised.

As for Ground, it's always connected to the negative terminal of a battery. It's also called "0V" or "earth" or "chassis". Do not connect it to +12V!

but doesn't the 5v pin OUTPUT current? hooking a +5 to it seems weird.

I don't understand that. Can you be more specific. The 5V pin outputs a voltage, if the voltage is connected to a load THAT will cause current to flow. Have a look at some of the other tutorials I have:- http://www.thebox.myzen.co.uk/Workshop/Motors_1.html

http://www.thebox.myzen.co.uk/Tutorial/Protection.html

doesn't the 5v pin OUTPUT current? hooking a +5 to it seems weird.

  • If you connect about 8VDC or more to the DC jack (which also connects to board's GND), the power goes through a protective diode, and then is applied to the main voltage regulator, and out comes a clean 5VDC. That 5VDC goes to the ATmega and to the 5VDC pin. You can draw power from there. It also powers a second voltage regulator on the FTDI chip, offering access to 3.3VDC on that pin. Whatever voltage was available after the diode will also be offered as output on the Vin pin, and you can use that power.

  • If you skip the DC jack and connect 7.5VDC or more directly into the Vin pin (and GND-to-GND), the power is applied to the main voltage regulator (no protective diode, so get your polarity right), and out comes a clean 5VDC. That 5VDC goes to the ATmega and to the 5VDC pin. You can draw power from there. It also powers a second voltage regulator on the FTDI chip, offering access to 3.3VDC on that pin.

  • If you skip the DC jack and the Vin pin, and proceed to connect a clean 5VDC or more to the 5VDC pin (and GND-to-GND), the power goes straight to the ATmega. It also powers a second voltage regulator on the FTDI chip, offering access to 3.3VDC on that pin. Nothing available on Vin.

  • If you skip the DC jack and the Vin and 5VDC pins, and proceed to connect a USB cable, that power goes straight to the ATmega. It also powers a second voltage regulator on the FTDI chip, offering access to 3.3VDC on that pin. Nothing available from the Vin pin, but the USB's 5VDC is ready for your use on the 5VDC pin.

  • On 5VDC varieties of the Arduino, there is no way to feed 3.3VDC into the board and expect anything useful to happen.

Grumpy's right, in that you're mixing voltage and current. Think of a road going up a hill. If you pour water into the road at the top of the hill (the 8VDC jack), current flows down the whole hill. If you pour water into the road at a lower point (the 5VDC pin), then the upper hill stays dry and the rest of the hill below your bucket will have current flowing. Whether it's your water or the city's water is besides the point.

ok. I wasn't mixing up current and voltag,e I guess I was mixing up conventional current and.. normal? current.

So if I have a voltmeter and I check it across two pins, say pin A and B, black on pin B and red on pin A and the voltmeter reads 5V, does that mean I connect B to arduino's gnd and A to arduino's +5?

I guess I was mixing up conventional current and.. normal? current.

Conventional current flows from positive to negative. Electron flow goes from negative to positive. But it is all still a flow, voltage is a force like pressure, current is a flow like water.

and the voltmeter reads 5V

Assuming the +ve lead of the voltmeter is on A and the negative on B then yes.

Yeah ok that's what I meant by red/black. Thanks, I just need to learn to completely ignore electron flow.

ok question.

I don't have a multimeter but I know that this thing won't pump out more than 5 v (so it's safe for my device)

I connected analog pin 5 to a pulldown 10k, then a wire to touch around. here's what I'm running.

#define IN_PIN  5
int val;
void setup() {
  Serial.begin(9600); 
}

void loop() {
  val = analogRead(IN_PIN);    // read the value from the sensor
  Serial.println(val);
  delay(200);
}

it sits at 0, and I start touching it to terminals on the controller I want to interface to. One side of the button I get a reading of ~550 which I presume is 2.5V since 5V is 1023. Other side I get 0. Does that mean if I were to connect 2.5V to the ground side of the switch it's as if I pressed the button, or do I need to take other things into consideration?

also, with a 5v source how can I bring it down to about 2.5 volts to set off this button. I am guessing I would need ot know the resistance of whatever this terminal connects to and put in an appropriate (i.e. matching) resistor so half the voltage drop is on this resister. is this correct?

Thanks

oh I guess I would use a voltage divider. It's been a while since I took a circuits class...

does this look right?

if I have 5in and want 2 out I need 2 resisters in series, 5 v to ground. then between the two I'll solder a wire for Vout, which should match the voltage drop for each resistor. I also think I want a higher resistance resistor for both to lower power consumption.