{"id":3930,"date":"2017-01-07T18:55:32","date_gmt":"2017-01-07T16:55:32","guid":{"rendered":"http:\/\/heiniger-net.blog-net.ch\/?p=3930"},"modified":"2017-02-02T21:51:43","modified_gmt":"2017-02-02T19:51:43","slug":"lavalamp-project-1","status":"publish","type":"post","link":"https:\/\/heiniger-net-archive.blog-net.ch\/en\/archives\/3930\/lavalamp-project-1\/","title":{"rendered":"Lava lamp project, part 1 &#8211; hardware"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-215 alignright\" src=\"\/files\/2017\/01\/5680e7ea166b032a3eed723a-6-original-300x300.jpg\" width=\"300\" height=\"300\">I wanted to build a device that can light in different colors, and where the colors can be controlled from a computer. My idea was to hook it up with a computer, who then should signal some state by lighting the appropriate color. For example, while building and compiling a program, the lamp should blink in blue color. When the build is finished, the lamp should light either in green (when the build ran fine) or red (when something went wrong).<\/p>\n<p>I found the lava lamp shown to the right, which is equipped with a color-changing LED and is powered from USB. I bought one and intended to modify the controlling electronics to my purposes.<\/p>\n<p><!--more--><a href=\"\/files\/2017\/01\/changingLED.pdf\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-3942 size-full\" src=\"\/files\/2017\/01\/color-changing-led.jpg\" width=\"236\" height=\"72\"><\/a>The lava lamp has a built in color LED with a controller chip, that goes through all the rainbow colors in a preset timing. Individual colors can not be displayed as need with this kind of LED. Only the color red can be achieved by pulsing the input voltage. This LED, therefore, does not fulfill the intended purpose.<\/p>\n<p><a href=\"\/files\/2017\/01\/48002-dimensions.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-3932\" src=\"\/files\/2017\/01\/48002-dimensions-300x141.jpg\" alt=\"\" width=\"300\" height=\"141\" srcset=\"https:\/\/heiniger-net-archive.blog-net.ch\/files\/2017\/01\/48002-dimensions-300x141.jpg 300w, https:\/\/heiniger-net-archive.blog-net.ch\/files\/2017\/01\/48002-dimensions.jpg 650w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Instead I need a RGB-LED, whose colors can be controlled individually. That kind of LED can be bought in your favorite electronics market, for example this one with common cathode.<\/p>\n<p>What I needed now is some control electronics, that can interface to USB, can be programmed from the computer, and control the color of a colored LED. A friend of mine told me about the Picaxe microcontroller as an easy way to receive serial signals and which also has digital or analog outputs to control an LED. Therefore, this is what I came up with:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3948\" src=\"\/files\/2017\/01\/Projekt-1-3.png\" alt=\"\" width=\"700\" height=\"274\"><\/p>\n<p><a href=\"\/files\/2017\/01\/Lavalamp-Print.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-213 size-medium alignright\" src=\"\/files\/2017\/01\/Lavalamp-Print.png\" alt=\"Lavalamp Print\" width=\"300\" height=\"285\"><\/a>J1 is the main connector with these pins:<\/p>\n<ol>\n<li>VDD, 5V<\/li>\n<li>Serial out<\/li>\n<li>Serial in<\/li>\n<li>VSS, or Ground, or 0V<\/li>\n<\/ol>\n<p>J2 corresponds to SW1 and it can be used for doing whatever the Picaxe can be programmed to do with it. Maybe it can start a fixed color-changing program, or it can turn the LED on or off.<\/p>\n<p>R6 is a power resistor supposed to warm the lava lamp water a little, so that the glitter in the water gets moving.<\/p>\n<p>Now I need a USB-to-serial adapter. I bought this one, whose fat plug I removed and soldered the <a href=\"\/files\/2017\/01\/usb-serial-adapter.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-3939 size-medium\" src=\"\/files\/2017\/01\/usb-serial-adapter-300x277.jpg\" width=\"300\" height=\"277\" srcset=\"https:\/\/heiniger-net-archive.blog-net.ch\/files\/2017\/01\/usb-serial-adapter-300x277.jpg 300w, https:\/\/heiniger-net-archive.blog-net.ch\/files\/2017\/01\/usb-serial-adapter.jpg 460w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>relevant pins directly to J1 of my circuit above. Now I only need to attach the whole thing in the foot of the lava lamp&nbsp;<\/p>\n<p>With this construction, I end up with a USB device that announces itself to the computer as a serial COM port, which is attached to the <a href=\"http:\/\/www.picaxe.com\/\" target=\"_blank\">Picaxe microcontroller<\/a>. The Picaxe can be programmed with the help of the normal &#8220;<a href=\"http:\/\/www.picaxe.com\/Software\/PICAXE\/PICAXE-Editor-6\/#download\" target=\"_blank\">Picaxe Editor 6<\/a>&#8221; IDE. I will talk about the necessary firmware programming in another article.<\/p>\n<p>As a conclusion, one can say that my project idea requires mastery of the following three challenges:<\/p>\n<ol>\n<li>The&nbsp;<strong><em>Hardware<\/em><\/strong> must be built. I described this process here roughly.<\/li>\n<li>The&nbsp;<strong><em>Firmware<\/em><\/strong>&nbsp;for the Picaxe must be written. This is a piece of software, that reads the desired color combinations from the USB port and lights up the three colors of the LED accordingly. I wrote this firmware already.<\/li>\n<li>The&nbsp;<strong><em>Software<\/em><\/strong>, that sends the necessary color codes to the USB port as a result of more or less complex events in the computer has only just begun its development phase. I am afraid that this part has the greatest complexity. In other words, it is possible to invest a huge amount of effort in order to create a more or less luxurious thing. This part may never really be finished. \ud83d\ude42<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p><a href=\"\/en\/archives\/3965\/lava-lamp-project-part-2-firmware\/\">Here is part 2 of this series<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Sorry, this entry is only available in Deutsch.<\/p>\n <a class=\"more-link\" href=\"https:\/\/heiniger-net-archive.blog-net.ch\/en\/archives\/3930\/lavalamp-project-1\/\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,13],"tags":[],"class_list":["post-3930","post","type-post","status-publish","format-standard","hentry","category-computer","category-home-stories"],"_links":{"self":[{"href":"https:\/\/heiniger-net-archive.blog-net.ch\/en\/wp-json\/wp\/v2\/posts\/3930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/heiniger-net-archive.blog-net.ch\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/heiniger-net-archive.blog-net.ch\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/heiniger-net-archive.blog-net.ch\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/heiniger-net-archive.blog-net.ch\/en\/wp-json\/wp\/v2\/comments?post=3930"}],"version-history":[{"count":2,"href":"https:\/\/heiniger-net-archive.blog-net.ch\/en\/wp-json\/wp\/v2\/posts\/3930\/revisions"}],"predecessor-version":[{"id":4005,"href":"https:\/\/heiniger-net-archive.blog-net.ch\/en\/wp-json\/wp\/v2\/posts\/3930\/revisions\/4005"}],"wp:attachment":[{"href":"https:\/\/heiniger-net-archive.blog-net.ch\/en\/wp-json\/wp\/v2\/media?parent=3930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/heiniger-net-archive.blog-net.ch\/en\/wp-json\/wp\/v2\/categories?post=3930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/heiniger-net-archive.blog-net.ch\/en\/wp-json\/wp\/v2\/tags?post=3930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}