Skip to content
Level 3 · AdvancedLessonPart 14 · page 1 of 675 minScienceCraft£
75Minutes
17Sources

Low-Voltage Electronics for the Darkroom Builder

Four instruments in this course run on electricity you can put your fingers on: the sensitometer in this part, the densitometer in Part XV, the enlarger in Part XVI and the timer in Part XVII. They are the same six ideas in different arrangements — a current, a voltage, a diode that makes light, a transistor that switches it, a clock that counts, and a small computer that reads the clock. Learn them once here and none of the later parts will teach them again.

The page assumes nothing. If you have never stripped a wire, start at the top and work down; if you have, the sections you want are the LED, the switch and the timing, because those three are where photographic instruments go wrong in ways a general electronics course never mentions.

Nothing in this course is built, modified or opened at mains voltage. Everything runs from a certified USB supply or a USB power bank: five volts in, three and a third volts of logic, and the worst outcome of a wiring error is a dead component.

That is not timidity, it is HSE’s own first control. Their guidance on electrical safety says that one of the best ways of reducing the risk of injury from electrical equipment is to limit the supply voltage to the lowest needed to get the job done, offers 12, 25, 50 and 110 volts as the examples for temporary lighting, and names battery-operated tools as the safest choice where powered tools are used. It also says, without qualification, that normal mains voltage — 230 volts AC — can kill, and that the risk is greatest in wet surroundings. A darkroom is a room with trays of liquid in it, worked in the dark by someone whose hands are wet.

Mains enters this course nowhere at all. Part XVII’s timer was designed with a mains channel and lost it: its market survey of 5 September 2026 found no sealed, certified, low-voltage-triggered appliance switch sold to a hobbyist, and the rule fixed before the search began was that if no acceptable product exists the build changes rather than the safety rule. The classification rubric makes home-built mains work Level C, a level this course does not ask a reader to work at. The same rubric puts low-voltage electronics builds and high-brightness LED sources at Level B, which is where this part’s two build pages sit.

Charge is the quantity that electrical forces act on. Its unit is the coulomb.

Current is charge passing a point per second, and one ampere is one coulomb per second. It is the quantity that does the work in everything on this page: an LED’s brightness follows its current, a resistor’s heat follows the square of its current, and a wire fails when its current is too high for its cross-section.

Voltage is the energy carried per unit of charge — the push. A five-volt supply gives every coulomb five joules to spend on its way round. Voltage is always a difference between two points, which is why a circuit has a ground: not because ground is special, but because you cannot state a voltage without saying what it is measured against.

Resistance is how much voltage a component demands for a given current, and Ohm’s law is the statement that for a resistor the two are proportional:

V = I × R
Ohm's law

V is the voltage across the component in volts, I the current through it in amperes, R its resistance in ohms. Rearranged, R = V ÷ I and I = V ÷ R. The whole of the arithmetic on this page is that equation and one more:

P = V × I
Power

P is the power in watts, which is joules per second — the rate at which the component turns electrical energy into heat or light. Combining the two gives P = I²R, which is the form to remember, because it says that halving a current quarters the heating.

The LED is a diode, and that changes everything

Section titled “The LED is a diode, and that changes everything”

A resistor obeys Ohm’s law: double the voltage, double the current. An LED does nothing of the kind. It is a diode, and its current rises roughly exponentially with the voltage across it. Below its forward voltage almost nothing passes; above, the current runs away in a few tens of millivolts.

Current against forward voltage for a white LED, and the two ways to set an operating point

2.837 V2.900 V2.52.62.72.82.93.03.1020040060080010001200Forward voltage (V)Forward current (mA)350 mA, datasheet 2.84 to 3.1 V at 85 °C1000 mA, datasheet 3.12 V
  • Forward current against forward voltage, drawn shape
Show the numbers behind this plot
Forward current rises steeply and non-linearly with forward voltage. At 2.50 volts the current is about 1 milliamp; by 2.63 volts it is 10 milliamps; at 2.84 volts it is 200 milliamps; at 2.90 volts it is 350 milliamps; at 3.12 volts it is 1000 milliamps. The curve is nearly flat along the bottom and then turns sharply upward, so that the 63 millivolts between 2.837 and 2.900 volts covers the whole range from 200 to 350 milliamps. Two markers sit on the curve at the two operating points the Cree datasheet actually tabulates: 350 milliamps at about 2.9 volts, and 1000 milliamps at 3.12 volts. A vertical guide at 2.837 volts and another at 2.900 volts bracket the 63 millivolt interval that separates 200 from 350 milliamps.
SeriesForward voltage (V)Forward current (mA)
Forward current against forward voltage, drawn shape2.501.00
Forward current against forward voltage, drawn shape2.595.00
Forward current against forward voltage, drawn shape2.6310.00
Forward current against forward voltage, drawn shape2.6720.00
Forward current against forward voltage, drawn shape2.7250.00
Forward current against forward voltage, drawn shape2.77100.00
Forward current against forward voltage, drawn shape2.81150.00
Forward current against forward voltage, drawn shape2.84200.00
Forward current against forward voltage, drawn shape2.86250.00
Forward current against forward voltage, drawn shape2.88300.00
Forward current against forward voltage, drawn shape2.90350.00
Forward current against forward voltage, drawn shape2.95500.00
Forward current against forward voltage, drawn shape3.02700.00
Forward current against forward voltage, drawn shape3.121000.00
Forward current against forward voltage, drawn shape3.171200.00
The curve is drawn to teach the shape and was not measured from a device. The two marked points are the only ones the Cree XP-E2 datasheet tabulates for a white part, and the drawn curve is made to pass through them. The curve is drawn to show the shape, not measured from a real material. Your own materials will differ, and measuring them is what the sensitometry part of the course is for.

