Connect with us

comparator as a switch to 8051

Discussion in 'Microcontrollers, Programming and IoT' started by burassu, Feb 26, 2012.

Scroll to continue with content
  1. burassu

    burassu

    36
    0
    Jul 1, 2011
    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
     
  2. jackorocko

    jackorocko

    1,284
    1
    Apr 4, 2010
    schematic?

    The lm339 has an open collector output. This will stop you from ever reaching Vcc.
     
    Last edited: Feb 26, 2012
  3. burassu

    burassu

    36
    0
    Jul 1, 2011
    Circuit

    ldr.jpg

    Do you suggest any other comparator?
     
  4. duke37

    duke37

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

    burassu

    36
    0
    Jul 1, 2011
    I have connected a 2k2 resistor and still having the same problem
     
  6. Harald Kapp

    Harald Kapp Moderator Moderator

    9,488
    1,956
    Nov 17, 2011
    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
     
  7. duke37

    duke37

    5,268
    728
    Jan 9, 2011
    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.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-