Build notes / The electronics

A little chip.
A wand full
of light.

I wanted the Neptune and Mars wands to do more than glow. A tiny computer, six light channels, and a small custom board gave them a startup sequence and a moving shimmer.

The gold Neptune wand lit blue-green through its crown, symbol and four round gems while held in workshop clamps.
Neptune’s wand, lit up. This guide follows the electronics inside both wands.
01 / Start small

A computer
with a specific job.

A microcontroller is a small computer in a single chip. It has a processor to run instructions, memory to keep your program, and pins that let it interact with the outside world. In these wands, its job is simple: decide which lights should be on, and how bright they should look.

Arduino is a good place to start. A development board gives you easy connections, power, and a way to upload a program from your computer. The Arduino IDE is the application you write that program in. Start with blinking an LED; then try fading it. Those two ideas get you surprisingly far with a prop.

From a development board to your own circuit.

The microcontroller is the part doing the work. Once you know what your project needs, you can build a smaller circuit around that chip instead of fitting a whole Arduino board inside it. You still need suitable power, ground, decoupling capacitors to steady the supply, and a way to program it.

The clock is the rhythm the processor follows. The classic Uno R3 uses an ATmega328P with an external 16 MHz resonator. That is a well-established design; newer AVR parts offer other sizes and useful features. These are the Atmel-family chips now made by Microchip.

For the wands I used an ATtiny1604. I keep them in bulk because they’re small and inexpensive. It is a 14-pin tinyAVR 0-series chip, with an internal oscillator—so this board doesn’t need an external clock component. Its 20 MHz maximum is 1.25 times the Uno R3’s clock rate; how quickly a complete program runs also depends on the work it does.

Hardware references: Arduino Uno R3 and Microchip ATtiny1604.

Spence Konde’s excellent megaTinyCore project brings the familiar Arduino programming style to the modern ATtiny 0-, 1- and 2-series. You can keep using setup(), loop(), and the usual I/O functions. You select the actual chip and its pin map, and check library compatibility when moving a larger project across.

02 / Get code into it

One programming signal.
Very few wires.

These modern ATtiny parts use UPDI: the Unified Program and Debug Interface. The target needs one programming signal, a common ground, and power. A compatible programmer connects that interface to your computer.

On this 14-pin ATtiny1604, UPDI is PA0, physical pin 10. Keep it available while you are building. The schematic below doesn’t show a dedicated programming connector; on a new board I’d bring UPDI, VCC and GND to accessible pads. The prop’s USB-C port is for charging, and is not wired to upload code.

  1. Install megaTinyCore. Follow its installation instructions, then select the board family containing ATtiny1604 and choose that chip.
  2. Choose the clock for your supply. Keep the internal-clock option and the default PWM mapping for PB0–PB2 and PA3–PA5 used by this sketch.
  3. Connect a UPDI programmer. My setup used Atmel-ICE. Another option is SerialUPDI, using a suitable USB-to-serial adapter wired as described in the project’s guide. Match the signal voltage to the target and use one planned power source.
  4. Upload for the selected target. Use the core’s UPDI upload workflow. On a non-bootloader target, Burn Bootloader applies configuration fuses; it does not install an Uno-style bootloader. Follow the core’s instructions when changing clock families or brown-out settings.
Clock speed follows voltage.

Microchip rates this chip for up to 5 MHz from 1.8 V, 10 MHz from 2.7 V, and 20 MHz from 4.5 V. A directly connected single-cell LiPo tops out around 4.2 V. For that arrangement, choose 10 MHz only while VCC stays at or above 2.7 V, or 5 MHz for operation down to 1.8 V. Configure brown-out detection to suit the chosen range. Battery protection and processor brown-out detection do different jobs.

The screenshot below records my build’s 20 MHz selection; it is not a recommended setting for a directly powered single-cell build.

Microchip speed grades · megaTinyCore voltage and clock guidance.

See the Arduino Tools menu from this build
Arduino Tools menu from this build, selecting ATtiny1604, 20 MHz internal clock and Atmel-ICE.
Historical settings, including 20 MHz and disabled brown-out detection. Choose your own clock and brown-out settings from the supply requirements above. Open full size ↗
03 / Follow the current

A small signal.
A separate light circuit.

The physical power button switches the battery supply to the control board. Power reaches the ATtiny1604 and the LEDs. With the LED’s return path switched off, there is no complete circuit, so essentially no current flows and the LED stays dark. Voltage can be present without a light being on.

Each light channel has a path from the positive supply, through the LED, a 470 Ω resistor, and an N-channel MOSFET, to ground. A MOSFET is an electronic switch. Its gate is the control terminal; its drain and source carry the LED current. Here the source connects to ground, so this is called low-side switching.

The microcontroller drives the gate HIGH to make the MOSFET conduct. That completes the path and the light comes on. Drive it LOW and the path is interrupted. The chip controls the gate while the MOSFET carries the light’s current.

One simplified LED channelWith the power switch on, VCC supplies an LED, then a 470 ohm resistor and a MOSFET to ground. A microcontroller controls the gate, with a 100 kilohm pull-down from gate to ground.VCCpower switch onLED470 Ωlimits LED currentMOSFETswitchGNDMicrocontrollergate100 kΩpull-down

Gate LOW: the MOSFET is off and the LED has no conducting return path.

A simplified view of one channel. The gate switch here is a teaching example; the real button switches the whole wand’s power. On a small screen, scroll the diagram sideways.

The LED resistor sets the current.

An LED doesn’t limit its own current to a useful value. Connected directly across a battery, it can take too much and burn out. A series resistor limits current: more resistance usually means less current and a dimmer light. The supply voltage, LED’s forward voltage and resistor value all matter. Each independently driven LED path needs its own current limiting.

Approximate current = (supply voltage − LED forward voltage) ÷ resistance
Example: (4.2 V − 3.0 V) ÷ 470 Ω ≈ 2.6 mA

The example ignores the small MOSFET voltage drop and uses an assumed 3.0 V LED. Red and blue-green LEDs can have different forward voltages, so 470 Ω is this board’s value rather than a universal answer. Calculate for the highest battery voltage and your actual LED. The Arduino Blink tutorial also explains current limiting.

Two different jobs for gate resistors.

The 100 kΩ resistors in my schematic are pull-downs, connected from each gate to ground. During startup, a chip’s pins can be high impedance—effectively disconnected. The pull-down gives the gate a definite LOW level so it doesn’t float and accidentally turn a light on.

A series gate resistor is different: it sits between the microcontroller pin and the gate. The gate behaves a little like a capacitor, so this resistor can limit the short charging pulses and tame ringing on a fast edge. My pictured circuit drives the gates directly; it has pull-downs, but no separate series gate resistors. Neither gate resistor replaces the LED’s current-limiting resistor.

For a similar board, choose MOSFETs specified to work at your lowest gate voltage and expected current. The schematic uses dual BSS138-family parts, but check the data sheet for the exact part you buy.

04 / Draw it, then fit it

The small board
inside the handle.

I used EasyEDA to draw the schematic and lay out the PCB—the printed circuit board. The schematic describes the connections. The board layout turns those connections into copper tracks and pads, arranged to fit the prop.

The two 0.1 µF capacitors shown across VCC and ground help decouple the power supply. Keep decoupling close to the chip’s power pins in a new layout. The output connection has one shared positive supply and six switched returns, one for each light channel.

ATtiny1604 power and pin schematic with six LED control signals and two 0.1 microfarad decoupling capacitors.
The controller and power connections. Open full size ↗
Six low-side MOSFET channels with 470 ohm LED resistors and 100 kilohm gate pull-downs.
The six LED channels. 470R means 470 Ω; 100K means 100 kΩ. Open full size ↗
EasyEDA board layout with the ATtiny1604, battery connection, LED pads, resistors, MOSFETs and red and blue copper tracks.
My EasyEDA PCB layout. The chip’s numbered pads and track labels help connect this view back to the schematic. Open full size ↗
A tiny prototype board resting on fingertips, with a black microcontroller and fine blue and white wires.
An early prototype board, held on my fingertips. This is the prototype stage from the build journal.
The wand head separated from its handle, exposing fine wires and a small circuit board at the joint.
Wiring before the last seam closed. The build journal covers the battery and USB-C charging.

To try PCB design: EasyEDA’s official quick start and schematic-to-layout guide.

05 / The lighting sketch

Six lights.
A little choreography.

An Arduino program is called a sketch. Mine names the pins, sets the animation timings, runs a startup sequence once, then repeats the gem animation. The physical button supplies power, so the sketch doesn’t read a button input.

Pin assignments in SailorWand.ino
LightChip pin nameSketch constant
CrownPA4PIN_PA4
Gem 1PA5PIN_PA5
Gem 2PB2PIN_PB2
Gem 3PB1PIN_PB1
Gem 4PB0PIN_PB0
SymbolPA3PIN_PA3

Start with everything off.

setup() makes the six pins outputs and sets them LOW or to zero brightness. After a 200 ms pause, the lights come on in order: crown → gems 1, 2, 3, 4 → symbol, 250 ms apart. Each stays lit as the next appears.

Let the four gems shimmer.

loop() repeatedly calls rotatingGemAnimation(). The crown and symbol stay on. Each gem follows the same triangular fade, shifted by a quarter of a cycle, so their brightness dips move around the head.

Change brightness with time.

analogWrite() uses PWM here: the MOSFET switches quickly on and off. Changing the fraction of each pulse that is on changes the apparent brightness. The LED resistor still limits current during each on pulse.

Repeat without a long script.

The 8-bit phase counter wraps from 255 back to 0. Each gem gets an extra 64 counts of phase offset. calculateBrightness() makes a falling-and-rising ramp. These are overlapping fades, rather than one isolated dip at a time.

startupDelay = 250Milliseconds between lights turning on.animationStepDelay = 3Milliseconds between fade updates.minimumBrightness = 35Sets how deep the brightness dip is.

At the supplied settings, the 256-step fade cycle takes roughly 0.77 seconds plus processing time. Integer rounding means the lowest written brightness is 36, close to the setting of 35. Increasing the step delay slows the shimmer. Where each gem is wired around the head determines how its motion looks on the physical prop.

This is the original sketch I supplied for the build, with its comments and pin names unchanged. Open it with megaTinyCore and ATtiny1604 selected. Choose the clock for your actual supply, as explained above.

Download SailorWand.ino
06 / Describe what you want

Ask for a sketch
with the hardware included.

ChatGPT can help turn a lighting idea into a first sketch. Give it the exact chip, Arduino core, pin assignments, and the sequence you want to see. Include your schematic or existing sketch if you have one. Clear instructions and relevant context are the starting point in official OpenAI documentation.

Here is a prompt for something similar to this wand. You can change the timings or describe a different effect.

Compile the result for the right chip and core, compare every pin with your wiring, and test one light channel before running the full sequence. If it fails to compile, give ChatGPT the exact compiler error and your selected board settings. If the hardware behaves differently, describe what each light actually does. A generated sketch is a starting point to check on your board.

Making a little light of your own?

The Sailor Neptune build journal covers the printed parts, mirror, finishing and the story behind the two wands. You’re welcome to ask me about the electronics, too.