Requesting a quick help pls :)

Thread Starter

Uridan

Joined Jun 11, 2009
11
Hi

I am new here and I have a wired problem that I need to solve.

I have a pressure and a humidity sensor that give a voltage output analogue range from 4.7V - 0V.

I am using an AT89C51 micro controller and the ADC input accepts a voltage with the a range of 2.55V - 0V (FF - 00).

When I connect the sensor's Vref pin with the ADC, the voltage at the ADC port will be the voltage of the Vref of the sensor. Now since the 89C51 accepts not more then 2.55V for conversion, I must reduce that 4.7V to 2.55V or less.

I did a voltage division to reduce the 4.7V to 2.0V but when I connect that 2V with the ADC, the ADC will give 5V wrt ground ignoring the 2V and will give wrong readings (obviously).

This is really confusing me and I cant seem to find any solution for it since I dont know what I am doing wrong.

How can I convert the 4.7V of the sensor to digital when the ADC is accepts only a max of 2.55V.

Any help would be greatly appreciated right now.

Thanks
Regards
Ed
 

Thread Starter

Uridan

Joined Jun 11, 2009
11
Hi Bertus,

This is the way I am connecting both sensors. From the Vref of each sensor I am doing a voltage divider by using two resistors in series between the Vref of the sensor and ground.

The ADC is connected between the two resistors.

The resisitors used are 98K each that gives a ration of 0.5 difference.

Ed
 

Attachments

bertus

Joined Apr 5, 2008
20,776
Hello,

What ADC do you use in combination with the controller?
What are the types of sensor you are using (datasheet) ?
The schematic is not very clear, as it shown not the connection to the ADC itself.

Greetings,
Bertus
 

Thread Starter

Uridan

Joined Jun 11, 2009
11
The 89C51 has an internal 10Bit ADC, and uses an 8 channels in total (Port 1). So i am connecting the voltage from between the resistors to P1.X depending on the channel programmed. In this case Pins P1.2 and P1.3 are used from the Microcontroller.

The sensors used are the HIH-4000 and the MPX5100, datasheet provided.
 

Attachments

bertus

Joined Apr 5, 2008
20,776
Hello,

The main problem with the sensors is that they can not give much current.
Use a buffer amplifier afther each sensor then the resistor voltage divider (two equal resistors). to the ADC input.

Greetings,
Bertus
 

Thread Starter

Uridan

Joined Jun 11, 2009
11
Hmm, thought so.

Can you provide some examples with the buffer amplifier??

Do I have to use the LM358 or can I apply a single transistor such as the 2N3904?

Thanks
Ed
 

Thread Starter

Uridan

Joined Jun 11, 2009
11
Thanks bertus for all the help.

Last question. I am not familiar with op amps, can you provide me with a good quiality op amp name. Is the LM358 good for such applications? since its adual operational op amp I can connect both sensors with just one LM358 right ?

Thanks

Ed
 

Thread Starter

Uridan

Joined Jun 11, 2009
11
I just tried it with an op amp and still the Voltage at the ADC input is remaining 5V... I don't know what is wrong anymore.
 

RiJoRI

Joined Aug 15, 2007
536
I don't know what is wrong anymore.
I'd start by replacing the sensor with a pot, and test the op-amp/Vdiv circuit. Set the pot output to 0, 1, 2, 3, and 4 volts, and see if the circuit gives you approximately 0, 0.5, 1, 1.5, and 2 volts. (BTW, how are you testing your sensors?)

Once I was happy with the divider circuit, I'd connect the output to the micro, run the same test, and see what the micro produces.

I'd then verify the outputs of the sensors, then try connecting everything together.

--Rich
 

THE_RB

Joined Feb 11, 2008
5,438
Have you configured the microcontroller to make that pin into an output? That might explain why is it forcing the pin to +5v.
 
Top