Your way in a world where there is a ready-made solution for everything





I became the proud owner of a new watch. The very ones that, probably, would be more correct to call a computer with a strap than a watch, but still. In the bedroom, above the bed, there was an LED strip that was controlled by a remote control. As usual, when you needed it, the remote was always anywhere, but not at hand. "And what could be closer to your hands than a watch?" - I thought and began to rub my paws, like a fly on glass ...



This story is not another instruction on how to do this or that thing, following the points, step by step. This story is about how you can find your way among a huge set of trodden paths, abandoning ready-made instructions and solutions.



When there is a ready-made answer or set for everything



Walking around the Internet, I came across a discussion that raised the issue of creating an automatic locker that would slide out when a hand is brought to the sensor. This discussion took place in the context of solving the problem associated with the need to touch the cabinet with your hands, then wash your hands, etc. Yes, yes, a topical topic today. I was amazed that not only several solutions were proposed to solve this issue, but links were given to assembly instructions and even ready-made kits that can be ordered from China for a penny.



By the way, while reading this discussion, a new phobia appeared in my head about furniture that deliberately (the uprising of cars and all that) opens the lower shelves so that I hit them with my little finger.



Nevertheless, I soon caught myself thinking that in fact I was not so surprised that there are already a bunch of instructions and ready-made solutions for “self-pulling cabinets”, because we live in a very interesting time. A time when each of the problems has been solved many times, and information and resources are available in a short time and for little money.



I will start my story with a small digression about unnecessary things, because this story is directly related to the topic.



Unnecessary things



For one of my "pet projects" I needed several dozen simple Attiny45 microcontrollers. The reason for choosing these particular controllers, or even the essence of the project itself, will not affect the narrative in any way, so I will not dwell on this. Since we were talking about several dozen, I did not want to overpay and took the opportunity to order the pieces of hardware I needed on a popular Chinese site. Naturally, the rule “a cheapskate pays twice” did not take long, and therefore it came to me:



  • 15 Attiny12
  • Two Attiny45
  • 23 units of <something else> labeled Attiny45.


The money was returned and I had a handful of Attiny12 completely unnecessary to me. I postponed them until better times, because the microcontroller itself is very limited, has not been supported by the manufacturer for a long time, etc. But nevertheless, I decided that “we will define a shameful ailment in a feat”, we only need a “simpler” task ...



It was already Halloween on the nose and it was possible to do something thematic, uncomplicated, and entertain yourself with the process of creating something with your own hands. Some time ago, when I was changing light bulbs to energy-saving ones, I was thinking what should I do with old bulbs. The obvious way to "throw it away" came to my mind, but I put them aside in a distant closet with thoughts of "what if it might come in handy." And that's how fate brought an unnecessary microcontroller with an unnecessary light bulb ...



New life of unnecessary things



I will not spoil (if there is anything else to spoil, after the first picture of the article) what thought came to my mind, so I’ll just tell you about the implementation ...



I sawed through the base of the light bulb and pulled out the "insides". Then I soldered several LED bulbs to make a new spiral out of them: I







painted the bulb from the inside to make it look older and to hide a little the fact that the filament now consists of LEDs, I inserted a new “thread” into the bulb of the bulb:







Here came to the rescue Attiny12, a pinch of ASM code and a simple model for 3d printing:







The result is a fridge magnet like this:







So, as a result, I got, albeit completely useless, but a funny craft, which gave me several hours of creativity and the joy that everything turned out as I planned. In general, the important points for me were:



  • Despite the availability of ready-made 3d models that could be adapted, I made my own.
  • I used a microcontroller that requires writing ASM code, which I have not actually done in many years and it was a very funny experience.
  • I used a thing that just took up space in the closet uselessly. And yes, I understand that now it uselessly takes up space on the refrigerator, but it pleases the eye.


Back to watches, lights and more



Now that the theme of the holiday has been touched upon, I digress from the main story, it seems that you can return to the clock and the backlight.



Several years ago, when the bedroom was being renovated, it was decided that an LED strip could be placed behind the shelf above the bed, which would illuminate the decorative wall behind the headboard. To control the tape, a ready-made set was taken, which came with the remote control, which did not require the IR receiver to be brought out.



Years passed and it became clear that although this whole light installation worked flawlessly, it began to completely contradict modern realities. What consoles, if we have around IoT and so on? And then a new watch fell into my hands ...



The main requirements for me were:



  1. Do not use ready-made instructions or kits.
  2. «», ( , , ).
  3. , , « ».
  4. , / / .


The general idea is this: there is a LED strip control module and I do not climb into it, I just pretend to be a remote control. This means that somewhere in the house there must be a microcontroller that is connected to the network and awaits a command, which he can later "send" through the radio module, as a command for the control module. Additionally, it was necessary to make an application for the clock, so that all this was convenient to use.



And I'll say right away that no, assemble a device with a radio receiver / transmitter, dump all commands from the remote control, write a simple Web server (okay, this is essentially a ready-made library, but not the point) that will respond to commands from the application in hours and send them through a radio transmitter is not overengineering... This is one more opportunity to “tread your own path”. I'm sure there will be quite a few people who will notice a lot of unnecessary actions or components in this idea. I understand that and I'm not even going to argue. But you can be calm knowing that I am not going to establish any production of such devices, and therefore I hope that your sense of beauty is still not affected.



It was known that the remote control does not work through IR, which means that it uses some kind of radio signal. And since the manufacturers most likely did not bother coming up with something new, it had to be a radio signal that could be caught using a cheap superheterodyne receiver (operating at 433.92 MHz).



And so it turned out. Each button on the remote control had its own "command" that was sent. After dumping all the buttons on the remote, I took the transmitter (the receiver and transmitter are usually sold in pairs) and connected it to the microcontroller, making sure that all commands are successfully executed. The ESP8266 was chosen as the microcontroller because it could be easily "thrown" into the home network and controlled via the Internet without unnecessary gestures.



An interesting discovery for me was the Tizen platform - the platform on which watches work. I expected that a watch application would have to be written in Java using the Android SDK, but to my surprise, applications were divided into:



  • Native (C ++)
  • Web
  • .NET


Worst of all, I imagined what a "Web application for watches" is, so I followed in that direction. The application was a collection of html, css and js files that worked like a regular Web page, if you don't take into account some minor features. A special childish joy was given to me by the debugger, which allowed me to debug the application through the browser on the computer while the application itself was running on the clock:







In general, I am familiar with Web development, but everything became more complicated when I realized that I needed to make a round page. Those. it is not only about the fact that the visible area should be round, but about the fact that the elements should be arranged in a circle. Here I had to remember the extensive possibilities of transforming elements using CSS.



An additional problem was that I wanted to have some kind of status indication in the watch, but the communication with the module was one-way, so I decided to add a light sensor that would allow the ESP8266 to have an idea of ​​the state of the LED strip. The final application, unlike the native remote control, learned to "understand" whether the tape is currently on or not:







It is clear that I, in general, I did not come up with anything new, but I gave myself the opportunity to learn something new in the process. Of course, you could have just thrown away the light bulb and unnecessary microcontrollers. It was possible to buy a ready-made kit for working with LED strip, but shopping brings me much less joy than the process in which I do something with my own hands.



Look for your own paths, do something new with your own hands, as if you were the first to do something like this.



Thanks to everyone who read to the end.



All Articles