Maker Pro
Maker Pro

comparator as a switch to 8051

burassu

Jul 1, 2011
36
Joined
Jul 1, 2011
Messages
36
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
 

jackorocko

Apr 4, 2010
1,284
Joined
Apr 4, 2010
Messages
1,284
schematic?

The lm339 has an open collector output. This will stop you from ever reaching Vcc.
 
Last edited:

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
You could try dropping R100 to 1k, the 339 will be able to manage this and will provide stronger pull-up.
 

burassu

Jul 1, 2011
36
Joined
Jul 1, 2011
Messages
36
I have connected a 2k2 resistor and still having the same problem
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,750
Joined
Nov 17, 2011
Messages
13,750
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
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
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