![]() |
KiCADKicad
|
|
|
KiCAD Round Tracksmixtela
|
ATtiny Toy Soundbox
This device can be embedded into a toy and programmed to play beeps, sirens, musical notes, ambience or even animal sounds!
Inspired by this post at the !adhdwomen@lemmy.world community. The goal is a cheap, small standalone device that can play an NES chiptune at the push of a button.
The cheapest AVR chip is the ATtiny13, which only has 1 timer for PWM. Therefore, waveforms are synthesized in software each 128 clock cycles at 9.6 MHz and played using 7-bit PWM at 62500 Hz on the OCR0B channel. (The number and complexity of emulatable channels, as well as bit depth, will always be a trade-off against sample rate, selected by OCR0A=127 in my case.) The PWM signal is amplified using a 2-transistor class D amplifier and passed through a low-pass filter into a small speaker. Schematic based on Class D Amplifier for the Arduino by Matthew Dunn at Silicon Junction but tuned for higher volume and higher efficiency using a low-impedance speaker, as it is intended to have the device powered with 3 AA or AAA batteries thanks to the ATtiny's excellent low-power options. If cut aggressively (approx. 0.75 mm from pads and allowing components to overhang), the design can fit into 50x16 mm, making it possible to tile 12 of them in on a standard 100x100 mm board!
The following waveforms can be generated: square, triangle, sawtooth, noise. The processible number of channels depends on clock cycles alloted per sample. With more Flash memory available on the ATtiny85, you can even make lookup tables for a sine wave or custom samples such as instruments or animal sounds.Currently, 8-pin ATtinys in a SO-8/SOP-8 or DIP package are supported. Multiple channels and even tracks can be played at once to achieve polyphony but not much can be done with 4 buttons. You can always modify the device for an ATmega with 28 pins and up to 20 MHz, though, and/or use a serial interface (MIDI or PS/2?) to connect a keyboard.
Code on my GitHub page (WIP), I plan to make a converter of NES tracks into the compressed format readable by this device.
ATtiny Toy Soundbox
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.

Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW
ESP32-S3 4.3inch Capacitive Touch Display Development Board, 800×480, 5-point Touch, 32-bit LX7 Dual-core Processor
BUY NOW
Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW- Comments(0)
- Likes(0)

- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Chaotic Neutral Czech
-
-
Commodore 64 1541-II 1581 Floppy Disk Drive C64 Power Supply Unit USB-C 5V 12V DIN connector 5.25
195 1 3 -
Easy to print simple stacking organizer with drawers
93 0 0 -
-
-
-
-
-
-
Modifying a Hotplate to a Reflow Solder Station
1166 1 6 -
MPL3115A2 Barometric Pressure, Altitude, and Temperature Sensor
655 0 1 -