October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
ThatPainter
Arduino

Creating an Arduino-Powered Wizard Staff: LEDs, Sound, and Fortune Display

A practical guide to an Arduino-powered wizard staff, including corrected trigger wiring, safe LED power, LCD setup, code structure, construction, and troubleshooting.

By ThatPainter Team 9 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

ThatPainter is reader-supported. When you buy through links on our site, we may earn an affiliate commission. Learn More

Build a staff that glows, plays a tone, and reveals a fortune when you press a button—or, with a little extra tuning, when you tap or move it. The design uses a classic 5 V Arduino Nano, a 60-pixel WS2812 strip, a 16×2 I2C LCD, and a passive buzzer. Treat it as an intermediate prop build: the original project is a Hackster showcase rather than a fully documented tutorial, and its description says vibration-triggered while its posted code actually reads a button.

What the staff does—and what the original code triggers

The intended sequence is a rainbow idle animation, a “thinking” message, about three seconds of white LED motion, then a randomly selected fortune. Positive, negative, and neutral fortunes use different LED colors and buzzer tones; the message scrolls across the LCD before the staff returns to idle. Those behaviors are described or implemented in the original project, published January 2, 2025.

There is an important mismatch: the project description names an SW-420 vibration sensor, but its code calls pin 5 BUTTON_PIN, configures it with INPUT_PULLUP, and waits for a LOW reading. That is a button input, not a direct reading of the vibration module. For a dependable first build, use the button. Add the SW-420 only after the rest of the prop works.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Parts and board choice

  • One classic 5 V Arduino Nano (or compatible Nano), one 60-pixel WS2812/NeoPixel-compatible strip, and a 16×2 character LCD with an I2C backpack.
  • One passive piezo buzzer, one SW-420 vibration module if you want motion triggering, and one pushbutton for the reliable trigger option.
  • A regulated 5 V supply sized for the LED load; a fuse or current-limited supply for a handheld build; a bulk capacitor across the strip’s 5 V and ground near its input; and a small series resistor in the data line, particularly for a long or noisy run.
  • Hookup wire, connectors, heat-shrink, mounting hardware, and an enclosure. The original uses a food-storage container; a removable electronics pod is easier to service.
  • A staff core such as wood, PVC, acrylic tube, or foam-coated tubing, plus a translucent diffuser or cap to soften individual LED points.

The classic Nano is 45 × 18 mm and uses a Mini-B USB connector; its board and pin assumptions are the closest match to this design. Arduino’s Nano documentation distinguishes it from newer Nano Every, Nano 33, Nano ESP32, and Nano R4 boards. Do not assume those are drop-in replacements: logic voltage, pin behavior, bootloader, and WS2812 signaling may differ.

#1 Best Overall
Sale
KEYESTUDIO 48 Sensors Modules Starter Kit for Arduino with LCD, 5v Relay, Sound, LED Modules, Servo Motor, Motion, Pressure Sensor, Gas Sensor, etc.Programming for Beginners Adults Learning
  • This electronic sensor kit contains 48 pieces most popular and mainstream sensors and modules, allow you to do a lot of devices, robots and other interactive projects. This kit Not contains arduino controller board.
  • Compatible with various micro-controllers and Raspberry Pi, such as mega 2560, r3 development board, pro micro, leonardo, etc. Note we only offer arduino instructions.
  • We provide detailed projects for each sensor based on development board, including wiring method, test code, etc. Download the arduino tutorial from the wiki website.
  • This is complete sensor kit with exquisite packaging. It's a good electronics kit for junior high and high school inventors, hackers, designers, and tinkerers of all levels.
  • The tutorials show wiring for the Arduino and give example codes. All of this makes getting started with sensors quite easy. The professional team is ready to answer any questions.

Wire the circuit with a separate LED power path

Use this pin plan for a classic Nano. All grounds must be joined, but the strip’s LED current should not pass through the Nano board.

Function Nano connection Other connection
LED data D6 Strip DIN (observe the strip’s direction arrow)
Trigger D5 Button to GND, or SW-420 digital output
Passive buzzer D4 Buzzer positive; buzzer negative to GND
LCD I2C A4 SDA, A5 SCL LCD SDA, SCL
Common ground GND Nano, strip supply, LCD, trigger, and buzzer grounds
LED supply Do not route through Nano 5 V Regulated 5 V to strip +5V; supply ground to strip GND

For the button, connect one terminal between D5 and GND; with INPUT_PULLUP, the idle reading is HIGH and a press reads LOW. For an SW-420 module, connect its supply and ground as marked on the module and its digital output to D5. Module polarity is not universal: observe whether movement produces HIGH or LOW before selecting the trigger condition.

Adafruit’s NeoPixel guidance uses 20 mA per pixel as a practical animation-planning rule and up to 60 mA per pixel for full-brightness white. For 60 pixels, that is roughly 1.2 A by the rule of thumb and up to 3.6 A in the worst-case white condition—not a measured draw for this staff. The source sketch caps brightness at 50/255, which helps, but size the supply for the effects you may actually enable, not a software limit you might later change. See Adafruit’s NeoPixel power guidance.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Stemedu LM393 Sound Sensor Module - High Sensitivity Microphone Sound Detection Sensor with 3.3-5V Digital Onboard Potentiometer Led Indicator for Ar-duino (Pack of 5)
  • This is a LM393 Sound Detection Sensor Module for Ar duino to detect whether sound has exceeded a threshold value. The sound is detected via microphone and fed into an LM393 op-amp.
  • Working voltage: DC 3.3-5V;Sound detected LED: The signal light when there is sound
  • Main Chip: LM393, Electret condenser microphone
  • Document link: https(:)//drive(DOT)goo(-)gle(DOT)com/open?id=1N3nr2m25jU2xqbqBTnGvhL9j5vlGCO2N
  • Note: This microphone sensor only recognizes the availability of sound cannot identify the size of the sound or the specific frequencies of sound.

Install the software and upload to the Nano

Install Arduino IDE from the official download page. The page showed IDE 2.3.10 on August 18, 2026; the version may change. Install the libraries through Tools → Manage Libraries: search for and install FastLED, then install a LiquidCrystal_I2C library compatible with your LCD backpack. FastLED’s official repository documents Library Manager installation and classic Arduino support. The built-in Wire library handles I2C.

  1. Connect the Nano by USB and open the sketch.
  2. Choose Tools → Board → Arduino AVR Boards → Arduino Nano for a classic Nano. Board-package labels can vary.
  3. Choose the processor setting for your board. Try ATmega328P; if a compatible clone will not upload, try ATmega328P (Old Bootloader).
  4. Select the serial port for the connected board, compile, then upload. If upload fails, verify the board, port, USB cable, and processor setting before changing the wiring.

The source sketch declares LCD address 0x27, but that is not universal. If the LCD is blank or unresponsive, adjust its contrast and run an I2C scanner; 0x3F is another common backpack address. Backpacks and LCD libraries can also differ in compatibility.

Test each subsystem before assembling the staff

  1. Upload a basic Nano sketch and confirm the board communicates over USB.
  2. Connect the LCD and display a short test line. Check its address and contrast before adding scrolling text.
  3. Test a short LED section first. Verify the data wire reaches DIN, the supply is regulated 5 V, and Nano and LED-supply grounds are common.
  4. Use a passive buzzer for variable-pitch tone() output; an active buzzer generally cannot reproduce the changing pitches as intended.
  5. Test the button input. For an SW-420, watch the digital output while tapping the sensor and adjust its potentiometer until ordinary handling does not trigger it constantly.

Only combine the modules after each works independently. Then test the complete circuit on the bench before enclosing it, where loose connections and power problems are harder to reach.

Rank #3
DIYables 10mm LED Module for Arduino, ESP32, ESP8266, Raspberry Pi - 5 Pack
  • 5PCS 10MM LED MODULES: Includes 5 bright 10mm LED modules - one each in Red, Yellow, Blue, Green, and White - perfect for DIY electronics and indicator applications.
  • PREASSEMBLED FOR EASY USE: Each LED is pre-mounted on a mini PCB with pins, ready to connect to Arduino, ESP32, ESP8266, Raspberry Pi, or other microcontrollers without soldering.
  • WIDE VOLTAGE COMPATIBILITY: Operates with 3.3V to 5V systems, making it easy to integrate into various development platforms and projects.
  • IDEAL FOR DIY & PROTOTYPING: Great for signal indicators, status displays, smart projects, IoT devices, and educational electronics setups.
  • TUTORIALS PROVIDED: Online tutorials for Arduino, ESP32, ESP8266, and Raspberry Pi are provided - perfect for beginners, students, and makers.

Choose a trigger that behaves the way you want

Button: predictable activation

A button on D5 is the behavior the posted source code implements. It is easy to test and reliable during a demonstration. Keep the button accessible on the grip or enclosure, and ignore new presses while a fortune sequence is running.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

SW-420: concealed but sensitive

The vibration module can make the prop feel more magical, but it may produce repeated transitions from one movement or trigger when the staff is merely handled. The digital output’s active level depends on the module and its adjustment, so test the level rather than assuming HIGH means motion. Use a brief confirmation window, prevent retriggering during the effect, and add a cooldown afterward. Mount the sensor firmly; a rattling mount makes detection less predictable.

More controlled gestures

A tilt switch is simple but depends on orientation. An accelerometer can distinguish deliberate gestures more effectively, but requires different wiring and code. Neither is part of the original pin-for-pin build.

Rank #4
DIYables RGB LED Module for Arduino, ESP32, ESP8266, Raspberry Pi, 10 Pieces
  • RGB LED module with built-in resistors
  • Common cathode
  • Generating PWM to R, G, B pins to create any color.
  • RGB LED for Arduino, ESP32, ESP8266, Raspberry Pi, or any 5V or 3.3V microcontroller.
  • Tutorials for Arduino, ESP32, ESP8266, , Raspberry Pi,, Raspberry Pi, Pico, and MicroPython are provided => Search for: DIYables RGB LED module

Organize the sketch so the staff can be extended

The source code uses delays during animation, sound, and scrolling, so the controller cannot respond to a new input while those pauses run. That is acceptable for a simple one-trigger prop. For responsive controls, use elapsed-time checks with millis() and separate the behavior into small routines, for example:

  • runIdleAnimation() and runThinkingAnimation() for lighting states.
  • triggerDetected() for button or sensor logic, including debounce and cooldown.
  • chooseFortune() and showFortune() for selection and display.
  • playPositiveSound(), playNegativeSound(), and playNeutralSound() for category-specific tones.
  • resetStaff() to clear the display and return to idle.

Keep hardware settings together so they are easy to change:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
constexpr uint8_t LED_PIN = 6;
constexpr uint8_t TRIGGER_PIN = 5;
constexpr uint8_t BUZZER_PIN = 4;
constexpr uint8_t NUM_LEDS = 60;
constexpr uint8_t LCD_ADDRESS = 0x27;
constexpr uint8_t MAX_BRIGHTNESS = 50;

The original behavior uses a 30 ms idle-animation delay, a three-second thinking effect, and an eight-second wait after displaying a fortune. Its positive tones are 1,000 and 1,200 Hz for 300 ms each; negative tones are 500 and 400 Hz for 300 ms each; neutral tones select a frequency from 500–1,500 Hz for 300 ms. These are starting values from the project, not requirements. If you seed the pseudorandom generator with randomSeed(analogRead(A0)), a floating A0 may give visual variety between starts, but the result remains pseudorandom rather than cryptographically random.

Best Value
VKLSVAN 5PCS High Sensitivity Sound Microphone Sensor Detection Module for Arduino AVR PIC
  • Working voltage 3.3V-5V;Adjustable sensitivity (adjusted by the blue digital potentiometer in the picture);Output form Digital switch output (0 and 1 high and low levels);Equipped with fixing bolt holes for easy installation; Small board PCB size: 32mm * 17mm
  • The sound module is most sensitive to the intensity of ambient sound and is generally used to detect the intensity of ambient sound.
  • When the ambient sound intensity does not reach the set threshold, the module OUT outputs a high level. When the ambient sound intensity exceeds the set threshold, the module OUT outputs a low level;
  • The digital output OUT of the small board can be directly connected to the microcontroller, and the high and low levels can be detected by the microcontroller to detect the ambient sound;The digital output OUT of the small board can directly drive the relay module, thereby forming a voice-controlled switch;
  • VCC is connected to an external 3.3V-5V voltage (can be directly connected to a 5V microcontroller and a 3.3V microcontroller); GND is connected to an external GND; OUT is the small board switch output interface (0 and 1).
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Make the LCD readable and reliable

A 16×2 display holds only 16 characters on each row. The original project scrolls long fortunes across the first row and displays each message twice. When writing your own display routine, clear or pad both rows before showing a shorter message so characters from the previous fortune do not remain. Handle text of 16 characters or fewer as a separate case rather than calculating a scroll range that can become negative. Test the LCD library and backpack together before mounting the screen; an OLED is an alternative if you want more flexible text rendering, but it needs different code and mounting.

Build a serviceable, balanced prop

  1. Choose a rigid staff core and place the battery and electronics pod where their weight will not make the staff top-heavy.
  2. Route the LED strip along the core and add a diffuser to soften individual pixels. Use both suitable adhesive and mechanical retention; adhesive alone may release with heat or handling.
  3. Mount the LCD behind a protected window where it remains readable, and put the power switch somewhere reachable without opening the enclosure.
  4. Keep power and signal wiring orderly, use flexible wire near grips or moving joints, and add strain relief where cables enter the pod.
  5. Make the electronics pod removable for repair and battery replacement. Insulate every solder joint and connector, and provide ventilation if the build includes a regulator or boost converter.

Power and handling safety

Use a regulated 5 V source; excess voltage can damage WS2812 LEDs. A USB power bank is convenient, but some models shut off when the load is low, which can happen during a dim idle effect. A battery system must account for LED current, runtime, converter losses, and heat. For example, Adafruit’s PowerBoost 1000C is a possible single-cell conversion option, but its 1 A output rating is not suitable for unrestricted full-white operation of 60 pixels. Do not treat it as an all-effects power solution.

Use a fuse or current-limited supply, protect battery connections, and do not leave exposed high-current contacts near metal costume parts. Charge lithium cells with appropriate charging hardware and follow the cell maker’s handling guidance. Never connect an unregulated supply to the strip, and keep mains-powered supplies outside the handheld prop.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshooting

Symptom Likely cause What to check
Nano will not upload Wrong board, port, processor, or USB connection Recheck board and port; try Old Bootloader on a compatible clone.
LCD is blank Wrong I2C address, contrast, wiring, or power Adjust contrast, run an I2C scanner, and verify SDA, SCL, and ground.
LCD shows blocks only Power is present but initialization failed Check the address, library, and backpack compatibility.
LEDs flicker or show incorrect colors Supply sag, missing common ground, wrong data direction, or noisy data Use a suitably rated regulated supply, join grounds, verify DIN, and improve the data wiring.
Only the first LED works Damaged first pixel, poor solder joint, or broken strip section Inspect the first pixel and connections; test a known-good section.
Staff triggers repeatedly Sensor chatter or lingering vibration Add debounce and cooldown, then adjust and secure the sensor.
Buzzer is very quiet Wrong buzzer type or limited drive Use a passive buzzer; for louder hardware, use a suitable transistor driver.
Fortunes repeat Unseeded or limited pseudorandom behavior Seed the generator for startup variety; repeated results can still occur.
LCD text is corrupted Wiring noise or incompatible library/backpack Test the LCD alone and shorten or tidy its I2C wiring.
Nano resets when LEDs change Shared supply voltage sag or electrical noise Separate the strip’s high-current path, improve the supply and grounding, and place the capacitor near the strip input.

Customize the magic

Edit the fortune arrays, category colors, tone sequences, brightness, and animation speed to suit the character of the prop. Keep brightness conservative for battery life and heat, especially when the staff is enclosed. A shorter strip reduces power demand and weight. An OLED, accelerometer, or more elaborate spell-casting gesture can be added, but each changes the wiring or software rather than simply extending the original sketch.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

More from the Paint Desk

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.