Read the two guides on that plot. Sixty-three millivolts separates 200 mA from 350 mA. That single number contains everything a builder needs to know about driving LEDs.

Why constant voltage fails, and fails progressively

Section titled “Why constant voltage fails, and fails progressively”

Suppose you set 2.900 V across the LED with a bench supply and get your 350 mA. The junction warms up. Cree tabulate the temperature coefficient of forward voltage for the XP-E2 family, and for the white parts it is −1.5 mV/°C: as the junction temperature rises, the voltage the diode needs for a given current falls. Your supply is still holding 2.900 V, so the current rises. More current means more power in the junction, which means more heat, which means a lower required voltage still, which means more current.

Divide the 63 mV by the 1.5 mV/°C and you get 42 °C. A junction that warms by forty-two degrees at constant applied voltage moves from 200 mA to 350 mA on its own. Forty-two degrees is nothing: Cree give the thermal resistance from junction to solder point as 5.8 °C/W for white and 9 °C/W for green, and that is only the first stage of a path that continues through the board, the thermal interface and the heatsink to the room. The maximum junction temperature is 150 °C. Constant-voltage drive is a positive feedback loop with a component failure at the end of it, and long before the failure the brightness has been drifting the whole time.

A series resistor is the cheap one. Put a resistor between the supply and the LED and the resistor takes up the difference: I = (V_supply − V_f) ÷ R. From a 5 V rail with V_f = 2.9 V and a target of 350 mA, R = (5 − 2.9) ÷ 0.35 = 6.0 Ω, dissipating 0.735 W as computed above.

The resistor helps because it is now in charge of the current. If V_f falls by 63 mV as the junction warms, the voltage across the resistor rises by 63 mV, and the current rises by 0.063 ÷ 6.0 = 10.5 mA — three per cent, not seventy-five. The exponential has been tamed by putting something linear in series with it. But three per cent is still three per cent, and the resistor is equally at the mercy of the supply: a 1 per cent wobble on the 5 V rail is 50 mV, which is another 8 mA, another two and a half per cent. For a torch that is invisible. For an instrument whose whole purpose is to deliver the same exposure next month, it is the dominant error.

A constant-current driver is the right one. It is a circuit that measures the current and adjusts whatever it has to — a series voltage in a linear driver, a switching duty cycle in a buck driver — to hold that current at a set value regardless of what the LED’s forward voltage or the supply does. Feed it anything in its stated input range and it delivers its set current. That is the whole reason it exists, and it is why every instrument in this course drives its LED from one.

Light out: why a heatsink is a photometric component

Section titled “Light out: why a heatsink is a photometric component”

Two relations decide how much light comes out, and neither is a straight line.

Flux against current is sub-linear. Cree’s chart for the white XP-E2 runs its current axis to 1500 mA against a flux axis drawn to 300 per cent of the 350 mA value: 4.3 times the current buys at most 3 times the light, and the shortfall is heat.

What extra current actually buys

the 350 mA reference0200400600800100012001400050100150200250300350400450Forward current (mA)Relative luminous flux (per cent of the value at 350 mA)
  • If flux were proportional to current
  • The real relation, drawn shape
Show the numbers behind this plot
Two lines from the origin against a current axis running to 1500 milliamps. The straight dashed line is what flux would do if it were proportional to current: it passes through 100 per cent at 350 milliamps and continues to about 429 per cent at 1500 milliamps. The solid curve is the real relation, which follows the straight line closely at low current, falls away from it progressively, passes through the same 100 per cent at 350 milliamps by construction, and reaches only about 298 per cent at 1500 milliamps. The vertical gap between the two lines at the right-hand edge is the light that the extra current did not produce, and it went out as heat instead. A guide line marks the 100 per cent level at which the two coincide.
SeriesForward current (mA)Relative luminous flux (per cent of the value at 350 mA)
If flux were proportional to current0.000.00
If flux were proportional to current1500.00429.00
The real relation, drawn shape0.000.00
The real relation, drawn shape50.0023.00
The real relation, drawn shape100.0039.00
The real relation, drawn shape150.0053.00
The real relation, drawn shape200.0066.00
The real relation, drawn shape250.0078.00
The real relation, drawn shape300.0089.00
The real relation, drawn shape350.00100.00
The real relation, drawn shape500.00131.00
The real relation, drawn shape700.00168.00
The real relation, drawn shape1000.00220.00
The real relation, drawn shape1200.00252.00
The real relation, drawn shape1500.00298.00
A drawn shape, not a measurement: the course reads the axes of Cree's flux-against-current chart and not its ordinates. What the axes do fix is the end point — the current axis runs to 1500 mA and the flux axis is drawn to 300 per cent — so any honest curve through the 350 mA reference must arrive below the dashed line by roughly the margin shown. The curve is drawn to show the shape, not measured from a real material. Your own materials will differ, and measuring them is what the sensitometry part of the course is for.

Running an LED at a third of its maximum current is not timidity either; it is where the device is most efficient, coolest and most stable, and stability is the only specification an instrument cares about.

Flux against junction temperature falls. The XP-E2 datasheet plots relative flux against junction temperature from 25 °C to 150 °C. This course has read the axes of that chart and has deliberately not read numbers off it, because a value taken from a printed graph is a guess wearing a decimal point. So the course asserts only the direction, and the build page measures the rest on your own device with a monitor photodiode. The point of measuring rather than quoting is that your heatsink, your board and your room are in the answer, and Cree’s chart cannot know about any of them.

