Pet projects - small life





I am a passionate person. IT is undoubtedly the main hobby. But in parallel, others appear to me. Pets, apartment, construction. Everywhere I try to override something. One of these overheads was the development of LED aquarium lights.



It would seem - what can be done here? Lamp lamp. I thought so too. But, as always, things are much more complicated if we want to.



I got myself a saltwater aquarium. This is a very important point, because it is absolutely impossible to compare it with freshwater. The main focus in a marine aquarium is on corals. What do you think this is?







Flowers? But no. This is soft coral. Simple moroman call him xenia (xenia pulse). It is notable for its pulsating effect. His pink legs are compressed and unclenched. This is an amazing sight - whole fields of pulsating corals! The cost of such corals is not great and sometimes they are even given away for nothing. But on average, you need to cook from 300r to 1000r per coral.



The low cost is due to their content, which does not require serious control of water hydrochemistry. They are available for beginner reef farmers.



Another class of coral is LPS-coarse-hard coral. They are distinguished from soft by the presence of a skeleton.







On the left you can find the very bare skeleton. The price of such charms starts at $ 10 per polyp. Those. here is what you see in the picture is worth ... well ... somewhere around $ 500.



The content of these corals is another story. For them, the parameters of water and light are important. Do you know what you need to have in order to afford such beauty? This:







This is SAMP. I do not know why it is called that. Probably somehow decrypted. But for the technomaniac it’s straight ... what you need.



Closes the three - SPS. Small-hard hard coral.







If the photo with SAMP seemed scary to you, then to contain such babies, you need to have (in a good way) a separate room with equipment. Something like this:







The price of such pipsiks (coral frag about 5x5x5cm) can easily start from $ 500.



Undoubtedly, everything in the SAMP photo is very interesting to do for yourself. Expanse for overhead and DIY. But there is another section of the contents of the marine aquarium - light.



The thing is that corals are sensitive to the composition of the spectrum, and they also need quite powerful lighting. This is because corals are symbiotic. Their bodies contain symbiotic algae - zooxanthellae. They process the energy of light and feed the coral.



In the aquarium you can meet a “hodgepodge” of different types of corals (soft, LPS, SPS). In nature, they do not even meet each other. They live in different conditions and are illuminated by a "different sun."



The deeper the corals live, the less “red part of the spectrum” from sunlight and more “blue” get to them. This is due to the natural filtration of light by sea water. But the lamp should please everyone. If corals don't like the light, they will die. Or will suffer greatly.



The second important function is the visual effects of the lamp. They generally have a positive effect on corals, but are intended more for the observer. The most common of them are sunsets and sunrises.



This is expressed in the fact that in the morning the light does not turn on on the switch, but gradually flashes imitating the dawn, then there is a zenith and a sunset. At night, the blue diode glows weakly, weakly, creating the effect of the moon. The beauty!



Plenty of room for the IT technician’s imagination! And lunar cycles, and imitation of weather phenomena, and mood lighting. “Dark theme”, if not funny, is also needed. Imagine you have an aquarium next to the TV, and you wanted to watch a movie with your family. Bam. And the aquarium went into minimal lighting.



In general, I began to hurt this topic. Scary. And I flashed my firmware for the ESP8266 controller. Yes, not simple, but overdone for the most indulge!



The goal was to create the simplest and cheapest controller. The ESP8266 chip then looked incredibly attractive in all respects except for one - it did not have enough legs to control the lamp channels. Oh yes…



I completely forgot to give a little excursion into the design of modern aquarium lights. So, to please all corals, several types of diodes are installed in the lamp. With different spectra and power. Different types of diodes are grouped and regulated separately. Such a group is called a channel. The more channels in the lamp, the more accurately you can choose the right spectrum.



To control these channels, the chip needs one foot per channel. And also, the PWM parameters on these legs are important. If very simple, then this is the flicker frequency. You can meet this characteristic even on ordinary diode lamps. The higher it is, the better.



In general, one chip ESP8266 was not enough for me. After spending a little time, I found another interesting chip - PCA9685 . The only thing left is the real-time clock. Well, this stuff is full on arduino. I took the DS3231 .



On the heap, it began to look like this:





Forward! To accomplishments! - I thought, and sat behind the Arduino IDE. One more detail quickly became clear - the supplied SDK on this chip takes up almost all of its resources. It was certainly possible to cut something, but something normal was not.



