TRANSISTOR AS A SWITCH - and producing a logical output.

Discussion in 'The Projects Forum' started by robbie_lew, Mar 1, 2007.

  1. robbie_lew

    Thread Starter New Member

    Mar 1, 2007
    Im currently working on a project to produce a white line following robot. There are three main parts, [1] the sensors [2] the pic microcontroller [3] the motors.

    +++++ Specification of the sensors
    Supply to entire circuit 6v DC
    Output measured from sensors when on white line 6.1v DC
    Output measured from sensors when on BLACK line is 2.4v DC

    The problem that i am having however is producing a logical 0 and 1 that i can compare the voltages of the inputs from the sensors too. An option that i have is to use the ADCON (ADC) on the PIC chip to convert the values of the input accordigly. On the other hand, there is the possibility of using a series of transistors to produce a 0v(zero) and a 6v(one).

    I want to use the transistor arrangement because of its simplicity compared to the ADCON on the PIC.

    If anyone is able to help i would be most grateful
  2. hgmjr

    Retired Moderator

    Jan 28, 2005
    You could use a simple comparator to do the job. Below is a link to such a circuit that you can use as a guide on implementing such a circuit.

    Voltage Comparator example circuit
  3. Papabravo


    Feb 24, 2006
    There are specific comparator parts, such as the LM393 or LM339, that operate off of a single supply and have an open collector logic output. This means it is compatible with whatever logic Vcc you're using. You can use an op amp, but it's kinda like using a circular saw as a wood chisel, or a pair of pliers to drive a nail.
  4. thingmaker3

    Retired Moderator

    May 16, 2005
    But... 9 inch electricians' pliers are designed to drive nails...

    Oh! You meant "groove joint" pliers... nevermind...

  5. robbie_lew

    Thread Starter New Member

    Mar 1, 2007
    Thank you very much for all your help guys! much appreciated!!!!

    Robbie Lew