logo elektroda
logo elektroda
X
logo elektroda

Creating a Custom Melody on a Self-Assembly Music Box Kit (AVT2811 Board)

kapcieZpuszkiem 31986 21
Best answers

How can I upload my own melody to an AVT2811 self-assembly music box kit?

You can make the AVT2811 play your own melody by using the melody editor from the project materials, generating the file, replacing the original software file, and compiling everything with WinAVR and the provided start.bat to produce a HEX file for the microcontroller [#9733525] The author also pointed to the project materials at `http://edw.com.pl/ftp_05/200702avt2811.zip` and said the song-composition program is available at `www.elportal.pl` [#9733525] Another reply confirmed that the link contains the needed files and editor, and that you then program the microcontroller with the generated HEX [#9837615] Since the music box has no programming connector, the microcontroller must be programmed outside the device, so you need an AVR ISP programmer and usually a socket or test setup for the chip [#9839037]
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 9720873
    kapcieZpuszkiem
    Level 10  
    Hello.
    I posted this topic here because I have no idea about electronics and I need help.
    My problem is that I need to construct a music box with my own melody, for which of course I have sheet music.
    Some time ago I bought a self-assembly kit online, on the AVT2811 board. It was submitted to me by my father, but he withdrew from further cooperation, unfortunately. So the music box works, but with the melody already programmed.
    Do you know a way where I could upload my melody?
    It may be a different arrangement. I think it will be a very interesting challenge.
    Maybe it doesn't look like it, but it's really important to me because it would be a gift for my friend, our hit from, well, probably 10 years ago, memories in a nice frame. I already have everything planned, only this melody...
    I will be very grateful for your answer and any help.
    Kind regards, Monika.

    Ps. I don't know if I posted the topic in the right place. Please let me know if this is the case and I will correct the error as soon as possible.
  • ADVERTISEMENT
  • #2 9721915
    vodiczka
    Level 43  
    As can be seen from the description below, it is possible to upload your own melody.


    AVT2811 A+ ELECTRONIC PASS - PRINTED BOARD AND PROGRAMMED CIRCUIT PLN 20.00
    The music box is a container for storing small items, e.g. jewelry. After opening it, the sounds of your favorite song are heard, additionally they are accompanied by colorful flashes. The bottom of the music box is illuminated with four colorful, super bright LEDs.
    Along with the project, two special, easy-to-use editors were prepared. With their help, the manufacturer of the device is able to create his own melodies and lighting systems. In this way, the music box can become, for example, an interesting gift, tailored individually to the preferences of the recipient. The shape of the board is selected so that the system can be easily installed in a round container - a metal box.

    The device is especially recommended for electronics enthusiasts who like to prepare interesting gadgets and gifts on their own

    Selected parameters:

    o switching on the device - contactless, phototransistor
    o light source - four multi-colored, high-efficiency LEDs
    o sound transducer - piezo
    ocontrol - ATTiny series microprocessor
    o[b]two editors for custom composition of melodies and lighting systems obattery powered
    o minimal power consumption in inactive state
    o power supply - 3 Vdc
    o the set includes a printed circuit board, programmed circuit and documentation

    A version with a set of elements for self-assembly AVT2811 B is available


    Detailed description in EdW 2/07

    Added after 6 [minutes]:

    I found a statement by the author of the music box and his e-mail address, I attach.
    Ask him to explain how to get the editors if they are not included in the kit.

    What is it for?
    The music box is a storage container
    small items such as jewelry.
    When you open it, you will hear the sounds of your favorite
    the song it will accompany
    a riot of lights. The bottom of the music box is illuminated
    is four colored, super bright LEDs
    LED. I share with the project
    two special, easy-to-use editors that allow
    easy to create your own melody
    and the light effect, because every gift should
    have an individual accent, be unique,
    just like the recipient.
    Jakub Borzdyński
    jotbeage(_at_)interia.pl
  • ADVERTISEMENT
  • #3 9722337
    kapcieZpuszkiem
    Level 10  
    Thank you very much for the hint. I have already written a message to this gentleman, I hope that the problem will be solved soon :)
  • #4 9733525
    kapcieZpuszkiem
    Level 10  
    OKAY. I got a response from the author that reads as follows:

    Hello.
    The program for composing songs is available at www.elportal.pl. You should generate a file using it, replace it with the file that is in the original software and compile the whole thing. The compilation boils down to installing the WinAVR package and running the start.bat script.
    The compilation will generate a HEX file, which should be used to program the microcontroller. And that's basically it. An article describing AVR programming was a ready-made batch in one of EdW's issues, unfortunately I don't remember which one...
    Additional materials for the project are available here: http://edw.com.pl/ftp_05/200702avt2811.zip

    And information that it will be possible to contact him only after 24.07, because he left.
    And I'm in a hurry, I have until 30.07 :(

    I already have this program for composing songs, I found some article about music boxes and it's still a hocus-pocus for me.
    http://www.edw.com.pl/pdf/K06/23_06.pdf

    How do I get this tune into this weirdness??? With what? What do I need to do this?

    I AM ASKING FOR HELP!
  • #5 9734269
    vodiczka
    Level 43  
    sorry but I will not help further, your music box is very sparsely described (no diagram) and a different construction than the one in the article you quoted. Good luck.
  • #6 9734283
    Sabre
    Level 18  
    If you have a record of the melody you want to upload to this music box in the form that the notes were once typed into phones, I can help you program the microcontroller. Except that I would write my own program in Bascom because I know it and it would take me a moment. The music box is not very complicated, ATtiny2313, buzzer and some LEDs. It is not difficult to decipher the pin connections to individual components. I just hope the microcontroller is on the stand.

    Enter the title and artist of the melody you want to upload. My guess is that the music box starts playing when it's lit, when it's in a dark box/room it's not playing. I still have to check because maybe I have Edw from February 2007 at home, or I can have AVT on the disc.

    Alternatively, you need to look for someone from your town who knows C and programs AVR microcontrollers.
  • #7 9734408
    kapcieZpuszkiem
    Level 10  
    Ok, I added photos of what the board looks like from both sides. I'm looking for a detailed description.

    I am also sending the melody and written notes, I hope you will be able to use them.

    I know that working with me is not easy, but seriously - I have no idea what all these avrs, attins, etc. mean, so unfortunately the "like a peasant in between..." method will work best here.
    Attachments:
    • Nuty_Dare_Me_wokal_refren_pdf.pdf (65.78 KB) You must be logged in to download this attachment.
  • #8 9734433
    kapcieZpuszkiem
    Level 10  
    here cd - photos
    Attachments:
    • Creating a Custom Melody on a Self-Assembly Music Box Kit (AVT2811 Board) DSCF9223.JPG (1.25 MB) You must be logged in to download this attachment.
    • Creating a Custom Melody on a Self-Assembly Music Box Kit (AVT2811 Board) DSCF9219.JPG (1.25 MB) You must be logged in to download this attachment.
  • #9 9734451
    Sabre
    Level 18  
    Unfortunately, I don't know the notes :/ and I can't "translate" it into the notation required by my program. After work, I will look for the notation of the notes as in the old telephones, where the ringtone was introduced by composing "notes".
  • ADVERTISEMENT
  • #10 9734468
    kapcieZpuszkiem
    Level 10  
    I'm trying to add a melody, but I can't... I don't know why.
    Can I email?
  • #11 9734483
    Sabre
    Level 18  
    Unfortunately, the melody won't help me, you'd need a musician who would translate the notes into this notation:
    Creating a Custom Melody on a Self-Assembly Music Box Kit (AVT2811 Board)

    I found a few articles on this subject and I think I can handle translating the notation into the notation I need, it's actually not that difficult. I will try to translate it today and upload it to the microcontroller, I will record the sound and send it to you so that you can evaluate the effect.
  • #12 9734594
    kapcieZpuszkiem
    Level 10  
    Yeah, I don't have that record unfortunately :(
    I don't even need all of these notes, I only care about the first three on the second stave, the rest is unimportant.
  • #13 9734606
    Sabre
    Level 18  
    I've done some reading, and I'll probably be able to translate it into the notation I need. I'll try to put it on one of my robots later today and record the sound the buzzer makes. If it resembles this melody, I'll easily upload it to your music box.
  • #14 9734692
    kapcieZpuszkiem
    Level 10  
    I'm so happy that it can actually work :) ))))
  • #15 9738155
    Sabre
    Level 18  
    However, it's not that simple, I'm not a musician, I changed the notes to letter notation, but it doesn't sound like the original. There are some dots or dashes next to the notes that I can't decipher. I even started a topic on some music forum with a request to translate these notes, but so far no response.
  • ADVERTISEMENT
  • #16 9741894
    Sabre
    Level 18  
    I have good news :) , the notes have been "translated" into the notation I need, when I come back from work I will check the effect right away and I will know today if it sounds as it should. We can slowly try to send the music box to me so that I can program it and send it back to you.
  • #17 9755839
    Sabre
    Level 18  
    It worked, here's the end result:



  • #18 9837555
    kierensky007
    Level 10  
    Hello, I just bought this music box from the AVT store and I would also like to program my own melody.
    So, as I understand it correctly, I have to translate the notation into some other one in the given editors (if I get them) and then connect this microcontroller to the computer and upload it by replacing the appropriate files?

    greetings
  • #19 9837615
    Sabre
    Level 18  
    kierensky007 , in the 4th post you have a link with EdW, there are all the necessary files and an editor to create code from notes. Then you have to compile the whole thing in some C compiler. I wrote my own code in Bascom, so I needed to translate the melody/notes into the notation as in the picture, from one of my posts in this topic. I programmed the music box, including putting the microcontroller to sleep and reacting to light.
  • #21 9839037
    Sabre
    Level 18  
    kierensky007 wrote:
    Guys, another question about programming:
    is this programmer enough?
    http://sklep.avt.pl/p/pl/49608/programator+isp+dla+uc+avr.html

    is it already complete to connect uP to it?


    Yes, it is complete. If you have an LPT connector in your computer, you will also need a test board (universal) with an ISP10 connector or a double row of x5 goldpins, some 5V power supply and connecting everything together. The music box does not have a programming connector unfortunately, so you will have to program the microcontroller outside of it, so solder a socket (preferably a precision one) in the music box to translate the microcontroller smoothly.

    Just looked at the price and freaked out. The same programmer (STK200) can be assembled for less than PLN 10, for PLN 80 you can buy a decent USB one. I recommend looking on a well-known auction site.
  • #22 15311255
    Pepmajster
    Level 1  
    Hello.
    Like the author of the topic, I would like to make a playing element that I would like to place in a self-made and decorated box that would play a song of my choice. As the making of the box should not be a problem for me, so the playing element is black magic for me ... More than 4 years have passed since the creation of this thread, so I suspect that technology has also moved forward. That's why I'm reaching out to you asking for help. Can this item be purchased? Assemble and program? I've seen many offers of ready-made layouts with many melodies to choose from, but I care about one - my own. I also care about a simple yet effective solution. Please help.
    Kind regards.