That is what makes a heatsink a photometric component rather than a mechanical one. It is not there to stop the LED dying. It is there to hold the junction at a temperature that stops moving, so that the light output stops moving. An LED bolted to an aluminium star board and nothing else will still be climbing towards its final temperature — and its final brightness — several minutes after switch-on. An LED on a real heatsink gets there sooner and sits there. Either way you must find out when it stops moving and write that down as a warm-up rule, and that measurement is the reason the build page has a monitor photodiode in it at all.

Wavelength moves too. Cree publish a chart of relative chromaticity against current and temperature, which establishes that the mixture of a phosphor white LED is not a fixed thing. For an instrument exposing panchromatic film, a shifting spectrum is a shifting effective speed. The design lesson returns to this when it chooses between a white and a green emitter.

Switching: why a microcontroller pin cannot do it

Section titled “Switching: why a microcontroller pin cannot do it”

A Raspberry Pi Pico’s output pin can be told to go high. It cannot power an LED of any real size, and the datasheet says why in a passage worth reading carefully.

The RP2040’s GPIO pads have four output drive strengths, called 2, 4, 8 and 12 mA. The datasheet is explicit that these are not hard limits: the pin will attempt to drive its output to the supply rail, and the more current you draw the further the output voltage falls, until it is so low that a connected device no longer reads it as a logic one. The numbers describe how far the voltage may sag at a stated load, not a current the pin will happily supply. There is also a limit on the sum of the currents sourced and sunk across the whole IO bank.

So a pin can flash a small indicator LED at a few milliamps. Ask it for 350 mA and you get a sagging rail, a browning-out processor and, quite often, a reset in the middle of your exposure. The pin’s job is to carry a decision, not power. Something else carries the power.

The logic-level MOSFET as a low-side switch

Section titled “The logic-level MOSFET as a low-side switch”

That something is a MOSFET, wired as a low-side switch: the LED between the positive rail and the MOSFET’s drain, the MOSFET’s source at ground, and its gate driven from the microcontroller pin. Low side is the easy arrangement because the gate is referenced to the same ground the microcontroller uses.

The low-side switch, drawn as the course wires it

+5 V (USB)1CC element23DSG4330 Ω5100 kΩ6PicoGPIO150 V7
  1. +5 V from USB, and from nothing else — a certified supply or a power bank; no mains, no bench supply of unknown provenance
  2. Constant-current element — a driver module set to the chosen current, or a series resistor as the fallback
  3. LED, anode to the rail — on its star board and its heatsink; the diffuser fitted before it is ever run
  4. IRLZ44N N-channel MOSFET, low side — drain to the LED cathode, source to ground
  5. Gate resistor, 330 Ω — limits the pin current while the gate capacitance charges
  6. Gate pull-down, 100 kΩ — holds the gate low while the microcontroller is in reset, so the lamp cannot come on by itself
  7. Single ground junction — LED current and logic meet at one point, not along a shared track
The whole switch is five components. Everything that makes it an instrument rather than a torch is in the choice of the second one and in the two resistors around the gate.

A MOSFET conducts between drain and source when the gate is held above a threshold. The word to watch is logic-level: an ordinary power MOSFET expects ten volts on its gate and is barely on at three, while a logic-level part is designed to be fully on at four or five.

The IRLZ44N is the course’s reference part, and reading its datasheet honestly is more instructive than accepting it. Its gate threshold voltage, VGS(th), is given as a minimum of 1.0 V and a maximum of 2.0 V. Its on-resistance is quoted at three gate voltages: 0.022 Ω at 10 V, 0.025 Ω at 5.0 V, 0.035 Ω at 4.0 V. There is no figure at 3.3 V, which is exactly the voltage a Pico’s pin puts out.

Two conclusions follow, and both are honest. At the currents this course’s instruments use — tens to a few hundred milliamps — the under-specification costs nothing measurable: even a pessimistic 0.1 Ω at 3.3 V dissipates 0.35² × 0.1 = 12 mW, which nothing will notice. At several amperes it would matter a great deal, and then the correct move is to choose a MOSFET whose datasheet quotes an on-resistance at 3.3 V, or to drive the gate from the 5 V rail through a small driver. That is the general rule: a part is only specified where its datasheet says it is specified, and everything else is your risk to take knowingly.

The gate resistor, 330 Ω, exists because a MOSFET’s gate is a capacitor — the IRLZ44N’s input capacitance is 1700 pF — and a capacitor connected straight to a pin is a momentary short circuit. Through 330 Ω the peak pin current is 3.3 ÷ 330 = 10 mA, inside the pad’s 12 mA drive setting, and the gate charges with a time constant of 330 × 1700 pF = 0.56 µs. Against a one-second exposure that is under a part in a million, which is the honest answer to “how fast does the lamp switch”: it is limited by the gate, and the gate is fast enough to be irrelevant.

The gate pull-down, 100 kΩ from gate to ground, matters more than it looks. While the microcontroller is in reset, being reprogrammed, or unplugged with the LED supply still connected, its pin is an undriven input. An undriven gate floats, and a floating gate can switch a lamp on inside a closed box full of film. The pull-down makes “no decision” mean “off”.

The microcontroller, and how it keeps time

Section titled “The microcontroller, and how it keeps time”

