Show Posts
|
|
Pages: [1] 2
|
|
3
|
Using Arduino / Sensors / Problem with Polulu 3-Axis Accelerometer (MMA7341L)
|
on: May 09, 2013, 06:36:28 pm
|
|
I am using the analog pins on my arduino, and have the 3v3 regulator from the accelerometer connected to the aref pin and have set the analog reference to external. I am using the fact that according to the polulu site and the datasheet there is 440mV per g in 3g mode which is what it is set to by default and what i have left it at. I have also measured the 3v3 voltage regulator on the accelerometer with all the outputs connected and measured exactly 3.291V. So in my code I have the calculations go like this: (analogRead() - 511.5) / ((0.44 / 3.291) * 1023)). 0.44 being volts per g, 3.291 being reference voltage and 1023 being the resolution of the ADC. I have the -511.5 because the 0g output voltage is centered between ground (0V) and aref (3.291). This gives me values of -0.02g for y, 0.13g for x and 0.83g for z. This is while the accelerometer is very close to being perfectly flat. Am i doing something wrong or is there something wrong with my accelerometer? Ask me if i left anything out.
|
|
|
|
|
5
|
Using Arduino / Project Guidance / Powering Arduino on 5.5V via USB
|
on: January 11, 2013, 03:47:11 pm
|
|
The ESCs I am using for my quad copter have a 5.5V regulator on them for all the electronics. 5.5V is out of spec (10%) from the USB standard (5%) and I was wondering if it would work, or if it is too much. I can use diodes or something to drop it down if necessary.
|
|
|
|
|
13
|
Using Arduino / General Electronics / Measuring Voltage of Small Lithium Polymer battery, analog errors?
|
on: April 06, 2012, 09:20:17 pm
|
So I have a small single cell lithium-polymer battery (3.7 volts nominal) and I am trying to read the voltage level via analog in. measured with my multimeter (10Mohm input impedance) I find the voltage to be 3.8 volts. However using my arduino I find the voltage to be a tad over 4 volts. I am hoping it is the code I am using and not the arduino. The battery is 70mAH. My Code: long batReading = 0; long numReadings = 0; long previousMillis = 0; long interval = 200;
void setup() { Serial.begin(9600); } void loop() { unsigned long currentMillis = millis(); batReading = batReading + analogRead(0); numReadings = numReadings + 1; if(currentMillis - previousMillis > interval) { previousMillis = currentMillis; double batVolts = 0.0; batVolts = batReading / numReadings / 1024.0 * 5.0; Serial.println(batVolts); batReading = 0; numReadings = 0; } }
|
|
|
|
|