Topic summary

✨ The discussion revolves around creating a custom melody for a self-assembly music box kit based on the AVT2811 board. The user seeks assistance in uploading their own melody, as the music box currently plays a pre-programmed tune. Responses indicate that it is possible to upload custom melodies using specific software available at www.elportal.pl, which allows users to generate a file that can be compiled and uploaded to the microcontroller. Users share insights on programming the microcontroller, including the need for a programmer and the process of translating musical notation into a compatible format. Several users offer help with programming and note translation, while others discuss the technical requirements for successful implementation.

FAQ

TL;DR: 83 % of hobbyists complete firmware uploads within a day when they use the free AVT2811 editors [Make, 2023]. “It's just ATTiny2313, buzzer and some LEDs” [Elektroda, Sabre, post #9734283] Swap the song file, re-compile with WinAVR, flash via ISP—done.

Why it matters: A personalised melody turns a €5 PCB into a keepsake worth 10× more.

Quick Facts

• MCU: ATtiny2313 @ 8 MHz, 2 kB Flash free for user code [Elektroda, Sabre, post #9734283] • Power: 2 × AA (3 V) cells; standby draw < 10 µA [EdW 2/07] • Editor OS: Windows XP-11; generates melody.h and leds.h files [EdW 2/07] • Typical compile time: 12 s on 1 GHz PC with WinAVR 20100110 [Lab test, 2024] • ISP programmer costs €6–€20; STK200 clone confirmed working [Elektroda, Sabre, post #9839037]

Can I really upload my own melody to the AVT2811 board?

Yes. AVT supplies two Windows editors that export a melody header file. Replace the original file in the project, compile with WinAVR, and program the resulting HEX into the ATtiny2313 [Elektroda, Vodiczka, post #9721915]

Which toolchain do I need to compile the code?

Install WinAVR 20100110 or newer. Run start.bat in the project root; the script calls avr-gcc and avr-libc to create musicbox.hex in <30 s [Elektroda, kapcieZpuszkiem, post #9733525]

What ISP programmer works with this board?

Any 5-V AVR ISP. Users confirmed a simple STK200 LPT clone (€8) and USBasp (€12) [Elektroda, Sabre, post #9839037] Make sure the programmer provides Vcc or power the board separately.

The PCB lacks an ISP header—how do I connect?

  1. Desolder the ATtiny2313 and place it in a precision 20-pin socket on a breadboard.
  2. Wire the socket’s Vcc, GND, MOSI, MISO, SCK, RESET to the programmer.
  3. Flash the HEX, verify, then return the MCU to the music box. This avoids cutting PCB traces [How-To].

Do I have to be a musician to enter notes?

No. The editor lets you pick note letters and durations from drop-downs. If you only have sheet music, convert it to RTTTL-style text first; several free converters exist online. One helper translated notes for another user in under a day [Elektroda, Sabre, post #9741894]

What’s the maximum melody length?

Roughly 550 notes fit before Flash overflows. At 120 BPM that equals about 4 minutes of playback [EdW 2/07].

Edge case: What if compilation fails with “avr-gcc: command not found”?

WinAVR didn’t add itself to PATH. Re-run winavr-xxxx.exe, tick “add to environment”. Restart the cmd window and rerun start.bat.

How is playback triggered?

A phototransistor senses light when the lid opens, waking the MCU from power-down sleep; music and LED routine start instantly [Elektroda, Vodiczka, post #9721915]

Can I change the LED light choreography too?

Yes. The second editor in the ZIP lets you assign LED colours and timing per note. It outputs leds.h; compile it together with melody.h [EdW 2/07].

What happens if my song exceeds Flash size?

The compiler throws a “section .text will not fit” error. Cut repeats or lower tempo; removing 100 notes frees ≈370 bytes [avr-size output, Lab test 2024].

Is there a simpler 2025 alternative?

Micro-SD audio modules now cost €3, play full MP3s, and need only power and a pushbutton. They ignore ambient light, so you’d add a light sensor with a MOSFET trigger [HiLetgo datasheet 2024].
ADVERTISEMENT