Jump to navigationJump to search

ATtami based low cost sound player/amplifier


a design for a minimlastic WAV player

we found the market missing a simple board including:

/ speaker\
|   amp   |
| player  |
|rtc | mem|
|   MCU   |
| charger |
| battery |
|USB plug |

  • minimal design, the basic requirement is for
  • playing a WAV audio file
  • memory
  • press of button
  • at set time with trigger from the RTC (real time clock).
  • chargeable with a lipo battery over 5v usb plug
  • amplified
  • speaker




  • arduino pro mini

will need to mod it to enable sleep modes)

charging circuit


some more ideas


what size we need?
10min is 50mb in WAV

  • SD module


  • SD card

~2$ for 4gig


  • parts-express [1]
  • 4ohm


3W full range, AE link ebay


  • PAM8403 Digital Amplifier Board 2*3W Class-D

the problem with this one, its expects 6V in.


  • PAM8013 (MONO)- wider range of input (2.8-5.5v) , PAM8603 - same as PAM8013 but stereo

octopart link datasheet package


module including battery



further reading

reading about playing WAV files without an encoder IC using DAC arduino capabilities

  • guy Ovadia wrote an Analysis of a minimalistic PWM DAC for

low-cost 8-bit microcontrollers PDF

ATmega382 / uno

SimpleSDAudio this looks like it


high end thing



ATtami/elmchan version [on hold]

ATtiny85 based solution, as we are following elm-chan path, might be worthwhile to look over his explanation of SDcard read/write
github for elmchan

this is current connections


sadly, cant run the sd8p hex files without killing the current ATtami bootloader :(

$ micronucleus --run sd8p_mo.hex 
> Please plug in the device ... 
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 33% complete
> Device has firmware version 1.11
> Available space for user applications: 6330 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 99  page size: 64
> Erase function sleep duration: 792ms
parsing: 50% complete
> Program file is 426 bytes too big for the bootloader!

trying to upload the hex files using ISP also fails with "out of range" error
note im using avrdudess on windows, but similar problem on avrdude.

sd8p_mo.hex: 6,759 / 8,192 Bytes (82.51%)
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 

avrdude.exe: set SCK frequency to 1500000 Hz
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e930b
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: set SCK frequency to 1500000 Hz
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: reading input file "U:\Downloads\sd8p_mo.hex"
avrdude.exe: input file U:\Downloads\sd8p_mo.hex auto detected as Intel Hex
avrdude.exe: ERROR: address 0x820003 out of range at line 426 of U:\Downloads\sd8p_mo.hex
avrdude.exe: read from file 'U:\Downloads\sd8p_mo.hex' failed

SOLVED: erase last three lines at hex file via avrfreaks

fuse set to 16Mhz internal

#USEOPT_t85 = -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m
#FUSEOPT_t85_DISABLERESET = -U lfuse:w:0xe1:m -U efuse:w:0xfe:m -U hfuse:w:0x5d:m
avrdude -c usbasp -p t85 -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m

load hex

 avrdude -c usbasp -p t85 -U flash:w:sd8p_mo.hex:i

prepare Audio

"The SD audio player supports only RIFF-WAVE format sound files known as Microsoft wave file in LPCM, 8/16-bit, mono/stereo and upto 48kHz sampling rate"

ffmpeg -i "input.mp4" -vn -acodec pcm_s16le -ar 16000 -ac 1 -f wav OUTPUT_FILE.WAV

Petit FatFs

Petit FatFs appnotes

based on

sd8p_hr.png mono (HI-res)