📜 ⬆️ ⬇️

How I was creating the LED HEART box

Greetings, Habr!

I want to tell the story of creating a music box with elements of light illumination - a beautiful gift with the possibility of individual selection of light effects and musical accompaniment. Casket called uncomplicated - LED HEART. What kind of work has been done, I want to share a short story on the work on this with my hobby project.

It is no secret that in the network (including on Habré) you can find many projects to create LED valentines, hearts, etc. Demo videos with them often collect flattering and rave reviews in the comments. At the same time, the opportunity to give such an interesting gift still remained the lot of engineers, radio amateurs, etc., i.e. people who are qualified to repeat someone’s project / make your own. In addition, you need a lot of free time for this. I did not meet a serial 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 was originally and prompted to start a project to create a LED heart, which will be available not only to those who are on "you" with electronics.
')
I'll start a little from afar, with prehistory. It lasted all for several years ...

Prehistory


The first video with a heart of LEDs I saw in 2010 on one of the youtube channels. The project is impressed. And in 2011, as a student, for a couple of weeks of work in the evenings, in secret from his girlfriend, he assembled a simple version of the LED heart, presented it on March 8th. The project was developed by itself - and hardware and firmware - studied, invented bicycles.

It looked ... well, something like this:

image

image

No photo, unfortunately, will not fully convey the degree of gift exclusivity, which 9 years ago seemed to me unsurpassed in some places. In the canned fish bank there was a printed circuit board with Attiny13A (in the photo, the MK is not visible, it was soldered by wiring outside - a bunch of wires extending beyond the upper limit of the photo), with shift registers and bright LEDs soldered along the outline of the heart symbol. On the outer side of the lid of the tin can is the inscription: “In your hands everything is filled with love ... and even ...” and on the inner side “... mackerel. Since March 8! ”. By pressing the big red button, the lights started running, the LEDs blinked and poured in accordance with the fact that it got into 1 kilobyte of the microcontroller's memory. Creative and romance splashing over the edge, as you can see. As I remember now, I wander between the rows of the supermarket and think about what kind of case to choose for a “hearty gift” ... suddenly my eyes stumble onto a shelf with canned goods ... and here it is ... enlightenment ...

Well, a little distracted, I will continue.

The story itself


Having received the desired response from his future spouse, the idea settled in his head that the production and sale of such interesting gifts might make sense in principle. Such a souvenir evokes positive emotions and symbolizes the warm feelings of the one who gives it. But study, diploma, work, routine, personal life did not allow to allocate enough time to engage in such adventures - everything ended without starting.

Three years have passed ... 2014 has come ... At some point, I began to stumble again on the Internet on similar projects - some of them were already more advanced and interesting - the idea to develop a unique heart version and start producing it with a new force, in the market- still nothing like that. At the same time, obviously, people showed interest. Having already experience in engineering, I began to approach this issue more systematically. But still, the work on this heart was held in a hobby mode - on 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.

Where did the study began?

First, the weaknesses found in the amateur constructions they saw were identified and assessed. The most important thing then noted:


All these thoughts brain stormed for a while. First I had to decide on the specific functionality of the box. In general terms, it was seen as:


Further, these requirements were formalized into specific technical tasks, and one by one these tasks were gradually solved. In the process, various materials, construction types were sorted out, circuitry was thought out, and the lion's share of time was taken by writing software, realizing the ability to quickly add / remove / edit light effects, etc.
As an example of such transformations, I can offer a demonstration of the work of the intermediate version of the casket prototype, made in 2015 - can be considered as the result of iteration 1 (the video quality is terrible, the sound was superimposed separately from an mp3 file, could not adequately record it then):


And already the final version, compiled in 2017:


It may seem that here the LEDs are dimmer than in the 2015 version, but this is not the case - just when shooting, there was too much light from an external source. The sound here is already real.

By the time this sample appeared, a lot of things had changed both from the outside, and from within the device, and in its software part.

Briefly about HW


The electronics of the box are located on three printed circuit boards. On the one are the LEDs, transistors and resistors needed for the matrix switching on of the LEDs, the Atmega32A control microcontroller and its harness. On the second board, power-on control is implemented when the box is opened, the power-off circuit with unacceptable power supply drawdown. On the third board implemented mp3 player (purchase 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 using adhesive joints, the main board is held on magnets embedded in a plastic base.
The box is powered by three AAA batteries.

SW in brief


For the PC, a code generator program with a graphical interface was developed that allows you to quickly create and edit lighting effects, monitor all necessary time intervals (to synchronize with the background melody) and immediately generate a code for the microcontroller firmware located on the heart board. A specific format for writing effect parameters to data sets was developed. On the MK side, the firmware parses these arrays and converts the desired LEDs to luminescence at the right times. The format of recording effects in the code tables is quite economical - the internal memory of the microcontroller programs is quite enough for both the firmware code and tables with light effect parameters.

On the solution of technical issues and problems encountered during the development, you can write a separate article. Of course, this is not “rocket Sains” and chewing such questions can be boring for the public, but if you are interested in someone, you can definitely be confused.

Total


What is the result? The casket project can still be endlessly licked and modernized, improved in completely different directions, add functionality, etc. But in the form in which the box was conceived - it was made, the design project was completed. For (small) mass production, some more work needs to be done, but this is a matter of technology, as they say.

Somewhere in the middle of the road, it was realized that trying to independently develop the commercial component of the project is not very interesting for me, there is neither time nor great desire for it. There was no person who would take over most of the sales organization work, work 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 the time is constantly busy with other tasks - either more interesting, or simply necessary / everyday.

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 relatives and one copy made to order. It may happen that the story will continue in some form, I will not blame, but at the moment the status is. In general, the result of the work I was satisfied. But the most valuable is the reaction of close people, to whom the first samples of the heart were intended, for this it would not be a pity to spend as much time as you like!

Well, in terms of the rationality of such a project, objective conclusions were made, lessons were learned that will surely serve me in future affairs and accomplishments!

Thank you, if you have read it, always happy to talk in the comments, if you have questions, comments, suggestions.

Source: https://habr.com/ru/post/456366/


All Articles