Tinker Mission · Projects 08
Morse spy beacon
Type a secret message on your computer and the beacon flashes and beeps it in real Morse code. Tap the button to become the radio operator, then hold it for 3 seconds and the beacon repeats a message on its own, even on batteries. The wiring is the same as lesson K2, so this is the quickest first code project. Then, if you like, send Morse by radio between two boards, read it with a light sensor, or solder it into a small box.
- Level 1
- One afternoon (1–2 h (base build). Each “Go further” adds 1–2 h. Permanent version: add 2–3 h · estimate)
- —
- Ask for help: step 15
Links
- Online sheettinkermission.com/en/projects/morse-beacon/
- The codetinkermission.com/sketches/08-morse-beacon.ino
- The lesson: LEDs and the right resistortinkermission.com/en/lessons/led-resistor/
Scan a code with a phone camera to open the online sheet, download the code or read the lesson.
Safety first
- Low voltage only. USB (5 V) or a 4×AA pack, nothing else. No mains, and no laser: a bright LED is the light of this mission, and you never add a laser module to it.
- 3.3 V logic only. The ESP32 works at 3.3 V (3.6 V absolute maximum): never connect any ESP32 signal pin to 5 V. The one exception is the board's own
5Vpower pin, which takes the battery pack and nothing else. - The red rail is 3V3 only. The 4×AA pack goes into the
5Vpin row and the blue rail (−). Never put its + wire on a red rail. - Pack OFF before USB. The board takes one power source at a time. With the pack ON and USB plugged in, current can flow back into the cells. Switch the pack OFF before you plug in the USB cable, and before you move any wire.
- Batteries: never mix alkaline and rechargeable cells, old and new, or brands in one holder; replace all the cells at once. Follow the + / − marks inside the holder. Never let the bare ends of a pack touch each other or metal. Never recharge alkaline cells; recharge NiMH cells only in a NiMH charger, outside the box. No 9 V battery, no 5- or 6-cell holder, no LiPo for this mission. Take the cells out if the beacon sits unused for a month; white crust on a cell means it leaked, so wear gloves, clean it and dispose of it properly. Recycle used cells at a drop-off point.
- Do not send SOS where it could look real. No SOS (or any distress signal) flashed out of a window at night, near water or a road, or on a real radio. It is a game signal: for tests, use words like HELLO or OK.
- Flashing light: at the default speed the LED blinks a few times a second. If anyone nearby is sensitive to flashing lights (for example photosensitive epilepsy), do not use the LED near them. Keep it out of anyone's direct line of sight if they ask you to, and stay at the default speed.
- Buzzer: keep it short in shared spaces (the command
/quietswitches it off, the LED keeps working). Never hold the buzzer near your ear. - Radio option: the board uses its normal 2.4 GHz Wi-Fi radio, like any ESP32. Do not modify its antenna or boost its power. Real ham-radio frequencies are a different hobby and need a licence: they are not part of this mission.
- Light-sensor option: the light sensor (an LDR) contains cadmium sulfide. Do not break or burn it, and dispose of it as electronic waste.
- Small parts and cells: keep small parts, wires and batteries away from pets and from anyone who might put them in their mouth.
Parts · Base build
- ×1 ESP32 boardESP32-DevKitC V4 or a clone: ESP32-WROOM-32, 38 pins, 3.3 V logic. Check the regulator before you run it on 4 alkaline cells (step 2): the 3-legged chip with a big tab near the
5Vpin should say AMS1117. - ×1 BreadboardFull-size 830 points. A 38-pin board plus its parts will not fit on a 400-point board.
- ×1 Yellow LED, 5 mm5 mm, any “bright” yellow. Forward voltage about 2.0–2.2 V (typical, check on your LED's datasheet). Yellow is easy to see and different from mission 01's red, but any colour works with the same resistor.
- ×1 220 Ω resistor220 Ω, 1/4 W, through-hole. About (3.3 − 2.1) / 220 ≈ 5.5 mA: bright enough indoors and far below the usual 20 mA LED rating.
- ×1 Active buzzer moduleActive (built-in tone) module, 3 pins S / + / −, 3.3–5 V, sounds when S is HIGH. Some modules are the other way round: you test it in step 9 and can fix it in step 10. Takes roughly 20–30 mA (typical, to confirm on your module).
- ×1 Push button6 mm tactile switch, 4 legs. No resistor needed: the code turns on the board's internal pull-up.
- about 10 Jumper wiresMale-to-male, about 10–20 cm.
- ×1 USB data cableData cable (not charge-only) matching the board's port.
- ×1 4×AA battery holder with ON/OFF switch, cover and header-pin ends (optional)Same holder as mission 01 (Adafruit 830 type). Fresh alkaline cells give about 6.4 V, flat ones about 4 V. The board needs about 4.4–6.5 V, so change the cells before they get that low. A 3×AA holder is not enough: it starts at 4.5 V and drops below the limit almost at once.
- ×4 AA batteries (optional)Alkaline AA (LR6), or low-self-discharge NiMH AA. Same type and brand, never mixed. 4×NiMH only if your regulator is not an AMS1117 (step 2).
- 1 set Second complete base kit (board, breadboard, LED, 220 Ω, buzzer, button, wires, USB cable) (optional)Identical to the base build. A friend's board works, as long as it is a 38-pin ESP32 with the same wiring.
- ×1 Light-dependent resistor (LDR), GL5528 type (optional)GL5528 or similar. A little slow (tens of milliseconds, typical, check the datasheet), which is why this option stays at 10 WPM or less. Contains cadmium sulfide (see Safety).
- ×1 10 kΩ resistor (optional)10 kΩ, 1/4 W, through-hole
- ×1 Short opaque tube, 3–5 cm (optional)A drinking straw wrapped in black tape, a roll of black paper, or a printed tube.
Tools
- Computer with Arduino IDEArduino IDE 2.x + “esp32 by Espressif” 3.3.x (free download from arduino.cc)
- Sticky label and a pen (optional)Any
- Multimeter (optional)Any basic digital multimeter
Wiring
| # | Colour | From | To |
|---|---|---|---|
| 1 | red | ESP32 3V3 (hole j19) | 3V3 rail (right red +) |
| 2 | black | ESP32 GND (hole j6) | GND rail (right blue −) |
| 3 | black | left blue rail | right blue rail (a link of GND) |
| 4 | orange | ESP32 GPIO25 (j11) | buzzer S (j39) |
| 5 | red | 3V3 rail | buzzer + (j40) |
| 6 | black | buzzer − (j41) | GND rail |
| 7 | green | ESP32 GPIO26 (j10) | b26 (row 26). The 220 Ω resistor then goes from d26 to d30, in the same row as this wire's end, so no two legs share a hole. The LED's long leg (+) goes in b30, in the row of the resistor's other end, and its short leg (−) in b31. |
| 8 | black | LED row 31 (a31, the short leg's row) | left blue rail |
| 9 | blue | ESP32 GPIO27 (j9) | button leg A (j44). The button straddles the middle gap, legs in e44, f44, e46, f46. |
| 10 | black | button leg B, diagonal from A (a46) | left blue rail |
| B | red / black | 4×AA pack (optional) | red + into the hole next to the 5V pin (j1), black − into the right blue rail. Never a red rail. Pack OFF until step 15. |
Hole names (j19, j6…) assume the board's pins sit in columns a and i of the breadboard, USB end at row 1 (step 3). These are exactly the holes of lesson K2 and mission 01 (minus the receiver), so a breadboard from either already runs this mission. The red rail on the right is 3V3 only; the left red rail stays unused.
| Pin | Goes to | Role |
|---|---|---|
| 5V | 4×AA pack + (battery use only, and the only thing that goes here) | Power in (about 4.4–6.5 V; below that it misbehaves) |
| 3V3 | 3V3 rail: buzzer + | Power out (3.3 V) |
| GND | GND rail: pack −, buzzer −, LED, button | Ground |
| GPIO27 | Button (other leg to GND) | Input with internal pull-up (LOW = pressed). Can wake the board from deep sleep. |
| GPIO26 | 220 Ω → LED | Output (HIGH = LED on) |
| GPIO25 | Buzzer S | Output (HIGH = buzzer on, unless your module is inverted) |
| GPIO34 | Go further 2 only, on the receiver board: the middle of the LDR / 10 kΩ pair | Analog input (input-only pin) |
Build steps · Base build
1 Lay out your parts.
Base build only: board, breadboard, LED, 220 Ω resistor, buzzer, button, jumper wires, USB cable.
Check: Every part you need is on the table.
2 Check your board.
Look at the little 3-legged chip with a big flat tab, next to the
5Vpin. Read what is printed on it. If it says AMS1117 (the original board uses it), 4 alkaline cells are fine. If it is tiny, has 5 legs or has no marking, use 4 NiMH cells only. (You only need this if you will use the battery pack, but check now while the board is in your hand.) Also read the labels printed on the board next to the pins: on clones the order can differ from this sheet, and your labels win.Check: You know which chip regulates your board, and you have found the pins
5V,GND,3V3,25,26and27by their printed labels.3 Place the ESP32.
Press the board across the middle gap, so its two rows of pins land in columns a and i, rows 1 to 19. USB port at row 1, antenna toward row 20. Leave rows 20–23 empty: that is where the antenna sits. Each pin on the j side now has a free hole next to it (column j). No cable yet.
Check: The board sits flat, no pin is bent, and the pin
5Vis in row 1, column i.4 Rails.
Wire the ESP32 pin
3V3(hole j19) to the right red (+) rail and the pinGND(hole j6) to the right blue (−) rail. Then link the left blue rail to the right blue rail with one wire. The right red rail is now 3V3 only.Check: Red wire on the red rail, black wire on the blue rail, and nothing else touches the red rail yet.
5 Add the buzzer.
USB unplugged. Buzzer
StoGPIO25(wire 4),+to the 3V3 rail (wire 5),−to the GND rail (wire 6). Follow the labels on your module.Check: Three wires on three different pins, and S is not on a rail.
6 Add the LED.
GPIO26→ 220 Ω resistor → long leg (+) of the LED. The green wire fromGPIO26ends in b26. The resistor goes from d26 to d30, so it shares row 26 with the wire but no hole. The LED's long leg goes in b30 (same row as the resistor's other end) and its short leg in b31. A wire runs from a31 to the left blue rail.Check: The long leg faces the resistor side.
7 Add the button.
Place the button across the middle gap, legs in e44, f44, e46 and f46. A wire from
GPIO27goes to one leg (j44 side) and a wire from the diagonally opposite leg (a46) goes to the left blue rail. No resistor needed: the code turns on the board's internal pull-up.Check: The two wired legs are diagonal from each other (not on the same side).
8 Upload the code.
Open the sketch “08-morse-beacon” in the Arduino IDE. Plug in the USB cable, choose “ESP32 Dev Module” and the right port, upload. Leave the cable plugged in. (No battery pack yet: one power source at a time.)
Check: “Done uploading” appears.
9 Say OK.
Open the Serial Monitor at 115200 baud and set the line ending to “Newline”. Press EN (reset). The LED and buzzer play OK in Morse (dash-dash-dash, dash-dot-dash), then the monitor prints a short help text. That is the board testing itself.
Check: You see and hear OK, and the help text appears. A buzzer that stays silent, or sounds the whole time and goes quiet on the beeps, works the other way round: go to step 10.
10 Fix a reversed buzzer (only if needed).
If the buzzer sounds when it should be silent, find
const int BUZZER_ON = HIGH;near the top of the code, changeHIGHtoLOW, upload again.Check: The buzzer is silent between signals and sounds with the LED.
11 Send your first message.
In the Serial Monitor, type
HELLOand press Enter. The monitor shows it in dots and dashes, then the LED and buzzer play it. Try your name. Capital or small letters, it does not matter. é is sent as ..-.. (ITU); other accented letters are skipped, and the monitor tells you. The line you typed is now the beacon's message, until the board is switched off, reset or goes to sleep (it then goes back to HELLO AGENT).Check: The dots and dashes on the monitor match the flashes. Keep tests to words like HELLO: never SOS (see Safety).
12 Tap with the key.
Press the button: the LED and buzzer follow your finger. Release: they stop. The board measures how long you pressed (short = dot, long = dash) and how long you waited, and prints what you tapped. Wait a moment after a letter and it appears on the monitor. Wait longer and it adds a space. Tap slowly: the board expects about 8 WPM. Try E (one dot), T (one dash), then the word HI (four dots, a pause, two dots).
Check: The monitor shows the dots and dashes as you tap them, then the letter. A wrong letter means a dot was too long or a gap too short: slow down.
13 Start the beacon.
Hold the button for 3 seconds. LED and buzzer give one short confirmation beep, then the beacon plays its message (your last typed line, or HELLO AGENT if you typed nothing since power-on), waits 5 seconds and plays it again, over and over, like a lighthouse. One tap on the button stops it. While it is sending, a press stops the message within one signal.
Check: After the 3 s hold, the message repeats every 5 s until you tap the button.
14 Change speed and volume.
Type
/wpm 15to send faster (allowed range 5–20 WPM). Type/quietto silence the buzzer (the LED keeps going) and/loudto bring it back./helplists the commands. Try different words at different speeds: where does it become hard to read by eye?Check: Messages play at the new speed and the buzzer obeys
/quiet.15 Run it on batteries (optional). · Ask for help
USB unplugged first. Put 4 cells in the 4×AA holder, matching the + / − marks, switch it OFF and label it “ESP32 4×AA”. Plug its black pin end into the right blue (−) rail and its red pin end into the hole next to the
5Vpin (j1). Never into a red rail. Switch it ON: the board says OK. Hold the button 3 s to start the beacon, and tap to stop it. Without the computer you cannot type a message, and a typed message is forgotten when the power is cut, so on batteries the beacon always plays the default message of the code (HELLO AGENT). To send your own on batteries, changeDEFAULT_MESSAGEin the code and upload it again (pack OFF, then USB). Switch the pack OFF when you stop.Check: Red goes to the
5Vrow, black to the blue rail, and someone experienced (or you, twice) has checked it. The beacon runs without a cable.
What the board tells you (deep sleep, in plain words)
| What you see | What it means |
|---|---|
| OK in Morse at power-on | Self-test: the board started, and the LED and buzzer work. |
| LED and buzzer follow your finger | Straight-key mode: you are the operator. |
| One short beep after a 3 s hold | The beacon is starting. Let go of the button. |
| Your message every 5 s | Beacon running. One tap on the button stops it. |
| Two blinks, then dark | 3 minutes of nothing: the board is going to deep sleep. Press the button to wake it. |
Make it permanent
Soldering safety
- Lead-free solder with a flux core (0.8 mm is easy to use).
- Iron with a stand and a temperature setting, at 325–375 °C. Turn it down if the solder smokes.
- Ventilation: open a window, or use a small fan with a filter that draws the smoke away from your face.
- Safety glasses: clipped wire ends and solder can fly.
- The iron lives in its stand whenever you are not using it. Never touch the tip or the metal shaft. Work on a heat-proof mat. Unplug the iron when you stop. A burn: cool running water for at least 10 minutes.
- Hold the board with a clamp (“helping hands”), not your fingers.
- Nothing powered while you solder: batteries out of the holder, ESP32 unplugged from its sockets, USB unplugged.
- Wash your hands afterwards, and keep food away from the bench.
- Ask someone who has soldered before to watch your first five joints.
Parts for the permanent version
- ×1 Breadboard-pattern perfboard, half sizeSame rows, 5-hole strips and rails as a breadboard, half size. Exact size to check on the datasheet before you buy; the hole map will match it.
- 2 strips: 1×40 + 1×20 Female header, 2.54 mmSingle row, 2.54 mm pitch, long pins. The 1×40 gives the two 19-socket rows for the ESP32, the 1×20 gives the 3-socket row for the buzzer. Cut with a flush cutter; you lose one socket at each cut.
- ×1 Screw terminal, 5.0 / 5.08 mm pitch, 2-polePCB-mount, wire entry facing out (KF301 / DG301 type).
- 1 set Solid hook-up wire, 22 AWG, several coloursInsulated, red, black, orange, green, blue.
- 1 reel Lead-free solder, flux core0.8 mm, for example Sn99.3/Cu0.7 or SAC305.
- to confirm with the case files M3 screwsCounts and heads to confirm once the case is finished.
Tools for the permanent version
- Soldering iron with stand and temperature control
- Multimeter
- Safety glasses
- Helping-hands clamp or board holder
- Flush cutter and wire stripper
- Small fan with a filter (or an open window) (optional)
The hole map for the half-size perfboard comes with the case files. It will not be a hole-for-hole copy of the 830 breadboard.
Soldering steps
P1 Set up a safe bench. · Ask for help
Read the soldering safety list. Window open or fan on, glasses on, iron in its stand on a heat-proof mat, board in the clamp. Ask someone who has soldered before to be there for your first five joints.
Check: Someone experienced is with you, and the iron is hot only when you need it.
P2 Fit the ESP32 and buzzer sockets.
Plug the two 1×19 female headers onto the pins of the ESP32 (this keeps them lined up), place them on the perfboard at the positions on the hole map, turn it over and solder one pin at each end, check it sits flat, then solder the rest. Same for the 3-socket buzzer header. Pull the ESP32 out and put it aside. The hole names come with the hole map.
Check: The sockets stand straight, and each pin is a small shiny cone of solder, not a blob.
P3 Solder the screw terminal, the resistor, the LED and the button.
Terminal for the pack (+ toward the
5Vsocket, − to GND), resistor and LED (long leg toward the resistor), button across the gap. The hole names come with the hole map.Check: The LED's long leg is on the resistor side, and the button sits flat.
P4 Solder the wires.
Insulated 22 AWG wire, flat on the top, soldered from the underside. Same ten wires as the base build: 3V3 and GND rails, buzzer, LED and button. The pack's + goes to the
5Vsocket and never near the 3V3 rail. The wire list with hole names comes with the hole map.Check: All wires are in, and the pack's + wire touches nothing but the
5Vsocket.P5 Look at the underside.
In good light, look for a blob of solder that joins two strips, or a strip and a rail. Remove any blob with the iron (and desoldering braid if you have it).
Check: No bridge between neighbouring joints.
P6 Multimeter checks, pack OFF and ESP32 not plugged in. · Ask for help
Continuity (beep) mode. Must NOT beep: + rail to − rail; the
5Vsocket to the + rail; the5Vsocket to the − rail. Must beep: the terminal + to the5Vsocket, the terminal − to GND, the3V3socket to the + rail, theGPIO26socket to the resistor. The button,GPIO27socket to GND, beeps only while pressed.Check: Every “no beep” is silent and every “beep” beeps.
P7 Check the pack, then the key test. · Ask for help
Put the cells in the holder, switch ON and read the DC voltage on its wires: +5.6 to +6.5 V (alkaline) or +5.0 to +5.6 V (NiMH). A minus sign means the wires are swapped. Switch OFF and screw the wires into the terminal (red = +). Now the key test, with the ESP32 still unplugged: pack ON, measure the
5Vsocket to GND (you read the pack voltage), then the + rail to GND: it must read 0 V.Check: The + rail reads 0 V. If it shows the pack voltage: STOP. The 5V line touches the 3V3 rail, and it would destroy the ESP32. Switch OFF, find the bridge, fix it.
P8 Plug in the ESP32 and run the tests again.
Pack OFF. Plug the ESP32 into its sockets, USB end first. Switch the pack ON: the red power LED lights and the + rail reads 3.2–3.4 V. Then repeat steps 9 to 14 of the base build on your soldered board.
Check: It behaves exactly like the breadboard version.
P9 Put it in the case.
The case files (a small 3D-printed case for the half-size perfboard) are still to come. The plan: the LED in a 5 mm hole on top (optionally a printed hood so you can aim it), the button reachable on top through a printed plunger, grille holes for the buzzer, the USB port and the pack's switch reachable from outside, a battery door, and a few vent slots. The board draws well under half a watt, so it stays cool, but the vents stay open anyway.
Check: The button, the LED, the USB port and the pack's switch are all reachable, and the vent slots are open.
How Morse code works (in two minutes)
My notes
Regulator chip says: AMS1117 / other
BUZZER_ON = HIGH or LOW
My DEFAULT_MESSAGE
Speed I like best (WPM)
Date I put in new batteries