How I Designed the LED HEART Box
Greetings, Habr!
I want to tell a story about the creation of a music box with elements of light illumination - a beautiful gift with the possibility of individual selection of lighting effects and musical accompaniment. The box was called plain - LED HEART. Any work has been done, I want to share a short story on working on this "hobby" project.
It's no secret that on the network (including on Habré) you can meet many projects to create LED valentines, hearts, etc. Demonstration videos with them often collect flattering and enthusiastic reviews in the comments. At the same time, the opportunity to give such an interesting gift so far has remained the lot of engineers, hams, etc., i.e. people with sufficient qualifications to repeat someone’s project / make their own. In addition, you need a lot of free time for this. I have not seen a batch production of such a gift. The closest is the simplest amateur soldering kits from a pair of domestic companies, and similar options presented on Chinese sites.
This idea initially led to start a project to create an LED heart, which will be available not only to those who are “with you” with electronics.
I'll start a little from afar, with a background. It lasted all several years ...
The first video with a heart of LEDs I saw in 2010 on one of the youtube channels. The project was impressive. And in 2011, as a student, for a couple of weeks of work in the evenings, secretly from his girlfriend, he put together a simple version of the LED heart, presented for March 8. The project was developed by myself - both hardware and firmware - studied, invented bicycles.
It looked ... in general, something like this:
Unfortunately, no photo will fully convey the degree of gift exclusivity that seemed to me unsurpassed in some places 9 years ago. There was a printed circuit board with Attiny13A in the can from the canned fish (MK is not visible in the photo, it was soldered by wires from the outside - a bunch of wires extending beyond the upper border of the photo), with shift registers and bright LEDs soldered along the outline of the heart symbol. On the outside of the lid of the tin can there is an inscription: “In your hands everything is filled with love ... and even ...” and on the inside “... mackerel. Since March 8! ” At the push of a big red button, the lights started to run, the LEDs blinked and shimmered in accordance with what got into 1 kilobyte of microcontroller memory. Creativity and romance splashed over the edge, as you can see. As I remember now
Well, a little distracted, I will continue.
Having received the desired response from his future wife, the thought settled in his head that the production and sale of such interesting gifts may make sense in principle. Such a souvenir evokes positive emotions and symbolizes the warm feelings of the person who gives it. But study, diploma, work, routine, personal life did not allow to allocate enough time to engage in such adventures - it all ended before it started.
3 years passed ... 2014 came ... At some point I began to stumble on similar projects on the Internet again - some of them were already more advanced and interesting - the idea to develop my own unique version of the heart and engage in its production ignited with renewed vigor, there was nothing like that before. At the same time, obviously, people showed interest. Having already had engineering experience, he began to approach this issue more systematically. But still, work on this heart took place in a hobby mode - some evenings, and on weekends, if possible, in parallel with other “hobby” projects and the main work, which was in the first place in the priority of all works. Therefore, in the end, the time frame turned out to be incredibly bloated for such a project.
How did the study begin?
Firstly, the shortcomings in the seen amateur constructions were identified and evaluated. The most important thing that was noted then:
All these thoughts the brain stormed for a while. First I had to decide on the specific functionality of the box. In general terms, it was seen as follows:
Further, these requirements were formalized into specific technical tasks, and one by one these tasks were gradually solved. In the process, different materials were examined, types of designs, circuitry was thought over, well, writing the software, realization of the ability to quickly add / remove / edit lighting effects, etc. took the lion's share of the time.
As an example of such transformations, I can offer a demonstration of the intermediate version of the prototype box manufactured in 2015 - it can be conditionally considered the result of iteration 1 (the video quality is terrible, the sound was superimposed separately from the mp3 file, it could not be adequately recorded then):
And already the final version, assembled in 2017:
It may seem that here the LEDs glow dimmer than in the 2015 version, but this is not so - it was just that when shooting, the external source was too strong. The sound here is already real.
By the time this sample appeared, much had changed both outside and inside the device, and in its software part.
The electronics box is located on three printed circuit boards. On one - LEDs, transistors and resistors, necessary for the matrix inclusion of LEDs, the Atmega32A control microcontroller and its wiring. On the second board, power-on control is implemented when the box is opened, a power-off circuit with an unacceptable drawdown of the supply voltage. The third board has an mp3 player (purchased module).
The case is a purchased metal box. Inside, the entire structure is based on a plastic frame printed on a 3D printer. Some elements are held by adhesive joints, the main board is held on magnets mounted in a plastic base.
The box is powered by three AAA batteries.
For the PC, a program was developed - a code generator with a graphical interface, which allows you to quickly create and edit lighting effects, control all the necessary time intervals (for synchronization with the background melody) and immediately generate a code for flashing the microcontroller located on the heart board. A certain format was developed for recording effect parameters into data arrays. On the MK side, the firmware parses these arrays and converts them into the glow of the right LEDs at the right time. The format for recording effects in the code tables is quite economical - the internal memory of the microcontroller programs is quite enough for the firmware code and for tables with parameters of lighting effects.
A separate article can be written on solving technical issues and problems encountered during development. Of course, this is not a “rocket science” and chewing such questions can be boring for the public, but if someone is interested, you can definitely get confused.
What is the result? The casket project can still be licked and upgraded endlessly, improved in completely different directions, added functionality, etc. But in the form in which the box was conceived - it was done, the development project was completed. For (small) serial production, some more work needs to be done, but this is a matter of technology, as they say.
Somewhere in the middle of the journey, I realized that trying to independently develop the commercial component of the project was not very interesting for me, there was neither time, nor much desire for it. There was no person who would take on most of the work of organizing sales, working with melodies and lighting effects in my environment. With such a potential partnership, I agreed to close all technical issues, production, procurement and logistics. But it did not work out. And time is constantly occupied by other tasks - either more interesting, or simply necessary / household.
Therefore, at the moment, I consider the project completed at this stage. In total, 3 copies of the latest version were made - two for gifts to loved ones and one copy made to order. It may happen that some kind of history will continue sometime, I will not promise, but at the moment the status is like that. In general, the result of the work satisfied me. But most valuable is the reaction of loved ones to whom the first heart samples were intended, for this it would not be a pity to spend as much as you like a lot of time!
Well, in terms of the rationality of conducting such a project, objective conclusions were drawn, lessons were learned that will surely serve me in future deeds and achievements!
Thank you for reading, I am always glad to talk in the comments, if you have questions, comments, suggestions.
I want to tell a story about the creation of a music box with elements of light illumination - a beautiful gift with the possibility of individual selection of lighting effects and musical accompaniment. The box was called plain - LED HEART. Any work has been done, I want to share a short story on working on this "hobby" project.
It's no secret that on the network (including on Habré) you can meet many projects to create LED valentines, hearts, etc. Demonstration videos with them often collect flattering and enthusiastic reviews in the comments. At the same time, the opportunity to give such an interesting gift so far has remained the lot of engineers, hams, etc., i.e. people with sufficient qualifications to repeat someone’s project / make their own. In addition, you need a lot of free time for this. I have not seen a batch production of such a gift. The closest is the simplest amateur soldering kits from a pair of domestic companies, and similar options presented on Chinese sites.
This idea initially led to start a project to create an LED heart, which will be available not only to those who are “with you” with electronics.
I'll start a little from afar, with a background. It lasted all several years ...
Background
The first video with a heart of LEDs I saw in 2010 on one of the youtube channels. The project was impressive. And in 2011, as a student, for a couple of weeks of work in the evenings, secretly from his girlfriend, he put together a simple version of the LED heart, presented for March 8. The project was developed by myself - both hardware and firmware - studied, invented bicycles.
It looked ... in general, something like this:
Unfortunately, no photo will fully convey the degree of gift exclusivity that seemed to me unsurpassed in some places 9 years ago. There was a printed circuit board with Attiny13A in the can from the canned fish (MK is not visible in the photo, it was soldered by wires from the outside - a bunch of wires extending beyond the upper border of the photo), with shift registers and bright LEDs soldered along the outline of the heart symbol. On the outside of the lid of the tin can there is an inscription: “In your hands everything is filled with love ... and even ...” and on the inside “... mackerel. Since March 8! ” At the push of a big red button, the lights started to run, the LEDs blinked and shimmered in accordance with what got into 1 kilobyte of microcontroller memory. Creativity and romance splashed over the edge, as you can see. As I remember now
Well, a little distracted, I will continue.
The story itself
Having received the desired response from his future wife, the thought settled in his head that the production and sale of such interesting gifts may make sense in principle. Such a souvenir evokes positive emotions and symbolizes the warm feelings of the person who gives it. But study, diploma, work, routine, personal life did not allow to allocate enough time to engage in such adventures - it all ended before it started.
3 years passed ... 2014 came ... At some point I began to stumble on similar projects on the Internet again - some of them were already more advanced and interesting - the idea to develop my own unique version of the heart and engage in its production ignited with renewed vigor, there was nothing like that before. At the same time, obviously, people showed interest. Having already had engineering experience, he began to approach this issue more systematically. But still, work on this heart took place in a hobby mode - some evenings, and on weekends, if possible, in parallel with other “hobby” projects and the main work, which was in the first place in the priority of all works. Therefore, in the end, the time frame turned out to be incredibly bloated for such a project.
How did the study begin?
Firstly, the shortcomings in the seen amateur constructions were identified and evaluated. The most important thing that was noted then:
- Lack of variety of elements of light illumination.
- The simplicity and clumsiness of designs, which always lubricates the first impression and may not lead to the proper effect when giving. The overwhelming majority of the devices examined looked like amateur crafts, nothing more (like the one I did in 2010) - solid, not serious, boring ... Most of the considered designs of hearts either have no body at all, or this body is terrible - Ala a fret saw from rotten plywood, a self-tapping screw into a board, windows from org. glass, etc. A certain optimum is needed - the type of device should not at least scare people away, on the contrary - it should convey to the maximum the whole gamut of feelings from the one who gives it, and at the same time - the device should not be too dimensional, super-complex, etc. .
- The lack of sound effects of light effects in the projects of hearts (with very rare exceptions), although, in my opinion, it begs for itself. Just blinking the LED matrix is not enough. Music should enhance the effect, add romance at the time of giving. Music can even be an individual feature of such a gift, it “warms up” the right atmosphere for the corresponding situation - romantic / solemn / funny and any other. There was an assumption that if the effects of illumination, for everything else, are also synchronous with the background melody - it will be very cool, convincing and cool.
- Since, according to the previous paragraph, there should be music - the idea to make a music box came up on its own - you open it - it plays and sparkles - you close it - it trails off and fades away.
All these thoughts the brain stormed for a while. First I had to decide on the specific functionality of the box. In general terms, it was seen as follows:
- The heart should have an LED matrix, of sufficient resolution so that you can run a running line, do the simplest animation. It should be possible to smoothly fade out and light up the LEDs.
- It should be possible to quickly create and correct lighting effects for the rapid restructuring of the illumination program for a specific customer. It should be clarified that the model of interaction with customers implied the following. The client is initially provided with a basic set of illumination programs with predefined melodies, from which he selects one that is most suitable for his wishes - further, for his part, we will adjust the illumination program, adapting it to this particular person, his occasion / holiday (text of the running line, which other frames). In the future, it was planned to gradually expand the base of available tunes and lighting effects. Also, for my part, I can always advise the best option after communicating with the client, based on input data. The possibility of completely individual study of the melody and illumination, but at an increased cost, is not completely ruled out. the process of compiling a program of lighting effects for a new melody in any case turns out to be significantly longer than other processes of preparing the device for sale.
- A specious case (while relying only on your taste at the prototype stage).
- Autonomy of power, as the device is essentially a souvenir, it makes no sense to make it stationary, attached to an external source.
Further, these requirements were formalized into specific technical tasks, and one by one these tasks were gradually solved. In the process, different materials were examined, types of designs, circuitry was thought over, well, writing the software, realization of the ability to quickly add / remove / edit lighting effects, etc. took the lion's share of the time.
As an example of such transformations, I can offer a demonstration of the intermediate version of the prototype box manufactured in 2015 - it can be conditionally considered the result of iteration 1 (the video quality is terrible, the sound was superimposed separately from the mp3 file, it could not be adequately recorded then):
And already the final version, assembled in 2017:
It may seem that here the LEDs glow dimmer than in the 2015 version, but this is not so - it was just that when shooting, the external source was too strong. The sound here is already real.
By the time this sample appeared, much had changed both outside and inside the device, and in its software part.
Briefly about HW
The electronics box is located on three printed circuit boards. On one - LEDs, transistors and resistors, necessary for the matrix inclusion of LEDs, the Atmega32A control microcontroller and its wiring. On the second board, power-on control is implemented when the box is opened, a power-off circuit with an unacceptable drawdown of the supply voltage. The third board has an mp3 player (purchased module).
The case is a purchased metal box. Inside, the entire structure is based on a plastic frame printed on a 3D printer. Some elements are held by adhesive joints, the main board is held on magnets mounted in a plastic base.
The box is powered by three AAA batteries.
Briefly about SW
For the PC, a program was developed - a code generator with a graphical interface, which allows you to quickly create and edit lighting effects, control all the necessary time intervals (for synchronization with the background melody) and immediately generate a code for flashing the microcontroller located on the heart board. A certain format was developed for recording effect parameters into data arrays. On the MK side, the firmware parses these arrays and converts them into the glow of the right LEDs at the right time. The format for recording effects in the code tables is quite economical - the internal memory of the microcontroller programs is quite enough for the firmware code and for tables with parameters of lighting effects.
A separate article can be written on solving technical issues and problems encountered during development. Of course, this is not a “rocket science” and chewing such questions can be boring for the public, but if someone is interested, you can definitely get confused.
Total
What is the result? The casket project can still be licked and upgraded endlessly, improved in completely different directions, added functionality, etc. But in the form in which the box was conceived - it was done, the development project was completed. For (small) serial production, some more work needs to be done, but this is a matter of technology, as they say.
Somewhere in the middle of the journey, I realized that trying to independently develop the commercial component of the project was not very interesting for me, there was neither time, nor much desire for it. There was no person who would take on most of the work of organizing sales, working with melodies and lighting effects in my environment. With such a potential partnership, I agreed to close all technical issues, production, procurement and logistics. But it did not work out. And time is constantly occupied by other tasks - either more interesting, or simply necessary / household.
Therefore, at the moment, I consider the project completed at this stage. In total, 3 copies of the latest version were made - two for gifts to loved ones and one copy made to order. It may happen that some kind of history will continue sometime, I will not promise, but at the moment the status is like that. In general, the result of the work satisfied me. But most valuable is the reaction of loved ones to whom the first heart samples were intended, for this it would not be a pity to spend as much as you like a lot of time!
Well, in terms of the rationality of conducting such a project, objective conclusions were drawn, lessons were learned that will surely serve me in future deeds and achievements!
Thank you for reading, I am always glad to talk in the comments, if you have questions, comments, suggestions.