A microcontroller is a whole small computer — processor, memory, program storage, clock and peripherals — on one chip, with its pins wired to the outside world instead of to a screen. It runs one program from power-up, forever, with no operating system in the way. That last property is what makes it a good timer: nothing else is competing for the processor.

The course’s reference board is the Raspberry Pi Pico. The board datasheet gives it a dual-core Cortex-M0+ at up to 133 MHz, 26 general-purpose IO pins brought out to the header and fixed at 3.3 V because they are powered from the on-board regulator, a 12-bit 500 ksps analogue-to-digital converter, 16 PWM channels and one timer with four alarms. Of the GPIO, 0 to 22 are digital only and 26 to 28 can also be ADC inputs.

Four ideas earn their names.

GPIO — general-purpose input/output. A pin your program can read as a one or a zero, or drive to one or zero. The button and the MOSFET gate are both GPIO.

PWM — pulse-width modulation. The pin is switched on and off at a fixed frequency and the fraction of each cycle it spends on is adjustable, so the average is anywhere between the two rails. It is how a microcontroller dims things. The design lesson explains why it must not be used to dim a sensitometer’s lamp during an exposure.

ADC — the analogue-to-digital converter, which turns a voltage into a number. Twelve bits means 4096 levels across the input range. It is how the monitor photodiode gets read.

Timers and the clock. Everything the chip does is counted against a crystal oscillator. The RP2040 datasheet recommends the Abracon ABM8-272-T3 at 12.000 MHz, and the Pico carries that part. Its specification is a frequency tolerance of ±30 ppm at 25 °C, a stability of ±30 ppm, and ageing of ±5 ppm in the first year.

Other boards. The Arduino Uno R3 carries an ATmega328P at up to 20 MHz with fourteen digital pins and six analogue inputs; it is a five-volt board — its IOREF pin is connected to the 5 V rail — and its ADC is 10-bit, four times coarser than the Pico’s twelve. Five-volt logic is actually convenient for driving a MOSFET gate, since 5.0 V is a voltage the IRLZ44N datasheet does specify. The ESP32 is a 3.3 V part with a 12-bit ADC of up to eighteen channels and wireless built in, which this course has no use for and which is one more thing to go wrong in a dark room. Either will run these builds with the pin numbers changed. The course standardises on the Pico so that the wiring, the parts list and the firmware are shared across Parts XIV, XV and XVII.

MicroPython, and the one thing it will not do

Section titled “MicroPython, and the one thing it will not do”

The course writes its firmware in MicroPython: Python itself, cut down to run on the chip, with a prompt over the USB cable. You edit a file, save it, and it runs. There is no compiler, no toolchain and no build step, and when something misbehaves you can type at the board and ask it.

Reading a pin, driving a pin and timing an interval look like this.

from machine import Pin, ADC
import time
lamp = Pin(15, Pin.OUT, value=0) # gate of the MOSFET, off at boot
button = Pin(14, Pin.IN, Pin.PULL_UP) # a button to ground; pressed reads 0
monitor = ADC(Pin(26)) # ADC0, the photodiode amplifier
print("button:", button.value()) # goes to the serial console
print("monitor:", monitor.read_u16()) # 0 to 65535 across 0 to 3.3 V
start = time.ticks_us() # microsecond counter, arbitrary origin
lamp.value(1)
while time.ticks_diff(time.ticks_us(), start) < 1_000_000:
pass # busy-wait: nothing else may run
lamp.value(0)
print("measured:", time.ticks_diff(time.ticks_us(), start), "us")

Three details in that fragment are worth more than the rest of the page.

read_u16 returns 0 to 65535 whatever the converter’s real resolution. The MicroPython documentation says the reading is scaled so that the minimum is 0 and the maximum 65535. On the RP2040’s 12-bit converter the bottom four bits therefore carry no new information: you get sixteen counts of apparent resolution for every real one. Averaging many readings recovers something genuine; believing the last digit of one reading does not.

ticks_us wraps around, and only ticks_diff is valid on it. The counter runs up from an arbitrary origin to a value the port does not publish and then starts again. The documentation is blunt that ordinary subtraction and comparison on these values are wrong, and that ticks_diff and ticks_add are the only operations available. Code that computes end - start works perfectly for hours and then produces a negative exposure once.

There is no hardware timer here. The machine.Timer documentation states that hardware timers may be more accurate for very fine sub-millisecond timing, and that most ports support them except Zephyr and RP2, which support only virtual timers. The RP2 quick reference says the same: the RP2040’s system timer provides a global microsecond timebase, but only the software timer is exposed, with callbacks running as soft interrupts unless hard=True is passed. A soft-interrupt callback can be delayed by garbage collection.

So the course’s exposure is a busy-wait on the microsecond counter, exactly as in the fragment above: the processor does nothing else at all between switching the lamp on and switching it off, and then it reports the interval it actually achieved rather than the one it was asked for. That is worth saying twice, because it is the opposite of ordinary programming advice. Here, a loop that burns the processor is the correct design, and a tidy timer callback is the bug.

Where C comes in, and why you do not need it. The same board can be programmed in C with Raspberry Pi’s SDK, and a C program has finer control over interrupts and a faster loop. Nothing in this course needs either. The exposures are of order a second, the crystal is 150 times better than required, and the busy-wait is bounded by the interpreter’s own loop overhead of a few tens of microseconds — which the firmware measures and prints rather than assuming. If your measured interval and your requested interval agree to a few hundred microseconds, the language is not your problem.

