{"id":57527,"date":"2022-02-04T15:46:46","date_gmt":"2022-02-04T14:46:46","guid":{"rendered":"https:\/\/ar3dp.de\/docs\/programmieren\/arduino\/imatic-v2-16-channels-relay-wlan-remote-steuerung\/"},"modified":"2022-02-04T15:46:46","modified_gmt":"2022-02-04T14:46:46","slug":"imatic-v2-16-channels-relay-wlan-remote-steuerung","status":"publish","type":"docs","link":"https:\/\/ar3dp.de\/en\/docs\/programmieren\/arduino\/imatic-v2-16-channels-relay-wlan-remote-steuerung\/","title":{"rendered":"iMatic V2 16 Channels Relay &#8211; Ansteuerung mit Arduino"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Die WLAN-f\u00e4hige Relaiskarte von <a href=\"https:\/\/amzn.to\/3L9IKnP\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">iMatic<\/a> <em>[Amazon Partnerlink]<\/em> l\u00e4sst sich wunderbar mit Arduino ansteuern. Wie das funktioniert, zeigt dir diese Anleitung.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"was-brauche-ich\">Was brauche ich?<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/amzn.to\/3L9IKnP\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">iMatic v2 16-Channel-Relaisboard<\/a> <em>[Amazon Partnerlink]<\/em> <\/li><li><a href=\"http:\/\/www.arduino.cc\/en\/Main\/Software\" rel=\"nofollow noopener\" target=\"_blank\">Arduino IDE<\/a><\/li><li><a href=\"https:\/\/amzn.to\/3sjPUx0\" rel=\"nofollow noopener\" target=\"_blank\">Arduino Uno<\/a> <em>[Amazon Partnerlink]<\/em> <\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"steuerung-uber-arduino\">Steuerung \u00fcber Arduino<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"arduino-verbinden\">Arduino verbinden<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Verbinde nun Ihren Arduino mit Ihrem Computer. Beim ersten Mal werden alle ben\u00f6tigten Treiber installiert. Ist die Installation abgeschlossen k\u00f6nnen Sie die Arduino Software zur Programmierung starten.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"code-beispiel\">Code-Beispiel<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-c++src&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C++&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;cpp&quot;}\">#General code from:\nYourDuino Example: Relay Control 1.10\nHandles &quot;Relay is active-low&quot; to assure\nno relay activation from reset until\napplication is ready.\nterry@yourduino.com\n\n#Extended &amp; edited by:\nAndreas Reitberger\nkontakt@andreas-reitberger.de\n*\/\n\n\/*\u2014\u2013( Import needed libraries )\u2014\u2013*\/\n\/*\u2014\u2013( Declare Constants )\u2014\u2013*\/\n#define RELAY_ON 0\n#define RELAY_OFF 1\n\/*\u2014\u2013( Declare objects )\u2014\u2013*\/\n\/*\u2014\u2013( Declare Variables )\u2014\u2013*\/\nint mode = 1;\nint waittimer = 250; \/\/Waittimer between switch ON\/OFF (in ms)\n\/*\u2014\u2013( Declare Pins\u2014-*\/\n\/\/ Arduino Digital I\/O pin number\n\/\/Relais 1-8\n#define Relay_1 2\n#define Relay_2 3\n#define Relay_3 4\n#define Relay_4 5\n#define Relay_5 6\n#define Relay_6 7\n#define Relay_7 8\n#define Relay_8 9\n\/\/Relais 9-16\n\/*\n\/\/Make sure your Arduino has this much Output Pins!\n#define Relay_9 10\n#define Relay_10 11\n#define Relay_11 12\n#define Relay_12 13\n#define Relay_13 14\n#define Relay_14 15\n#define Relay_15 16\n#define Relay_16 16\n*\/\nvoid setup() \/****** SETUP: RUNS ONCE ******\/\n{\n\/\/\u2014\u2014-( Initialize Pins so relays are inactive at reset)\u2014-\ndigitalWrite(Relay_1, RELAY_OFF);\ndigitalWrite(Relay_2, RELAY_OFF);\ndigitalWrite(Relay_3, RELAY_OFF);\ndigitalWrite(Relay_4, RELAY_OFF);\ndigitalWrite(Relay_5, RELAY_OFF);\ndigitalWrite(Relay_6, RELAY_OFF);\ndigitalWrite(Relay_7, RELAY_OFF);\ndigitalWrite(Relay_8, RELAY_OFF);\n\n\/\/\u2014( THEN set pins as outputs )\u2014-\npinMode(Relay_1, OUTPUT);\npinMode(Relay_2, OUTPUT);\npinMode(Relay_3, OUTPUT);\npinMode(Relay_4, OUTPUT);\npinMode(Relay_5, OUTPUT);\npinMode(Relay_6, OUTPUT);\npinMode(Relay_7, OUTPUT);\npinMode(Relay_8, OUTPUT);\ndelay(4000); \/\/Check that all relays are inactive at Reset\n\n}\/\/\u2013(end setup )\u2014\n\nvoid loop() \/****** LOOP: RUNS CONSTANTLY ******\/\n{\n\/*Mode 1\nLight effect for the roof LED'S\n*\/\ndo{\n\/\/\u2014( Turn all 8 relays ON in sequence)\u2014\n\/\/LED-Stripe 01\ndigitalWrite(Relay_1, RELAY_ON);\/\/ set the Relay ON\ndelay(waittimer); \/\/ wait for a second\ndigitalWrite(Relay_1, RELAY_OFF);\/\/ set the Relay OFF\n\/\/LED-Stripe 02\ndigitalWrite(Relay_2, RELAY_ON);\/\/ set the Relay ON\ndelay(waittimer); \/\/ wait for a second\ndigitalWrite(Relay_2, RELAY_OFF);\/\/ set the Relay OFF\n\/\/LED-Stripe 03\ndigitalWrite(Relay_3, RELAY_ON);\/\/ set the Relay ON\ndelay(waittimer); \/\/ wait for a second\ndigitalWrite(Relay_3, RELAY_OFF);\/\/ set the Relay OFF\n\/\/LED-Stripe 04\ndigitalWrite(Relay_4, RELAY_ON);\/\/ set the Relay ON\ndelay(waittimer);\ndigitalWrite(Relay_4, RELAY_OFF);\/\/ set the Relay OFF\n\/\/LED-Stripe 05\ndigitalWrite(Relay_5, RELAY_ON);\/\/ set the Relay ON\ndelay(waittimer); \/\/ wait for a second\ndigitalWrite(Relay_5, RELAY_OFF);\/\/ set the Relay OFF\n\/\/LED-Stripe 06\ndigitalWrite(Relay_6, RELAY_ON);\/\/ set the Relay ON\ndelay(waittimer); \/\/ wait for a second\ndigitalWrite(Relay_6, RELAY_OFF);\/\/ set the Relay OFF\n\/\/LED-Stripe 07\ndigitalWrite(Relay_7, RELAY_ON);\/\/ set the Relay ON\ndelay(waittimer); \/\/ wait for a second\ndigitalWrite(Relay_7, RELAY_OFF);\/\/ set the Relay OFF\n\/\/LED-Stripe 08\ndigitalWrite(Relay_8, RELAY_ON);\/\/ set the Relay ON\ndelay(waittimer);\ndigitalWrite(Relay_8, RELAY_OFF);\/\/ set the Relay OFF\ndelay(4000); \/\/ wait see all relays ON\n\nfor (int i = 1; i &lt;= 5; i++)\n{\n\/\/\u2014( Turn all 8 relays OFF in sequence)\u2014\ndigitalWrite(Relay_1, RELAY_OFF);\/\/ set the Relay OFF\ndigitalWrite(Relay_2, RELAY_OFF);\/\/ set the Relay OFF\ndigitalWrite(Relay_3, RELAY_OFF);\/\/ set the Relay OFF\ndigitalWrite(Relay_4, RELAY_OFF);\/\/ set the Relay OFF\ndigitalWrite(Relay_5, RELAY_OFF);\/\/ set the Relay OFF\ndigitalWrite(Relay_6, RELAY_OFF);\/\/ set the Relay OFF\ndigitalWrite(Relay_7, RELAY_OFF);\/\/ set the Relay OFF\ndigitalWrite(Relay_8, RELAY_OFF);\/\/ set the Relay OFF\ndelay(waittimer*2); \/\/ wait see all relays OFF\n\/\/\u2014( Turn all 8 relays ON in sequence)\u2014\ndigitalWrite(Relay_1, RELAY_ON);\/\/ set the Relay OFF\ndigitalWrite(Relay_2, RELAY_ON);\/\/ set the Relay OFF\ndigitalWrite(Relay_3, RELAY_ON);\/\/ set the Relay OFF\ndigitalWrite(Relay_4, RELAY_ON);\/\/ set the Relay OFF\ndigitalWrite(Relay_5, RELAY_ON);\/\/ set the Relay OFF\ndigitalWrite(Relay_6, RELAY_ON);\/\/ set the Relay OFF\ndigitalWrite(Relay_7, RELAY_ON);\/\/ set the Relay OFF\ndigitalWrite(Relay_8, RELAY_ON);\/\/ set the Relay OFF\ndelay(waittimer*2); \/\/ wait see all relays OFF\n}\n}\nwhile (mode == 1);\n\n\/\/\u2014( Turn all 8 relays ON in sequence)\u2014\ndigitalWrite(Relay_1, RELAY_ON);\/\/ set the Relay ON\ndelay(1000); \/\/ wait for a second\ndigitalWrite(Relay_2, RELAY_ON);\/\/ set the Relay ON\ndelay(1000); \/\/ wait for a second\ndigitalWrite(Relay_3, RELAY_ON);\/\/ set the Relay ON\ndelay(1000); \/\/ wait for a second\ndigitalWrite(Relay_4, RELAY_ON);\/\/ set the Relay ON\ndelay(1000);\ndigitalWrite(Relay_5, RELAY_ON);\/\/ set the Relay ON\ndelay(1000); \/\/ wait for a second\ndigitalWrite(Relay_6, RELAY_ON);\/\/ set the Relay ON\ndelay(1000); \/\/ wait for a second\ndigitalWrite(Relay_7, RELAY_ON);\/\/ set the Relay ON\ndelay(1000); \/\/ wait for a second\ndigitalWrite(Relay_8, RELAY_ON);\/\/ set the Relay ON\ndelay(4000); \/\/ wait see all relays ON\n\n\/\/\u2014( Turn all 8 relays OFF in sequence)\u2014\ndigitalWrite(Relay_1, RELAY_OFF);\/\/ set the Relay OFF\ndelay(1000); \/\/ wait for a second\ndigitalWrite(Relay_2, RELAY_OFF);\/\/ set the Relay OFF\ndelay(1000); \/\/ wait for a second\ndigitalWrite(Relay_3, RELAY_OFF);\/\/ set the Relay OFF\ndelay(1000); \/\/ wait for a second\ndigitalWrite(Relay_4, RELAY_OFF);\/\/ set the Relay OFF\ndelay(1000);\ndigitalWrite(Relay_5, RELAY_OFF);\/\/ set the Relay OFF\ndelay(1000); \/\/ wait for a second\ndigitalWrite(Relay_6, RELAY_OFF);\/\/ set the Relay OFF\ndelay(1000); \/\/ wait for a second\ndigitalWrite(Relay_7, RELAY_OFF);\/\/ set the Relay OFF\ndelay(1000); \/\/ wait for a second\ndigitalWrite(Relay_8, RELAY_OFF);\/\/ set the Relay OFF\ndelay(4000); \/\/ wait see all relays OFF\n\n}\/\/\u2013(end main loop )\u2014\n\n\/\/*********( THE END )***********<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Die WLAN-f\u00e4hige Relaiskarte von iMatic [Amazon Partnerlink] l\u00e4sst sich wunderbar mit Arduino ansteuern. Wie das funktioniert, zeigt dir diese Anleitung. Was brauche ich? iMatic v2 16-Channel-Relaisboard [Amazon Partnerlink] Arduino IDE Arduino Uno [Amazon Partnerlink] Steuerung \u00fcber Arduino Arduino verbinden Verbinde nun Ihren Arduino mit Ihrem Computer. Beim ersten Mal werden alle ben\u00f6tigten Treiber installiert. Ist&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":55462,"menu_order":1,"comment_status":"open","ping_status":"closed","template":"","meta":{"_featured":false,"_is_vendor_doc":"0","footnotes":""},"doc_tag":[],"class_list":["post-57527","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/docs\/57527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/comments?post=57527"}],"version-history":[{"count":0,"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/docs\/57527\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/docs\/55462"}],"prev":[{"title":"NodeMCU mit Arduino IDE programmieren","link":"https:\/\/ar3dp.de\/en\/docs\/programmieren\/arduino\/nodemcu-mit-arduino-ide-programmieren\/","href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/docs\/55466"}],"wp:attachment":[{"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/media?parent=57527"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/doc_tag?post=57527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}