United States
Offline
Full Member
Karma: 0
Posts: 103
Indubitably
|
 |
« on: March 03, 2012, 11:28:34 am » |
I have recently run across the technique of powering analog pins like so: 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
Brattain Member
Karma: 316
Posts: 35566
Seattle, WA USA
|
 |
« Reply #1 on: March 03, 2012, 11:31:44 am » |
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
Full Member
Karma: 0
Posts: 103
Indubitably
|
 |
« Reply #2 on: March 03, 2012, 11:36:26 am » |
I like the convenient placement of the accelerometer as in this tutorial: http://arduino.cc/en/Tutorial/ADXL3xx
|
|
|
|
|
Logged
|
fuzzball27 >>-->
|
|
|
|
Offline
Edison Member
Karma: 23
Posts: 1381
Now, More Than Ever
|
 |
« Reply #3 on: March 03, 2012, 11:41:42 am » |
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
Full Member
Karma: 0
Posts: 103
Indubitably
|
 |
« Reply #4 on: March 03, 2012, 11:57:23 am » |
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
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #5 on: March 03, 2012, 12:00:57 pm » |
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
Full Member
Karma: 0
Posts: 103
Indubitably
|
 |
« Reply #6 on: March 03, 2012, 12:05:50 pm » |
Software solution to a voltage drop?
Good point. That's why I'm asking here.
|
|
|
|
|
Logged
|
fuzzball27 >>-->
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 25
|
 |
« Reply #7 on: March 03, 2012, 12:32:40 pm » |
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
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #8 on: March 03, 2012, 01:03:09 pm » |
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
Full Member
Karma: 0
Posts: 103
Indubitably
|
 |
« Reply #9 on: March 03, 2012, 01:29:55 pm » |
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
Brattain Member
Karma: 316
Posts: 35566
Seattle, WA USA
|
 |
« Reply #10 on: March 03, 2012, 03:16:49 pm » |
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
Tesla Member
Karma: 73
Posts: 6631
Arduino rocks
|
 |
« Reply #11 on: March 03, 2012, 07:02:51 pm » |
Also the on-board 3V3 supply is decoupled - using output from a pin you wouldn't be able to use decoupling easily.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #12 on: March 03, 2012, 08:09:06 pm » |
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
|
|
|
|
|
|