I am trying to build a line-following robot with the schematics I found below. I understood that the comparator is used as the logic for the robot and there is no need for a feedback loop for the comparator in the circuit.

Thus, what is the use of R3 and R4(marked with orange arrow) in the circuit?

enter image description here

Disclaimer: I am a beginner and just started learning electronics. Kindly excuse any comments/questions that doesn't make sense to you. They were written/asked based on the brief knowledge that I have acquired along the way, and asking the community here is part of acquiring more of such knowledge. Thank you for your kind advice.


The LM393 output can only be either pull the output to ground, or open circuit. If the output would be open circuit, then the base of Q1 and Q2 would be floating. R3 and R4 pull the bases of Q1 and Q2 to the supply rail when the LM393 float their output so that the bases are not floating.

  • \$\begingroup\$ Hah!! I never thought of this. Let me digest it further. Thanks for this! \$\endgroup\$ – Jack Oat Jun 5 at 12:59
  • \$\begingroup\$ Since there is a control loop there must be feedback. The feedback is done optically. Have a look at D1 and R13 as well as D2 and R14. \$\endgroup\$ – stowoda Jun 5 at 13:00
  • 2
    \$\begingroup\$ R9 and R1^ are a bit small for the pull direct to ground state, but maybe the low battery voltage mitigates. Just don;t use this circuit with a higher voltage without doing something about that. \$\endgroup\$ – Neil_UK Jun 5 at 13:00
  • \$\begingroup\$ @scorpdaddy Q1 and Q2 are PNP transistors where the base requires a negative voltage for the load to be turned on. In the event where "R3 and R4 pull the bases of Q1 and Q2 to the supply rail", a positive voltage is supplied to the transistors, thus I assume the load would still not turn on. Therefore, is it correct to say that the end result of having R3 and R4 is as good as the LM393 output being an open circuit, where the base of Q1 and Q2 would be floating? \$\endgroup\$ – Jack Oat Jun 25 at 1:56
  • 1
    \$\begingroup\$ There are a zillion questions posted to this site from people that have not used pullup or biasing resistors asking why their circuit is picking up so many stray pulses. If you leave out these resistors then you may become one of them. \$\endgroup\$ – scorpdaddy Jun 25 at 12:20

The lm393 output pulls low, but does not have any transistor inside of it to pull high. Instead, to use it, you have to provide some external way to make the output go up. The resistors you show pull the bases of the output transistors high when the lm393 output is not in a low state. This insures the base-emitter junction of the transistors is reversed biased. When the 393 is low, the transistors are turned on by pulling current out of their bases through the 10k resistors.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.