Build every circuit on a solderless breadboard, run it, and only then commit it to metal. A breadboarded fault takes ten seconds to fix and a soldered one takes ten minutes and a wick. The breadboard’s own limits are worth knowing: its contacts are springy metal with perhaps some tens of milliohms of resistance and a capacitance between adjacent rails, so it is poor for large currents and useless above a few megahertz. Neither matters at 350 mA and one hertz.

A temperature-controlled iron at around 350 °C, a fine chisel or conical tip, a damp sponge or brass wool, a stand the iron always goes back into, side cutters, wire strippers, tweezers and a helping hand. Lead-free solder as the default. Isopropanol and a brush for flux residue.

Tinning is the preparation: melt a little solder onto the iron’s tip so heat conducts into the joint, and onto stranded wire so it stops fraying. A good joint is made by heating the two pieces of metal and then feeding solder to them, not to the iron: the solder wets both, flows, and cools into a shiny fillet that is concave and follows the shape of the parts. A dry joint is made by melting solder on the iron and wiping it on: it sits on top as a dull grey blob with a convex outline, touching but not bonded, and it will work on the bench and fail in the box.

A good joint and a dry joint, in section

good: concave fillet, shinysolder shows on the far side1dry: convex blob, dullnothing on the far side2The outline tells you which you have3
  1. Good joint: concave fillet — solder has wetted pad and lead and flowed through the hole
  2. Dry joint: convex blob — solder rests on the surfaces without bonding to either
  3. The test is the outline — hollow curve means wetted; a rounded lump means it is not
More solder does not rescue a dry joint. Heat does: the two pieces of metal must be hot enough to melt the solder themselves.

Flux fume, burns, and the controls that actually apply

Section titled “Flux fume, burns, and the controls that actually apply”

Burns are the injury that actually happens. The iron’s tip is at about 350 °C and a freshly made joint is at solder temperature for several seconds after the iron leaves. The iron goes back in its stand every single time it is not in your hand — not on the bench, not balanced on the board. If you do burn yourself, the NHS instruction is to hold the burn under cool running water for 20 minutes, as soon as possible; remove clothing and jewellery near the area but never anything stuck to it; and cover the cooled injury by laying cling film over it rather than wrapping. The course’s first aid page carries the general guidance.

Eyes. Trimming a component lead with side cutters fires the offcut across the room at speed. Safety spectacles, and cut with the offcut trapped between your fingers.

Everything runs from USB. The Pico’s datasheet gives VBUS — the voltage on the USB connector — as 5 V ±10 per cent, and VSYS, the board’s own input, as anything from 1.8 to 5.5 V. On the board a switching regulator makes the fixed 3.3 V that the processor and every GPIO pin run from. The 3V3 pin is available to power your own circuitry and the datasheet recommends keeping that load below 300 mA.

Budget the current before you plug anything in. The Pico’s own draw is small: the datasheet’s tables give a mean of about 9 mA idle and 10 mA active in BOOTSEL mode and about 1 mA in its dormant state, described as typical figures rather than guaranteed maxima. The LED dominates everything else, and it is the number you choose. At 350 mA the total is comfortably under 400 mA; whatever supply you use, read its own rating off its label and stay well under it.

Three things this course never does, and the reasons are the same each time.

No mains. Stated above, and it is the rule that makes everything else here Level B rather than Level C.

No lithium packs, bare cells or unprotected batteries. A USB power bank is a lithium pack in a certified enclosure with its own protection circuit, and that is exactly the difference. A bare cell short-circuited by a dropped screwdriver delivers tens of amperes into a wire that becomes a heater element, in the dark, next to film.

No hacking an enlarger lamp. A darkroom enlarger is a mains appliance and its lamp circuit is at mains potential. There is a real temptation to switch one from a home-made timer; Part XVII addresses it, and after surveying the market on 5 September 2026 its answer is that no acceptable module is sold at hobby cost — so the enlarger keeps its own switch, or a bought certified timer owns the mains, and never a relay on a breadboard.

A datasheet is a long document that answers five questions per part. Find those and you have read it.

LED MOSFET ADC
1. What it needs to work Forward voltage at your current, and at temperature Gate voltage at which on-resistance is specified Supply and reference voltage
2. What you must not exceed Maximum DC forward current and maximum junction temperature Drain-source voltage, continuous drain current, gate-source voltage Absolute maximum input voltage relative to the supply
3. How hot it gets Thermal resistance junction to solder point Thermal resistance junction to case and to ambient Usually not the issue
4. What it actually does Flux against current, flux against junction temperature, spectral distribution On-resistance at your gate voltage; gate charge and input capacitance Resolution, sampling rate, and how the reference is derived
5. What it does when conditions change Temperature coefficient of forward voltage; chromaticity against current and temperature Threshold voltage against junction temperature Offset, noise and reference stability

Worked against the parts on this page: the XP-E2 white gives 2.84 to 3.1 V at 350 mA and 85 °C; 1500 mA and 150 °C as the limits; 5.8 °C/W to the solder point; the flux and spectral charts; and −1.5 mV/°C. The IRLZ44N gives 0.025 Ω at 5.0 V of gate drive and nothing at 3.3 V; 55 V, 47 A and ±16 V as limits; 62 °C/W to ambient; 1700 pF of input capacitance and 48 nC of gate charge; and a threshold between 1.0 and 2.0 V that, as above, tells you less than it appears to. The Pico’s ADC gives 3.3 V, twelve bits at 500 ksps, and — the interesting one — a reference derived from the switching regulator’s output through a 201 Ω and 2.2 µF filter, with an inherent offset of about 30 mV that varies from chip to chip. That last line is why the calibration experiment reads a grounded second channel as a zero reference rather than trusting the converter’s own zero.

