Go Down

Topic: Analog Pins As Power (Read 887 times) previous topic - next topic

fuzzball27

I have recently run across the technique of powering analog pins like so:
Code: [Select]

void setup() {
  pinMode(A4, OUTPUT);
  pinMode(A5, OUTPUT);
  digitalWrite(A4, LOW);
  digitalWrite(A5, HIGH);
}


This supplies 5v through the pins. I am curious if there is a way to supply a lower voltage? I need something between 1.8v and 3.6v for my ADXL335.
fuzzball27 >>-->

PaulS

That method is using the analog pins as digital pins, and simply turning them on. The analog pins, as analog pins, are input only.

The PWM pins allow you to simulate a lower voltage, if the receiving device accepts PWM signals. The accelerometer is probably not such a device.

The Arduinos have a 3,3V regulator, and can supply 3,3V. Why are you not using that?

fuzzball27

I like the convenient placement of the accelerometer as in this tutorial: http://arduino.cc/en/Tutorial/ADXL3xx
fuzzball27 >>-->

Runaway Pancake

Two diodes in series ( = 1.6 to 2V of drop).
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

fuzzball27


Two diodes in series ( = 1.6 to 2V of drop).


I'm looking for a software solution but thanks anyways.
fuzzball27 >>-->

AWOL

Software solution to a voltage drop?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

fuzzball27


Software solution to a voltage drop?


Good point. That's why I'm asking here.
fuzzball27 >>-->

TECman


Two diodes in series ( = 1.6 to 2V of drop).


That's your best bet.  Why do you need a software solution when you could so simply fix it this way?
-TECman-

AWOL

#8
Mar 03, 2012, 07:03 pm Last Edit: Mar 03, 2012, 09:01 pm by AWOL Reason: 1
Quote
That's your best bet. Why do you need a software solution when you could so simply fix it this way?

-TECman-
No, the best bet is using the board's 3.3 V rail.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

fuzzball27


No, the best bet is using the board's 3.3 V rail.


That's what I'm doing now.
fuzzball27 >>-->

PaulS

Quote
That's what I'm doing now.

Since that is the right way to power the accelerometer, why are you looking to change it, then?

MarkT

Also the on-board 3V3 supply is decoupled - using output from a pin you wouldn't be able to use decoupling easily.
[ I won't respond to messages, use the forum please ]

00lewisd

You can create any voltage under 5V using PWM, but you might need to smooth out the square wave in case your device that your powering is fussy. You can do this with a resistor in series then a capacitor pulled to ground.

Go Up