LM393 SPARE COMPARATOR

OPAMPPULL
EXAMPLE USING A 10K PULL-UP FOR HIGHER IMPEDANCE INPUTS, USING A 1K PULL-UP WILL SET IT FOR 5mA AND DIRECTLY DRIVE MORE. THE VALUE OF PULL UP DEPENDS ON THE IMPEDANCE OF THE LOAD AND GENERALLY NEEDS TO BE 1/10 MAGNITUDE LESS THEN THE INPUT IMPEDANCE OF THE CIRCUIT IT IS DRIVING, OR IT WOULD LOAD THE SOURCE VOLTAGE.

LedLabs has a dual  lm393 comparator, as one of the modules on board, and one of these is wired with a 10k potential divider already set up to accept inputs from various sources like the analogue light dependent resistors (ldr) and the output represented on a green led and a red led. there is a spare comparator for free use, which has two inputs and an output, as this is open collector a pull-up resistor is needed to get it to output something, this value of pull-up resistor should be a value around 1k to a 10k is fine for this usually.  The lm393 can sink 6mA, and upto around 15mA (see sinking sourcing page under logic gates) so from a 5v power supply the minimum value works out at about 833 ohms, based on 6mA (V=IR) so this is why a value of 1k or above  should be used. To do this, take a wire from the output pin to the bread board, then connect a resistor to the 5v rail, and where the resistor connects to the wire on the breadboard this is the output pin of the comparator.  This has been left like this so some users get to learn about open collector outputs.                                                                                         A good way for buffering one circuit to another to try and match impedances and avoid loading is to use an op amp wired as a voltage follower also known as a unity gain amplifier, which has a gain of 1, meaning what you put in, is what you get out. But has a very high input impedance, which then can take its input from a source and drive some other load, so it acts as a buffer between the two.

unity gain amp
Unity Gain Amplifier, buffer voltage follower, with very high input impedance, so does not draw much current from the circuit going in to it.