A one-watt LED at 30 mm from an eye is not the same object as the same LED lighting a room.

The relevant framework is BS EN 62471, which sorts lamps and lamp systems into an exempt group and Risk Groups 1, 2 and 3 by measured optical hazard. HSE’s guidance for employers on the Artificial Optical Radiation Regulations uses those groups directly. Exempt and Risk Group 1 lamps, LEDs included, are on its list of safe sources. Risk Group 2 lamps and LED systems are on its list of sources that are safe under normal conditions of use but have the potential to cause harm if used inappropriately — its example is a source placed extremely close to the eyes. Risk Group 3 sources are on the hazardous list, alongside welding and UV curing.

Two honest consequences follow.

The course cannot classify your LED. A risk group is assigned by measurement to a lamp system, and neither Cree nor this course has measured yours in your reflector at your drive current. Where a maker publishes a risk group, use it; suppliers have a duty under section 6 of the Health and Safety at Work etc Act 1974 to provide information for safe use, so asking is reasonable. Where no group is published, the course states no group.

So the control is behavioural and it is absolute. Never look into an unshielded emitter, at any distance, at any current. Fit the diffuser before the first switch-on and leave it fitted for every bench test. Point the emitter away from your face while wiring. Treat blue-rich white and any UV part as the worst case, since the blue-light hazard is what the risk groups are largely built around, and the eye’s blink reflex is not protection against a source that is bright without being painful.

The instrument you are building solves this by construction: the LED lives in a closed light-tight box and only ever runs with the lid down. It is the bench-testing stage, before the box exists, where care is needed.

Current does the work; voltage is the push; Ohm’s law and P = I²R are the whole of the arithmetic. An LED is a diode, so its current runs away exponentially with voltage: sixty-three millivolts separates 200 mA from 350 mA on a typical white part, and its forward voltage falls 1.5 mV for every degree the junction warms, which is why constant-voltage drive is a runaway and why an instrument uses a constant-current driver. Flux is sub-linear in current and falls as the junction warms, so a heatsink is a photometric component and a warm-up rule is a measurement, not a guess. A microcontroller pin carries a decision, not power: a logic-level MOSFET on the low side carries the current, with a gate resistor to protect the pin and a pull-down so that “no decision” means “off” — and a MOSFET is only specified where its datasheet says it is. The Pico’s crystal is 150 times better than a sensitometer needs, so timing errors are always software, never the clock; on the RP2 port machine.Timer has no hardware timer behind it, so exposures are busy-waited on ticks_us and the achieved interval is reported rather than assumed. Solder fume has a real exposure limit and a sensitiser notation, and the control that matters is keeping your head out of the plume. And everything in the course runs at USB voltage, because HSE’s own first control is to use the lowest voltage that will do the job.

Check your understanding

Question 1. A white LED has a forward voltage of 2.9 V at 350 mA and is run from a 5.0 V supply through a series resistor. What resistance is needed, and what power does the resistor dissipate?
Show the answer and why

Answer: 6.0 Ω, dissipating 0.74 W

The resistor takes the difference: 5.0 − 2.9 = 2.1 V across it at 0.35 A, so R = 2.1 ÷ 0.35 = 6.0 Ω. Its power is I × V = 0.35 × 2.1 = 0.74 W, or equivalently I²R = 0.35² × 6.0. The third option uses the voltage across the resistor as though it were the power, and the fourth divides the whole supply voltage by the current, which would be right only if the LED were not there.

Question 2. The same LED is instead connected straight across a bench supply set to exactly 2.900 V, with no resistor and no driver. It starts at 350 mA. What happens over the next few minutes?
Show the answer and why

Answer: The current rises, because the forward voltage needed falls as the junction warms, and the rise heats the junction further

The white XP-E2 has a forward-voltage temperature coefficient of −1.5 mV/°C, so a warmer junction needs less voltage for the same current. At a fixed applied voltage the current therefore rises, which raises the power, which raises the temperature — positive feedback. The arithmetic of the scale is worth keeping: 63 mV covers 200 to 350 mA, and 63 ÷ 1.5 is 42 °C, so a forty-two degree junction rise alone moves the operating point across that whole range.

Question 3. You are choosing a MOSFET to switch 350 mA from a Pico GPIO pin. Which three datasheet numbers actually decide whether the pin can turn it fully on?
Show the answer and why

Answer: On-resistance quoted at 3.3 V of gate drive, input capacitance, and the gate-source voltage rating

On-resistance at the gate voltage you will actually apply is the number that says the device is on; input capacitance sets how much current the pin must supply through the gate resistor and how fast the switch is; and the gate-source rating says the drive will not damage it. The gate threshold is the trap: Nexperia point out that VGS(th) is measured with gate and drain shorted at a few hundred microamps and is not how the device is used, so a 1 to 2 V threshold does not mean the part is usefully on at 2 V. The IRLZ44N quotes on-resistance at 10, 5.0 and 4.0 V and nothing at 3.3 V, which is a real gap the builder must own.

Question 4. Your firmware asks for a 1.000 s exposure and the serial log reports measured intervals of 1.000 34 s, 1.000 29 s and 1.000 31 s. What is the dominant source of that 300 microsecond excess?
Show the answer and why

Answer: The interpreter and the switching code, which take some tens of microseconds per pass