But the goal was in the overhead! Without hesitation, I declared this IoT device a thing and dusted a cloud to it. On joomla! .. And don’t have to laugh like that. Yes, even then I knew that this was not the best solution for the clouds. But this is a ready-made CMS. I did not intend to conquer the world, but I knew how to lay down a couple of plug-ins for it.



I must add that at the profile forum, as usual, I was of course “supported”. They said that they "believe in me." Especially comrades who have been trying to give birth to this for three years now.



A month later, I rolled out a cloud with a wonderful, wonderful UI, which gave my whole friend (who can implement it) my good friend. Ah, it’s a pity that I can’t give links here to such projects.







And so that I dragged:





But the infrastructure became an epic overhead. Here you need to explain how the cloud worked with IoT.



All heavy transformations were carried out in the cloud. Crown broadcasts started recounting programs for controllers. The controller, once a minute, sent a GET request and received another, updated program. It was very simple, which allowed it to run without problems on the ESP8266.



So, so that this whole “idyll” does not collapse at once, due to the inaccessibility of my cloud, I made a backup site with an independent hoster. I even had enough “mind” to see how I could get the AS (autonomous system of IP addresses). It is good that the mind has triumphed over the mind.



Of course, I screwed CloudFlare and set up a program caching policy for controllers. This allowed us to reduce backend calls by a factor of 100. In short ... the deployed infrastructure was ready for high loads! Then 9 people used the cloud. But availability ... in 4 years, the cloud has never fallen.



Reader, I’ll just remind you that now we are talking about a lamp. For aquarium. Or rather about the controller from him.



Probably, it would be worth it to brush my ChSZ with a baby cream and go to bed, but ... it seemed to me not enough. I decided to make a physical controller. And this was born ...







Before that, I had never held a soldering iron in my hands. By the way, this is my first controller, on which I myself mounted the entire kit. Fenchikom. And then carefully watered with a plastic swab. Mmm ... my paw! I'm proud of you! (this is me to the controller)



And then ... I got a friend - an electronics engineer. It was just some kind of happiness! He turned out to be the same enthusiastic person. Only in the field of electronics. For a couple, we started stamping different “very necessary” devices.



Together we released the first “adult” controller, which had an MCU on board. ESP was able to flash it. What allowed on the cloud to give updates.







And then, finally, I assembled my lamp. Yes, yes ... all this time, something wretched from the radiator and some matrices, which turned on by a mechanical, Chinese timer, hung over my aquarium. Unfortunately, the photos were not saved. But it looked more like a bunch of trash lying on an aquarium.



What do you think my new lamp has become?











This is exactly what you might think. This is SVO (dropsy). Exactly so, not a lot and not a little, I decided to build my lamp. It should be noted that it still works.



When everything was done, all overheads were achieved, my friend and I asked ourselves - what now? The thing is that aquarists from us turned out to be such ourselves ... while we sculpted all these super-cool pieces of iron, our aquariums turned into a swamp. And we decided to stir up the business. That is, that’s all we’ve done is to sell.



I will not develop nagging here, but ... everything that we have done, simply, nobody needed. Ordinary aquarists, in essence, turned out to be ordinary people. Which in the aquarium appreciate the beauty of corals, the behavior of the fish and that everything just worked.



And although there are connoisseurs who are willing to give huge sums for corals, most aquarists start an aquarium as something temporary. For the kids. And they simply are not ready to give it as much time as it takes to realize the steepness of the lamp, which we zabatsat. And we got really cool:







Here on this unit, which my friend bought for our pet projects







and muddied here such a workshop:







And even though we turned out to be bad aquarists, it was a very, very interesting stage in our life.



I learned a lot about the ocean, about how and what flora and fauna live there. I learned about the physics of light. I learned a lot about materials and their properties. We managed to go a very interesting way in organizing our full production cycle (moreover, I am in St. Petersburg and my friend is in Astana). I found out what IoT is, what technologies there are. I saw a real buyer of my overhead and understood why IT bangs business for us, when we want to do something, well, it’s sooooo cool.



But the most important thing - I got a great friend. With which we can do everything we want for a couple. For the sake of this, one could go all the way again.



Well, and also, as a trifle, I went to WEB. In heavily loaded systems. And my RFP increased three times. And we started a new project based on our experience.



Love your pet projects!



All Articles