View previous topic :: View next topic |
Author |
Message |
andy_o Guest
|
Need help for interfacing 5V analog input with 3.3V system |
Posted: Wed Apr 05, 2006 9:22 pm |
|
|
Dear all,
I need some help on the interfacing issue. Currently I have my working 3.3V PIC18F458 microcontroller system. Now I need to take input signal into ADC channel. However, I need to attach multiple sensors in which the input signal range could be 0-3.3V or 0-5V. For example, I have gyro sensor that output 0-5V and accerelometer that output 0-3.3V only. I knew that I could actually scale the input down to 0-3.3V range using some op-amp but I 'm looking for alternative way for that. I appreciate any design hints sir.
Thank you for any comment
Andy |
|
|
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
Posted: Wed Apr 05, 2006 9:36 pm |
|
|
You could use a resistive divider to scale down your analog voltages from 5V to 3.3V. But keep in mind that the lower resistor of the divider shouldn't exceed 2.5k.
As an alternative, you can look at your analog signals and see if you actually need the whole 0-5V swing. For example, basing on the physics of your platform you can make an estimation for the absolute maximum possible angular rate. If it will produce the analog signal less then 3.3V, you can wire your gyro directly to the ADC. To protect the ADC from accidental voltages above 3.3V, add a clamping diode to +3.3V rail. |
|
|
rberek
Joined: 10 Jan 2005 Posts: 207 Location: Ottawa, Canada
|
|
Posted: Wed Apr 05, 2006 9:53 pm |
|
|
Or, if you want to get fancy, you could use something like a MAX1202, which is an 8-channel 12-bit serial ADC with a built-in level shifter.
You could hook your 5V sensors into it, have it do the conversion rather than the PIC, and the PIC can read each channel using the SPI interface, with the level shifter in the 1202 making sure the SPI signals are 3.3V.
Something to think about.
r.b. |
|
|
Dave Mac Guest
|
|
Posted: Fri Apr 07, 2006 10:22 am |
|
|
kender wrote: | You could use a resistive divider to scale down your analog voltages from 5V to 3.3V. But keep in mind that the lower resistor of the divider shouldn't exceed 2.5k.
|
Just curious - why should the resistor not exceed 2.5k? |
|
|
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
output impedance |
Posted: Fri Apr 07, 2006 11:16 am |
|
|
Dave Mac wrote: | kender wrote: | You could use a resistive divider to scale down your analog voltages from 5V to 3.3V. But keep in mind that the lower resistor of the divider shouldn't exceed 2.5k.
|
Just curious - why should the resistor not exceed 2.5k? |
Because this resistor is in parallel with the ADC's input impedance. A large resistor will cause a distortion of the ADC reading. The max value of 2.5k is mentioned in the datasheet. |
|
|
|