Take the candidates in turn. The crystal is specified at ±30 ppm tolerance, ±30 ppm stability and ±5 ppm first-year ageing, so at worst 65 ppm, or 65 µs in a second — a fifth of the excess and in any case not consistently positive. The gate time constant is 330 Ω × 1700 pF = 0.56 µs, four hundred times too small. That leaves the software: the busy-wait can only end on a loop iteration, so it always overshoots by up to one pass of the interpreter. It is also why the firmware reports the interval it achieved instead of the one it was asked for.

Question 5. Why does the reference circuit put a 100 kΩ resistor from the MOSFET gate to ground, when the microcontroller pin already drives the gate both high and low?
Show the answer and why

Answer: To hold the gate low whenever the pin is not driving it — at reset, while reprogramming, or with the board unpowered but the LED supply live

Pin current is the 330 Ω series resistor's job, not the pull-down's. The pull-down exists for every moment the pin is not an output: at power-up, in reset, during reprogramming, or if the Pico is unplugged while the LED rail stays live. An undriven gate floats, a floating gate can switch, and a lamp that switches itself on inside a closed box fogs whatever is in there. The pull-down makes the absence of a decision mean off.

Question 6. A supplier will not say which BS EN 62471 risk group its high-brightness white LED falls into. What does this course do?
Show the answer and why

Answer: State no risk group, and apply the behavioural control regardless: never look into the unshielded emitter and keep the diffuser fitted

A risk group is assigned by measurement to a specific lamp system, so assuming one in either direction would be inventing a classification. Nor can it be measured with a lux meter, which is photopically weighted and says nothing about the blue-light hazard the groups are largely built around. What survives is the control that does not depend on the group at all: the emitter is never looked into, the diffuser is fitted before first switch-on, and the finished instrument only ever runs with its lid closed. Asking the supplier is still worth doing, since they have a duty under section 6 of the Health and Safety at Work etc Act 1974 to provide information for safe use.

Sources for this page

