Sonsivri

Electronics => General Electronics => Topic started by: andy911 on April 06, 2006, 04:06:45 04:06



Title: Need help for interfacing 5V analog input with 3.3V system
Post by: andy911 on April 06, 2006, 04:06:45 04:06
Dear all,
 This is my first time post. 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, the input signal range could be 0-3.3V or 0-5V.  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.  Any design hints is appreciate sir.

Thank you for any comment

Andy


Title: Need help for interfacing 5V analog input with 3.3V system
Post by: ramesh_rahu on April 06, 2006, 06:58:30 06:58
hi
i think ur ADC ref voltage (ext pin Vref)can be set to 5 v so the ADC will measure from 0-5v but the system will be running on 3.3v .dont forget to configure that pin to the ADC ref voltage ....
Hope this helps. :)
Ramesh


Title: Need help for interfacing 5V analog input with 3.3V system
Post by: evc on April 06, 2006, 07:38:17 07:38
It would not work! Due to build-in diodes on every I/O pin, if you put +5V on Vref pin, the microprocessor will work on 5V! Btw this is written in the datasheet too. The voltage applyed on Vref pin can NOT be higher than Vdd+0,6V!
I think in this case, you can use a simple divider network with two resistors. It depends on    ADC speed you want to achieve.


Title: Need help for interfacing 5V analog input with 3.3V system
Post by: picstudent on April 06, 2006, 04:32:35 16:32
or use an opamp to rescale your max voltage


Title: Thank for all help
Post by: andy911 on April 07, 2006, 05:38:40 17:38
Thank you for all help sir. I'm thinking about having voltage divider to scale the voltage down . At first I thought I need 2 resistors to scale down; R1 could be anything and R2 = 25K , but I completely have no idea about the issue of resistor selection respect to the speed to ADC. Actually my design need to take 3 inputs from accelerometer sensor (0- 3.3V) and 3 inputs from gyro sensor(0-5V). The sampling frequency for both of them are limited to 1KHz only. From nyquiest theory, this should be good enough to measure my mechanical system having dynamic less than 100 Hz.  Thank for any helps again sir.

Andy


Title: Need help for interfacing 5V analog input with 3.3V system
Post by: evc on April 10, 2006, 10:36:11 10:36
In Microchip's datasheet they said "The maximum recommended impedance for analog sources is 2.5 kΩ". So, the value of your divider's resistor can NOT be more than 2,5k. In this case upper resistor must be ~1,29k. Best solution is between the divider and the ADC input to implement an OpAmp based buffer. But i want to suggest you to reverse the problem. Why don't you power up your device with 5V? You can power up only accelerometer sensor with +3,3V, and this way to achieve 675 significant ADC stages from it. If this is acceptable accuracy for you, i think would be better and easier!


Title: Need help for interfacing 5V analog input with 3.3V system
Post by: andy911 on April 10, 2006, 07:13:32 19:13
Dear Mr. evc,
 Thank for help sir. I myself now end up having to use 3.3V to power system due to my wireless module(TRW-24G). This module require 3.3V and 3.3V data interface. Therefore, I think i need to have 3.3V at my processor side as well. I don't know much about having to interface different voltage with external device concurrently sir.
I appreicate your help sir

Andy:)


Title: Need help for interfacing 5V analog input with 3.3V system
Post by: lillbear on May 11, 2006, 06:38:12 18:38
Humm maybe this will help u :)


Title: Re: Need help for interfacing 5V analog input with 3.3V system
Post by: lucicop on September 28, 2007, 12:06:50 12:06
You can have a translator between your micro at 5V and your RF module at 3.3V. 74LVC4245A will do that.


Title: Re: Need help for interfacing 5V analog input with 3.3V system
Post by: Trishool on October 28, 2007, 02:47:44 14:47
Your analog signal os varying from 0-5V  and you want to scale it down to 0-3.3V , this is what I understand from yor post. Its simple , just use a potential divider nothing else is needed , usually ADC input pins are sensitive enough to sink small amount of currents , I dont feel you use any OPAMP for this we do this on 8051 and never used OPAMPS , just a potential divider .

Hope this helps

Trishool


Title: Re: Need help for interfacing 5V analog input with 3.3V system
Post by: frasenci on October 28, 2007, 06:19:26 18:19
Another interesting source

Code:
http://cq.cx/interface.pl

greetings


Title: Re: Need help for interfacing 5V analog input with 3.3V system
Post by: twonuts on November 01, 2007, 02:04:12 14:04
Dear Mr. evc,
 Thank for help sir. I myself now end up having to use 3.3V to power system due to my wireless module(TRW-24G). This module require 3.3V and 3.3V data interface. Therefore, I think i need to have 3.3V at my processor side as well. I don't know much about having to interface different voltage with external device concurrently sir.
I appreicate your help sir

Andy:)

You may be able to do this simply by putting a high value resistor, >10K, in series with your data line to the RF module. This limits the current into the RF unit on the data lines and allows use of TTL at 5V to drive the data input on the RF unit.

Check some of the FM transmitter datasheets on RF Solutions web site, English company


Title: Re: Need help for interfacing 5V analog input with 3.3V system
Post by: localcrack on November 18, 2007, 07:14:42 19:14
You may use Simple resistor devider

______ Voltage Input
|
/
\  R1
/
|____ To ADC Pin
|
/
\  R2
/
\
|
---Gnd


Title: Re: Need help for interfacing 5V analog input with 3.3V system
Post by: titi on November 19, 2007, 07:11:56 19:11
Hello,

 As tell localcrack, the resistor devider is the simpless way.

The first thing is to fixe R1 by exemple 1000 Ohms.

The current in resistors is I=5v/(R1+R2) but the current in resistors is also I=3.3v/R2
so 5/(R1+R2)=3.3/R2

if you develop the calculus R2=(3.3*R1)/(5-3.3)
With R1=1000 -> R2=1941 Ohm

You can make a 1941 Ohm resistor with 4700 et 3300 in parallele with a precision of 0.116 %

So the drawing become :

______ Voltage Input
|
/
\  R1=1k
/
|_________ To ADC Pin
|         |
/         /
\         \
/ 4.7k   / 3.3k
\         \
|         |  R2 Equiv=1941
|         |
------------------Gnd

The datasheet say no more 2.5k from ADC Input and the source, 1k is a good value.

Bye