{"id":1045,"date":"2023-05-01T09:35:34","date_gmt":"2023-05-01T07:35:34","guid":{"rendered":"https:\/\/www.paluweb.nl\/?p=1045"},"modified":"2024-02-21T13:01:51","modified_gmt":"2024-02-21T11:01:51","slug":"artemis-v1-22-the-new-automation-module","status":"publish","type":"post","link":"https:\/\/www.paluweb.nl\/?p=1045","title":{"rendered":"Artemis v1.22: The new automation module"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>As you may have noticed, I love calling everything a &#8220;module&#8221; more and more. And with good reason: If you build a project of this size, splitting up in modules makes sense. It allows you to focus on PART of the problem, and replace the module if you find something smarter \/ better.<\/p>\n<\/blockquote>\n\n\n\n<div style=\"height:46px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Required specs for the new automation hardware<\/h2>\n\n\n\n<p>As I was building out something new, I figured it should be big and bad enough to handle anything I want to throw at it, PLUS have room for future expansion. As I was falling in love with many smaller light sources again, and the RGB-CCT led panels, I came to the conclusion that whatever hardware I build, it has to have MANY channels I can use to control and possibly dim all hardware. Just as an idea, I wanted to use three RGB-CCT led panels, and those use 5 channels each for red, green, blue, cold- and warm white. So that is 15 PWM channels at 24V already maxing out an Arduino Mega (which has exactly 15 PWM outputs). So I needed more. Time to grab back to my faithful <a rel=\"noreferrer noopener\" href=\"https:\/\/www.nxp.com\/products\/power-management\/lighting-driver-and-controller-ics\/led-controllers\/16-channel-12-bit-pwm-fm-plus-ic-bus-led-controller:PCA9685\" target=\"_blank\">PCA9586<\/a> PWM I<sup>2<\/sup>C-based controllers. I would not place them onboard this time, but design them as separate modules that I could either place on top of the Artemis Controller, or optionally somewhere else (just running power to them and the I<sup>2<\/sup>C connection).<\/p>\n\n\n\n<p>In the end, this is the huge wishlist I cam up with regarding the automation hardware:<\/p>\n\n\n\n<!--more-->\n\n\n\n<ul class=\"wp-block-list\">\n<li>Needs to have a &#8220;smart&#8221; \/ web-enabled frontend;<\/li>\n\n\n\n<li>Needs to have a &#8220;dumb&#8221; controller to make sure nothing floods \/ breaks;<\/li>\n\n\n\n<li>Needs at least 3x RGB-CCT (24V) + 10x led 10W powerled (12V) outputs +5 pumps = 30 PWM outputs <\/li>\n\n\n\n<li>Needs some digital outputs for control of valves (12V \/ 24V mix)<\/li>\n\n\n\n<li>Needs an ability to control a single NeoPixel led strip (while I am at it &#8211; I can use this to draw stars, the moon, sunrise and sunsets);<\/li>\n\n\n\n<li>Needs 4x 230VAC relais to switch anything that cannot be lower DC voltage (like aquarium heaters);<\/li>\n\n\n\n<li>Needs digital inputs in order to measure water levels;<\/li>\n\n\n\n<li>Needs to have multiple I<sup>2<\/sup>C channels so I can add SHT-XX humidity\/temperature sensors;<\/li>\n\n\n\n<li>Needs to have inputs for at least 3 LM35 temperature sensors;<\/li>\n\n\n\n<li>Needs to have a very well controlled FAN speed controller for a (set of) 4-pin fan(s);<\/li>\n\n\n\n<li>Needs to have an input for a Ph sensor and two more analog inputs for measuring things like water conductivity;<\/li>\n\n\n\n<li>RealTime Clock (RTC) added to the hardware.<\/li>\n<\/ul>\n\n\n\n<p>Can you believe this list!!! Impossible? As it turned out, no&#8230; Just a bit complex. I solved the number of I\/O&#8217;s required by using an Arduino Mega Pro, and extending on the huge amount of PWM channels required with a set of two PCA9685-based expansion modules. One I will run at 24V (delivering 3x RGB-CCT + one spare output), the other will run at 12V (mainly for the 10W &#8220;follow the sun&#8221; power leds). Arduino&#8217;s onboard PWMs will be used for non-lighting things requiring PWM (like DC pumps that require speed control).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/www.paluweb.nl\/wp-content\/uploads\/2022\/12\/img_5400-scaled.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"1024\" src=\"https:\/\/www.paluweb.nl\/wp-content\/uploads\/2022\/12\/img_5400-768x1024.jpg\" alt=\"\" class=\"wp-image-1024\" style=\"width:721px;height:961px\" srcset=\"https:\/\/www.paluweb.nl\/wp-content\/uploads\/2022\/12\/img_5400-768x1024.jpg 768w, https:\/\/www.paluweb.nl\/wp-content\/uploads\/2022\/12\/img_5400-225x300.jpg 225w, https:\/\/www.paluweb.nl\/wp-content\/uploads\/2022\/12\/img_5400-1152x1536.jpg 1152w, https:\/\/www.paluweb.nl\/wp-content\/uploads\/2022\/12\/img_5400-1536x2048.jpg 1536w, https:\/\/www.paluweb.nl\/wp-content\/uploads\/2022\/12\/img_5400-scaled.jpg 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><figcaption class=\"wp-element-caption\"><em>Here you can clearly see the design that was made: A large base PCB where an Arduino Mega Pro can be pinned on. Mostly all around the edge of the PCB you&#8217;ll find I\/O&#8217;s. Here the additional boards (Raspberry Pi and two PCA9685 boards) are mounted in a way I can still reach the base PCB. They can also be mounted on top of the base PCB. More compact but harder to troubleshoot \ud83d\ude42<\/em><\/figcaption><\/figure>\n<\/div>\n\n\n<p>Rewriting the existing software to work on this new hardware was relatively straight-forward; as the architecture remained mostly the same the majority of work was focusing on the new features. The <a rel=\"noreferrer noopener\" href=\"https:\/\/www.nxp.com\/products\/power-management\/lighting-driver-and-controller-ics\/led-controllers\/16-channel-12-bit-pwm-fm-plus-ic-bus-led-controller:PCA9685\" target=\"_blank\">PCA9685<\/a> wasn&#8217;t new, neither was the <a rel=\"noreferrer noopener\" href=\"https:\/\/www.ti.com\/product\/PCA9546A\" target=\"_blank\">PCA9546A<\/a> I<sup>2<\/sup>C bus-switch chip I already used in an earlier version of the board (1.01). It were the things like the <a href=\"https:\/\/www.instructables.com\/Neopixels-How-Do-They-Work\/\" target=\"_blank\" rel=\"noreferrer noopener\">NeoPixel<\/a> led strip that REALLY took some time to build and get working. But ey, it is all great fun!<\/p>\n\n\n\n<p>On the picture above you can see the base board with an <a href=\"https:\/\/www.amazon.com\/s?k=arduino+mega+pro&amp;sprefix=arduino+mega+pro\" target=\"_blank\" rel=\"noreferrer noopener\">Arduino Mega Pro<\/a> pinned on top. The additional boards on top are two PCA9685-based boards each carrying 16 PWM outputs, and the third board is the <a href=\"https:\/\/www.raspberrypi.com\/products\/raspberry-pi-3-model-b-plus\/\" target=\"_blank\" rel=\"noreferrer noopener\">Raspberry Pi 3b+<\/a>. <\/p>\n\n\n\n<p>Also visible in this picture are two RGB-CCT led tiles (one 30x30cm and one 120x30cm), A 10W power led with a collimator lens 3D printed to it on a heatsink, and a 4-pin fan that can be controlled (PWM) and measured back (actual RPM).<\/p>\n\n\n\n<p>A closeup on one of the PCA9685 modules can be seen here:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.paluweb.nl\/wp-content\/uploads\/2022\/12\/img_5468-scaled.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"2509\" src=\"https:\/\/www.paluweb.nl\/wp-content\/uploads\/2022\/12\/img_5468-scaled.jpg\" alt=\"\" class=\"wp-image-1018\" srcset=\"https:\/\/www.paluweb.nl\/wp-content\/uploads\/2022\/12\/img_5468-scaled.jpg 2560w, https:\/\/www.paluweb.nl\/wp-content\/uploads\/2022\/12\/img_5468-300x294.jpg 300w\" sizes=\"auto, (max-width: 2560px) 100vw, 2560px\" \/><\/a><figcaption class=\"wp-element-caption\">Close up on one of the PWM extension modules, based on the PCA9685. These are called &#8220;Apollo modules&#8221; in honor of the original modules I used for lighting back in 2005 (!!). There are two variants: One with 3&#215;5+1 channel (this one),and there is also one featuring 16&#215;1 channels. All controlled by I<sup>2<\/sup>C, all fully opto-isolated.<\/figcaption><\/figure>\n\n\n\n<p> All of the home-built PCBs were designed in <a rel=\"noreferrer noopener\" href=\"https:\/\/www.kicad.org\/\" target=\"_blank\">KiCAD<\/a> and were produced (including SMT mounting) by <a rel=\"noreferrer noopener\" href=\"https:\/\/jlcpcb.com\/\" target=\"_blank\">JLCPCB<\/a> (Kudo&#8217;s to them for always creating perfect PCBs with all SMT part mounted for me; my eyes aren&#8217;t getting any younger \ud83d\ude09 ). <\/p>\n\n\n\n<p>If you want to know all the things this board can do, stay tuned! Way more cool stuff coming soon!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As you may have noticed, I love calling everything a &#8220;module&#8221; more and more. And with good reason: If you build a project of this size, splitting up in modules makes sense. It allows you to focus on PART of &hellip; <a href=\"https:\/\/www.paluweb.nl\/?p=1045\">Read more <span class=\"meta-nav\">&raquo;<\/span><\/a><\/p>\n","protected":false},"author":12,"featured_media":964,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[268,262,267],"class_list":["post-1045","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-paludarium","tag-arduino","tag-artemis","tag-paludarium-controller"],"jetpack_featured_media_url":"https:\/\/www.paluweb.nl\/wp-content\/uploads\/2020\/05\/IMG_0034.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.paluweb.nl\/index.php?rest_route=\/wp\/v2\/posts\/1045","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.paluweb.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.paluweb.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.paluweb.nl\/index.php?rest_route=\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.paluweb.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1045"}],"version-history":[{"count":12,"href":"https:\/\/www.paluweb.nl\/index.php?rest_route=\/wp\/v2\/posts\/1045\/revisions"}],"predecessor-version":[{"id":1244,"href":"https:\/\/www.paluweb.nl\/index.php?rest_route=\/wp\/v2\/posts\/1045\/revisions\/1244"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.paluweb.nl\/index.php?rest_route=\/wp\/v2\/media\/964"}],"wp:attachment":[{"href":"https:\/\/www.paluweb.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1045"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.paluweb.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1045"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.paluweb.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1045"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}