Pages: [1]   Go Down
Author Topic: Voltage regulation of 1.23V  (Read 1440 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 1
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Everyone

How should i get a 1.23V Vref for my LPY5150AL gyro?
I am using the Arduino-Uno

Regds
Sam

Logged

Offline Offline
Edison Member
*
Karma: 3
Posts: 1001
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

LPY5150AL has an internal 1.23V reference. This is available externally on the vref output pin from the chip so this is not something you supply.

When used with an Arduino, you can power the chip with 3.3V. Use 3.3V as external analog reference for the Arduino and read vref and gyro oututs from the chip. The analog value obtained from vref should be subtracted from the analog values read from the gyro outputs as this is your zero (no rotation) reference.
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Ben, so in other words, vref is an output of the gyro, that is connected to any analog input pin on the  Arduino
If i understand you correctly, i must connect 3.3V to AREF?
But is this necessary as the 3.3V itself is obtained from the Arduino Uno pin?

Should the code be as follows
analogReference(EXTERNAL);//AREF connected to 3.3V
const int zpin = A1;
const int xpin = A2;
const int analog_ref=A0;//Is connected to VREF on gyro
int wx = (analogRead(xpin)-analogRead(analog_ref));
//But how do i map wx to deg/sec?
The documentation for analogRead says that it maps, input voltage from 0-5 to 0-1023? But is my range 0-3.3?
I think the  datasheet for the gyro mentions 1deg/sec maps to 1/1500 Volts

Thanks
Sam





Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The documentation for analogRead says that it maps, input voltage from 0-5 to 0-1023? But is my range 0-3.3?
I think the  datasheet for the gyro mentions 1deg/sec maps to 1/1500 Volts

0-5vdc for 0-1023 counts is the default range for arduino analogRead statements. However if you change the reference to EXTERNAL and wire a 3.3vdc voltage to the Aref pin your analog Read range will become 0-3.3vdc = 0-1023 counts.


http://arduino.cc/en/Reference/AnalogReference

Lefty
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 637
Posts: 34579
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The documentation for analogRead says that it maps, input voltage from 0-5 to 0-1023? But is my range 0-3.3?
If your arduino runs off 3v3 then it maps, input voltage from 0-3.3 to 0-1023.
Or if you connect any voltage to the Aref (and switch to it in software) then it maps, input voltage from 0-Aref voltage to 0-1023?

Note Aref must always be below the chip's supply voltage.
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So is the code fragment that i posted correct?
How do i go from a count of 0-1023 to units like deg/sec?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 637
Posts: 34579
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to first convert the raw analogue read value to a voltage, and then convert the voltage to a temperature reading. Don't forget to use floating point values or you will get odd results. Then you need to record the temperature at some fixed time interval to work out the degrees / second figure you want.

Need more information about your project to be more precise.
Logged

Offline Offline
Edison Member
*
Karma: 3
Posts: 1001
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So is the code fragment that i posted correct?
How do i go from a count of 0-1023 to units like deg/sec?
It looks about right.

You need to work out the ratio of degrees to voltage from the gyro datasheet. Your readings (with a 3.3V external reference) would be V = (Ax - Vref) * 3.3 / 1024 and then you multiply this with the degree to voltage ratio to get what you ask for.
Logged

0
Offline Offline
Shannon Member
****
Karma: 216
Posts: 12525
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you also connect the Vref from the sensor to another analog input pin you can read the voltage reference and calibrate the other readings from it.  Then you don't need to calibrate for the individual 3V3 supply on the Arduino (which is not high accuracy).
Logged

[ I won't respond to messages, use the forum please ]

Pages: [1]   Go Up
Jump to: