beginner

Project 1: Build a Regulated Sensor Indicator Board

Design, build and test a small battery-powered board: reverse-polarity protection, a 3.3 V regulator with a thermal check, a sensor voltage divider, a transistor-driven indicator LED, decoupling, measurements against calculations, and a documented schematic and lab notebook.

4-5 hours

The scenario

Kofi’s Seed Nursery wants a simple dusk indicator for the greenhouse: when the light level falls below a set point, a bright LED turns on to remind staff to close the vents. It must run from a 9 V battery, tolerate being connected the wrong way round by a tired volunteer, and keep working as the battery runs down. You are asked to design, build and prove a prototype board before they pay for a printed circuit board.

Requirements:

  1. Power: 9 V battery in; reverse-polarity protection; a 3.3 V low-dropout (LDO) regulator such as the AMS1117-3.3 or MCP1700, chosen and justified from its datasheet (a 7805 is the wrong choice because it needs at least 7 V in to give 5 V and cannot give 3.3 V); input and output capacitors as the datasheet says; 100 nF decoupling near any chip.
  2. Sensor: a light-dependent resistor (LDR) in a voltage divider that produces a higher voltage as it gets darker (or the reverse, as you choose).
  3. Switch: an NPN transistor (such as a 2N3904 or BC547) driven from the divider (with a base resistor) that turns the indicator LED on; the LED current must be between 5 and 20 mA.
  4. Calculations first: every resistor value, the regulator headroom at 7 V minimum battery, the regulator’s junction temperature, and the power in each part, all written in your notebook with units.
  5. Measurements: measure the rail voltages, LED current, divider output in light and dark, and the supply ripple with a scope if you have one. Compare with the calculations; every difference larger than 10 percent needs an explanation.
  6. Documentation: a neat schematic (hand-drawn or KiCad), a parts list with datasheet links, and your lab notebook with photos.

What you need

  • A breadboard, a 9 V battery and clip (or a bench supply set to 9 V with a 100 mA limit), a multimeter, an optional oscilloscope.
  • An LDO regulator (3.3 V) with its capacitors, a Schottky or silicon diode (or a P-channel MOSFET), an LDR, a 10 kΩ trimmer (or fixed resistors), an NPN transistor, an LED (any colour), resistors, and 100 nF ceramic capacitors.
  • The datasheets for the regulator and the transistor, downloaded and open.

Work at low voltage only. Keep the battery disconnected while you change wiring.

Phase 1: design on paper

Fill this table in your notebook. Use the formulas from the lessons:

Item Calculation Your result
Reverse-polarity protection Diode drop 0.7 V (or Schottky about 0.3 V); battery minimum after the diode
Regulator headroom V_in,min − drop ≥ 3.3 V + dropout
Regulator heat (V_in − 3.3 V) × I_total; T_j = 25 °C + P × θ
LED resistor R = (3.3 V − V_f) / I_LED, round up to a standard value
Divider Choose the LDR and fixed resistor so that the output crosses about 0.7 V at your dusk level
Base resistor R_B for forced beta 10
Loaded divider Divider with the base load included

State your assumptions: LDR resistance in light and dark (measure them), LED forward voltage, battery range. Check the 7 V minimum case: with a 0.3 V Schottky diode and an LDO with 1 V dropout, regulation holds as long as the battery is above 3.3 + 1 + 0.3 = 4.6 V, so 7 V leaves a comfortable margin.

Phase 2: build the power stage

  1. Wire the battery → protection diode → regulator → output capacitor on the breadboard, with the input capacitor as the datasheet says.
  2. Measure the regulator output with no load and with a 100 Ω load. Record the values and the battery voltage.
  3. Reverse the battery clip briefly (with the diode fitted) and confirm that nothing conducts and the circuit survives.
  4. Measure the supply current and compute the power in the regulator and its junction temperature from the datasheet’s thermal resistance.
  5. With the scope on AC coupling, measure the ripple on the 3.3 V rail.

Phase 3: build the sensor and switch

  1. Build the LDR divider and measure its output with the LDR in room light, covered by your hand, and under a lamp. Plot the three values.
  2. Add the transistor and base resistor, with the LED and its resistor in the collector, powered from 3.3 V.
  3. Adjust the divider (a trimmer or different fixed resistor) so the LED turns on when the light drops to your set point and off when it rises, with a clear change.
  4. Measure the LED current, the transistor’s V_BE and V_CE when on, and the loaded divider voltage.

Phase 4: compare, improve and document

  1. Fill a table of calculated versus measured values with the percentage difference for each.
  2. Investigate any difference above 10 percent: tolerance, loading, meter error, a wrong assumption.
  3. Add hysteresis or a comparator if the LED flickers around the threshold (a stretch goal) and describe how.
  4. Draw the final schematic with reference designators and values and update the parts list.
  5. Photograph the finished breadboard from above with the wiring clear.

Acceptance test

# Check Evidence
1 Reverse-polarity protection works Notes of the reversed battery test
2 Regulator has headroom at 7 V battery Calculation and measurement
3 Junction temperature is 100 °C or less Calculation with θ from the datasheet
4 Decoupling capacitor fitted Photo and schematic
5 LED current is 5 to 20 mA Measured current
6 Sensor divider works with loading Loaded divider calculation and measurement
7 Transistor has a margin of at least 1.5 times Ratings from the datasheet
8 Measured values within 10 percent of calculated Comparison table
9 Supply ripple 100 mV or less Scope screenshot or a note on how you measured it
10 Schematic and notebook Your documents

Hands-on lab: encode the acceptance test

Sensor board acceptance test — Python 3
WHAT TO DO
check_board(facts) takes text with one "key=value" per line (keys and values case-insensitive; a missing key fails its check) and returns the SORTED list of failed check names. [] means all passed. "protection" protection must be "true" "dropout" vin_min_v, vout_v and dropout_v must be numbers and vin_min_v must be at least vout_v plus dropout_v "thermal" tj_c must be a number of 100 or less "decoupling" decoupling must be "true" "led-current" led_current_ma must be a number from 5 to 20 inclusive "sensor-divider" sensor_divider must be "true" "transistor" ic_ma and rating_ma must be numbers and rating_ma must be at least 1.5 times ic_ma "measurements" error_pct must be a number of 10 or less "ripple" ripple_mv must be a number of 100 or less "schematic" schematic must be "true" "documented" documented must be "true"
YOUR CODE (edit here, then press Run)
Ctrl/⌘ + Enter
OUTPUT

Stretch goals

  • Replace the transistor with a comparator and add hysteresis with two resistors; measure the two switching thresholds.
  • Build the board on perfboard, solder it and repeat the measurements.
  • Add a second sensor (temperature, using a thermistor) and an OR function of the two conditions.
  • Draw the schematic in KiCad, run the electrical rules check and export a PDF.

Your deliverable

A design and test report: the requirements, the schematic, your calculations table, the build photos, the measured-versus-calculated table with explanations, the acceptance table with evidence, the notebook pages, and three risks (for example battery life, LDR variation with temperature, solder joint reliability) with how you would reduce each.

Your measured divider output is 15 percent lower than calculated once the transistor is connected. What do you check, and what do you change?

The transistor’s base current loads the divider and pulls the output down. Recalculate with the base resistor and the transistor’s V_BE as a load in parallel with the lower resistor. To fix it, lower the divider resistance (at the cost of more current), increase the base resistor, or use a higher-gain stage such as a Darlington, a MOSFET or an op-amp buffer. Re-measure after the change.

Can You Explain It?

Close the lesson and answer these without looking back. The goal isn't the wording — it's whether you've formed a usable mental model.

  • Explain how you checked that the regulator still works when the battery is nearly empty.
  • Describe how the loaded divider changed your design.
  • Say which measured value differed most from your calculation and what you learned from it.

🧪 Want to practise this on your own computer? See how to set up your lab →

🤖

Need clarification? Ask GT

Hi, I'm GT — your AI tutor for Project 1: Build a Regulated Sensor Indicator Board. What would you like to know?
📝

Knowledge Check

1 of 4

Why does the project calculate the regulator's headroom at the minimum battery voltage?

Report a problem

About: /lessons/efc-project-1-build-a-regulated-sensor-indicator-board