Op-amp constant current sink
Build it step by step
0 of 7 doneWire the reference
Fit the three 100 kΩ resistors above the pot and set the pot to its lowest end.
Wire the op-amp and MOSFET
Follow the table, with the sense resistor from source to ground.
Power up
The LED should be off with the pot at zero.
Raise the pot
The LED brightens and the meter shows the current, about Vref divided by 10.
Change the load
Replace the LED with a 220 Ω resistor and then a 100 Ω resistor and note the current stays the same.
Measure the sense voltage
With a meter across the 10 Ω resistor, check it matches the pot voltage.
Find the limit
Note that at a very high resistance the current falls because the supply cannot supply the load voltage.
How do you build an op-amp constant current sink?
An op-amp and MOSFET hold a set current through a load, the basis of electronic loads and LED drivers. You need LM358 Op-Amp, MOSFET IRLZ44N, Resistor 10 Ω, Potentiometer 10 kΩ, Resistor 100 kΩ × 3, LED 5 mm red, Resistor 220 Ω, Resistor 100 Ω × 2, Digital multimeter, 5 V 2 A USB adapter, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 7 steps and about 90 minutes.
- Level
- Intermediate
- Time
- About 90 min
- Parts
- 12
Parts list
- Integrated CircuitsBuyLM358 Op-Amp × 1
- SemiconductorsBuyMOSFET IRLZ44N × 1
- PassivesBuyResistor 10 Ω × 1
- PassivesBuy
- PassivesBuyResistor 100 kΩ × 3
- SemiconductorsBuyLED 5 mm red × 1
- PassivesBuyResistor 220 Ω × 1
- PassivesBuyResistor 100 Ω × 2
- Tools & InstrumentsBuy
- PowerBuy
- PrototypingBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| 5 V supply + | + rail | Supply from a regulated 5 V adapter |
| 5 V supply - | - rail | Ground |
| LM358 pin 8 | + rail | Power |
| LM358 pin 4 | - rail | Ground |
| Three 100 kΩ resistors in series | + rail and potentiometer top | Reference top, about 300 kΩ |
| Potentiometer bottom | - rail | Reference bottom |
| Potentiometer wiper | LM358 pin 3 (IN+A) | Reference voltage, 0 to about 0.16 V |
| LM358 pin 1 (OUT-A) | 100 Ω resistor then IRLZ44N gate | Gate drive, resistor helps stability |
| IRLZ44N source | 10 Ω resistor then - rail | Current sense resistor |
| IRLZ44N source | LM358 pin 2 (IN-A) | Feedback from the sense resistor |
| Load (red LED, anode to + rail) | + rail and IRLZ44N drain | LED cathode to the drain, no series resistor needed |
| Multimeter in mA range | Between the LED cathode and the drain, for the first test | Read the current |
No code needed
No code. The op-amp drives the gate until the voltage across the 10 Ω sense resistor equals the reference at pin 3, so the current is I = Vref ÷ 10 Ω whatever the load, as long as the supply can provide the load voltage. The reference runs from 0 to about 0.16 V so the maximum current is about 16 mA, safe for a red LED with no series resistor. Check the pot is at its lowest setting before the first power-up and raise it slowly. Do not use a mains-powered load. Because the current is only set by the loop, an LED without any resistor is safe here; it would not be safe if the loop failed, so keep the current low.
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Pot at the lowest end | Current near zero |
| Pot at the top end | About 16 mA |
| LED, 220 Ω and 100 Ω loads at the same pot setting | Current within a few percent |
| Sense resistor voltage | Matches the pin 3 voltage |
If it does not work
Current too high or unstable
Add the gate resistor and keep leads short; check pin 2 goes to the source side of the 10 Ω.
LED does not light
Check the LED direction and the drain wiring.
Current is zero
Check the reference reaches pin 3.
MOSFET warms
Lower the current; it should be barely warm at this setting.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the op-amp constant current sink?
LM358 Op-Amp, MOSFET IRLZ44N, Resistor 10 Ω, Potentiometer 10 kΩ, Resistor 100 kΩ × 3, LED 5 mm red, Resistor 220 Ω, Resistor 100 Ω × 2, Digital multimeter, 5 V 2 A USB adapter, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).
How long does the op-amp constant current sink take to build?
About 90 minutes for a intermediate maker, in 7 steps.
How do I know the op-amp constant current sink works?
Pot at the lowest end: Current near zero. Pot at the top end: About 16 mA. LED, 220 Ω and 100 Ω loads at the same pot setting: Current within a few percent.
Current too high or unstable: what should I check?
Add the gate resistor and keep leads short; check pin 2 goes to the source side of the 10 Ω.
LED does not light: what should I check?
Check the LED direction and the drain wiring.
Current is zero: what should I check?
Check the reference reaches pin 3.
MOSFET warms: what should I check?
Lower the current; it should be barely warm at this setting.
