Maker Pro
Maker Pro

comparator as a switch to 8051

Hi,I have designed a light sensor by using this circuit->>>>>> http://web.sunybroome.edu/~grace_t/m...ab/lm339_d.gif .

As a comparator Ic I am using the Lm339. The circuit is working perfectly but I need it to be connected with an 8051 to act as a switch.

But the only problem is that the output of the comparator when high it is giving 2.5v as an output although it is connected to a pull up resistor to 5v .

How can I switch the output to 5v so that it can be connected to the 8051??? :confused:

Tnks
 
You could try dropping R100 to 1k, the 339 will be able to manage this and will provide stronger pull-up.
 

Harald Kapp

Moderator
Moderator
Did you make sure that the port pin of the 8051 is programmed for input? If it is output and pulled low by the 8051, you don't stand a chance of ever pulling it high.

Harald
 
Try disconnecting the 8051 and see if the output goes high. Harald is probably right.
Split the problem, get one piece working at a time.
 
Top