17 cited · checked 2026-09-05

  1. 01Electrical safety and you: A brief guide, INDG231(rev1)Health and Safety Executive, 2012§ What are the hazards - contact with live parts causing shock and burns, normal mains voltage 230 volts AC can kill, and the note that risks are greatest in wet surroundings; Reducing the risk, Reduce the voltage - limit the supply voltage to the lowest needed to get the job done, with 12, 25, 50 and 110 volts given as examples and battery-operated tools named as safesthse.gov.uk/pubns/indg231.pdftier 1, primary2026-09-05
  2. 02Raspberry Pi Pico Datasheet: An RP2040-based microcontroller boardRaspberry Pi Ltd§ Section 1, key features - 26 multi-function 3.3 V GPIO, 12-bit 500 ksps ADC, 16 PWM channels, one timer with four alarms, and the Abracon ABM8-272-T3 crystal; section 2.3, recommended operating conditions - VBUS 5 V plus or minus 10 per cent, VSYS 1.8 to 5.5 V; the pin descriptions for VBUS, VSYS and 3V3, including the recommendation to keep the 3V3 load below 300 mA; section 4.2, general purpose IO; section 4.3, using the ADC, including the reference filter and the roughly 30 mV offset; section 3.1.2 and 3.1.3, BOOTSEL and DORMANT current tablesdatasheets.raspberrypi.com/pico/pico-datasheet.pdftier 1, primary2026-09-05
  3. 03RP2040 Datasheet: A microcontroller by Raspberry PiRaspberry Pi Ltd§ Section 2.16.1.1, recommended crystals - Abracon ABM8-272-T3 at 12.000 MHz, frequency tolerance plus or minus 30 ppm at 25 C, frequency stability plus or minus 30 ppm, ageing plus or minus 5 ppm in the first year; section 5.5.3.5, interpreting GPIO output voltage specifications - the 2, 4, 8 and 12 mA drive strengths are not hard limits and describe how far the output voltage falls at a stated loaddatasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdftier 1, primary2026-09-05
  4. 04IRLZ44NPbF HEXFET Power MOSFET, data sheet PD-94831International Rectifier, now Infineon Technologies, 2003§ Front page summary and Absolute Maximum Ratings; Electrical Characteristics at TJ = 25 C - gate threshold voltage 1.0 V minimum and 2.0 V maximum at VDS = VGS and ID = 250 microamps; on-resistance 0.022 ohm at VGS = 10 V, 0.025 ohm at VGS = 5.0 V and 0.035 ohm at VGS = 4.0 V, with no figure at 3.3 V; input capacitance 1700 pF; total gate charge 48 nC; thermal resistance 62 C/W junction-to-ambientinfineon.com/dgdl/Infineon-IRLZ44N-DataSheet-v01_01-EN.pdftier 1, primary2026-09-05
  5. 05Understanding power MOSFET data sheet parameters, application note AN11158, revision 7.0Nexperia B.V., 2025§ Section on gate-source threshold voltage - VGS(th) is defined where drain and gate are shorted at a small specified current, depends on chip size, and is defined in a way that is best for routine measurement but not how the device would typically be usedassets.nexperia.com/documents/application-note/AN11158.pdftier 1, primary2026-09-05
  6. 06XLamp XP-E2 LEDs, product family data sheet CLD-DS56 rev 25BCree LED§ Characteristics tables - thermal resistance junction to solder point 5.8 C/W white and 9 C/W green; temperature coefficient of voltage -1.5 mV/C white, -1.2 green, -1.9 blue, -2.1 amber; maximum DC forward current 1500 mA white and green, 1200 mA royal blue and blue; maximum junction temperature 150 C; forward voltage 2.84 to 3.1 V for white at 350 mA and 85 C and 3.12 V at 1000 mA; Relative Flux vs. Current chart axes, running to 1500 mA against a flux axis drawn to 300 per cent for white; Relative Flux vs. Junction Temperature chart axes, 25 to 150 Cdownloads.cree-led.com/files/ds/x/XLamp-XPE2.pdftier 1, primary2026-09-05
  7. 07Quick reference for the RP2, MicroPython documentationDamien P. George, Paul Sokolovsky and contributors§ Timers - the RP2040 system timer provides a global microsecond timebase but only the software timer is available, with callbacks as soft interrupts unless hard=True; ADC - four 12-bit SAR channels on GP26 to GP29, standard range 0 to 3.3 V, read_u16 across that range, and the warning that an unconfigured pin sinks about 60 microamps after a hard reset; PWM - eight slices of two channels eachdocs.micropython.org/en/latest/rp2/quickref.htmltier 1, primary2026-09-05
  8. 08class Timer, control hardware timers, MicroPython library documentationDamien P. George, Paul Sokolovsky and contributors§ Timer Types - hardware timers may be more accurate for very fine sub-millisecond timing, but most ports support them except Zephyr and RP2, which support only virtual timersdocs.micropython.org/en/latest/library/machine.Timer.htmltier 1, primary2026-09-05
  9. 09time, time related functions, MicroPython library documentationDamien P. George, Paul Sokolovsky and contributors§ time.sleep_ms and time.sleep_us - delay for at least the given interval and may take longer; time.ticks_ms, time.ticks_us and time.ticks_diff - increasing counters from an arbitrary reference that wrap at an unexposed value, on which only ticks_diff and ticks_add are validdocs.micropython.org/en/latest/library/time.htmltier 1, primary2026-09-05
  10. 10class ADC, analog to digital conversion, MicroPython library documentationDamien P. George, Paul Sokolovsky and contributors§ ADC.read_u16 - one reading returned as an integer from 0 to 65535, scaled so the minimum reading is 0 and the maximum 65535; ADC.read_uv, whose calibration is left to the portdocs.micropython.org/en/latest/library/machine.ADC.htmltier 1, primary2026-09-05
  11. 11EH40/2005 Workplace exposure limits, containing the list of workplace exposure limits for use with COSHHHealth and Safety Executive, 2005§ Table 1 - rosin-based solder flux fume, CAS 8050-09-7, long-term exposure limit 0.05 mg/m3 over eight hours and short-term limit 0.15 mg/m3 over fifteen minutes, annotated Sen; Annotations - Sen means capable of causing occupational asthma; paragraph 6 of the introduction, that absence from the list does not indicate that a substance is safehse.gov.uk/pubns/priced/eh40.pdftier 1, primary2026-09-05
  12. 12Controlling airborne contaminants at work: A guide to local exhaust ventilation (LEV), HSG258Health and Safety Executive, 2011§ Table of contaminant types, which lists solder fume among fumes; the controls that come before extraction - eliminate, substitute, reduce the size of the source, modify the process to emit less; and paragraph 93, that some bench-mounted fan and filter units commonly used for solder fume control are ineffective and that suppliers should ensure a proposed system provides adequate controlhse.gov.uk/pubns/priced/hsg258.pdftier 1, primary2026-09-05
  13. 13Guidance for Employers on the Control of Artificial Optical Radiation at Work Regulations 2010Health and Safety Executive, 2010§ List 1, safe light sources - any exempt or Risk Group 1 lamp or lamp system, including LEDs, as defined in BS EN 62471:2008; the sources that are safe under normal conditions but have the potential to cause harm if placed extremely close to the eyes, which include any Risk Group 2 lamp or lamp system including LEDs; List 2, hazardous light sources - any Risk Group 3 lamp or lamp system including LEDs; and the statement that suppliers have a duty under section 6 of the Health and Safety at Work etc Act 1974 to provide information on managing the riskaber.ac.uk/en/media/departmental/healthsafetyenvironment/employers-aor.pdftier 1, primary2026-09-05
  14. 14Burns and scalds: TreatmentNational Health Service, 2026§ Treatment - hold the burn under cool running water for 20 minutes as soon as possible, remove clothing and jewellery near the area but not anything stuck to it, and cover by laying cling film over the cooled injurynhs.uk/conditions/burns-and-scalds/treatmenttier 1, primary2026-09-05
  15. 15Arduino UNO R3 (A000066) datasheetArduino S.r.l.§ Description and section 3.2, Processor - an ATmega328P running at up to 20 MHz, fourteen digital pins and six analogue inputs, with IOREF connected to the 5 V raildocs.arduino.cc/resources/datasheets/A000066-datasheet.pdftier 1, primary2026-09-05
  16. 16ATmega328P 8-bit AVR microcontroller with 32K bytes in-system programmable flash, data sheetMicrochip Technology Inc., formerly Atmel§ Features - six-channel 10-bit ADC in the SPDIP package, eight in TQFP and VQFN; Operating Voltage 1.8 to 5.5 V, with 20 MHz requiring 4.5 to 5.5 Vww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdftier 1, primary2026-09-05
  17. 17ESP32 series datasheetEspressif Systems§ Features - 12-bit SAR ADC of up to 18 channels; section 5.3, DC characteristics tabulated at 3.3 Vespressif.com/sites/default/files/documentation/esp32_datasheet_en.pdftier 1, primary2026-09-05

Formulas, hazard statements, historical dates and process descriptions on this page were checked against the sources above on the date shown. Safety data changes: obtain the current safety data sheet for the product you actually buy before you open it.