Add a buzzer (beeper) to the router
A buzzer or beeper is an audio signalling device tipically used for alarms or timers. They need an oscillating circuit to make them work. Fortunatelly there are in the market buzzers with the oscillating circuit already built in. These buzzers with the oscillating circuit included are usually called:
- Active buzzers
- Self-drive buzzers
- DC buzzers
They are commonly made with a piezoelectric buzzer plus the oscillating circuit. They work with a DC power source and the typical current consumption is about 10 mA.
The drawback of these active buzzers is they make beeps with a fixed frequency, about 2.3 kHz.
Feed the buzzer with a transistor
We can connect the buzzer to a LED GPIO driven on the router. Depending on the type of LED, active low or high, we will use a PNP or NPN transistor to feed the active buzzer. Almost any transistor should work since a buzzer doesn't require much current to work.
Most routers use use active LOW leds connected to GPIOs. Check both pins of the led, if one is connected to Vcc then it's an active low LED, if connected to GND then it's active HIGH.
Active low circuit
Active high circuit
Example
Connect directly the buzzer
It could be also possible to connect directly the buzzer in parallel with the led. This can be possible if the buzzer doesn't need more than about 2mA to work.
Of course it could also be possible to attach the buzzer to a free GPIO. GPIOs usually can supply about 4mA safetly. An active high circuit should be used in this case:
It's also possible to atach the buzzer directly to the gpio, but the buzzer shouldn't draw more than 4 mA
If you draw more current from the GPIO beyond its capacity, you could damage the SoC.
Make some beeps
Since the buzzer is connected to a configurable LED on the router, they will be controlled together. Just configure the LED where the buzzer is soldered via Luci web interface, or use the sys filesystem interface.
Examples:
echo timer > /sys/class/leds/MYLED/trigger echo oneshot > /sys/class/leds/MYLED/trigger echo 1 > /sys/class/leds/MYLED/shot echo morse > /sys/class/leds/MYLED/trigger echo "SOS" > /sys/class/leds/MYLED/message echo 1 > /sys/class/leds/MYLED/brightness echo 0 > /sys/class/leds/MYLED/brightness