Loading...
Pages: [1]   Go Down
Author Topic: Analog Pins As Power  (Read 305 times)
0 Members and 1 Guest are viewing this topic.
United States
Offline Offline
Full Member
***
Karma: 0
Posts: 103
Indubitably
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have recently run across the technique of powering analog pins like so:
Code:
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.
Logged

fuzzball27 >>-->

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 316
Posts: 35566
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

United States
Offline Offline
Full Member
***
Karma: 0
Posts: 103
Indubitably
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

fuzzball27 >>-->

Offline Offline
Edison Member
*
Karma: 23
Posts: 1381
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Don't Be Upset By The Results You Didn't Get With The Work You Didn't Do

United States
Offline Offline
Full Member
***
Karma: 0
Posts: 103
Indubitably
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

I'm looking for a software solution but thanks anyways.
Logged

fuzzball27 >>-->

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Software solution to a voltage drop?
Logged

Pete, it's a fool looks for logic in the chambers of the human heart.

United States
Offline Offline
Full Member
***
Karma: 0
Posts: 103
Indubitably
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Software solution to a voltage drop?

Good point. That's why I'm asking here.
Logged

fuzzball27 >>-->

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

-TECman-

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: March 03, 2012, 03:01:20 pm by AWOL » Logged

Pete, it's a fool looks for logic in the chambers of the human heart.

United States
Offline Offline
Full Member
***
Karma: 0
Posts: 103
Indubitably
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

That's what I'm doing now.
Logged

fuzzball27 >>-->

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 316
Posts: 35566
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

0
Offline Offline
Tesla Member
***
Karma: 73
Posts: 6631
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also the on-board 3V3 supply is decoupled - using output from a pin you wouldn't be able to use decoupling easily.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Print
 
Jump to: