Close

Hardware Prototyping

A project log for Metronalmost

A metronome that beats at almost, but never quite exactly, 60 beats per minute.

mike-coatsMike Coats 07/07/2025 at 19:500 Comments

The core component this project is designed around is a TowerPro MG946R servo motor.
It's weighty enough that it will stay where it's placed - even when the servo's horn is waving our metronome-hand around. I built a prototype of the electronics and placed a case made from scrap cardboard over the servo and circuitry, like a cloche.


The servo is quite happy to operate from the 5 volts supplied by the USB connector on the NodeMCU DevKit. It doesn't seem to draw enough amps to trip the supply or brown-out the microcontroller. The 3.3 volts supplied by the ESP8266's GPIO pin is high enough to be considered "on" by the servo's control board, so we don't need to do any level shifting.

The only problem in assembling the metronalmost's electronics is there are no adjacent pins on the DevKit to allow Ground, Power and Signal to be directly connected to the servo's socket. Instead, we can use a 1x1 right-angled header pin to create a "false pin" and connect it to one of the GPIO pins with a short jump wire.

The ESP8266 can now be flashed with MicroPython, and we can test the Servo's range of motion with a small script.

from machine import PWM, Pin
from time import sleep

out_pin = PWM(Pin(2, mode=Pin.OUT))
out_pin.freq(50)
out_pin.duty(35)

while True:
    out_pin.duty(30)
    sleep(1)
    out_pin.duty(40)
    sleep(1)

Discussions