Main page
Recent changes
Arduino MEGA 63 relay Web switch
New name
B
I
U
S
link
image
code
list
Show page
Syntax
{TOC} [<-- Web page|http://remoteqth.com/arduino-web-switch.php] !Circuit diagram * Main board [.PDF|http://remoteqth.com/download-count.php?Down=hw/web-switch-02-mb.pdf] * 16 Relay board (one Bank) [.PDF|http://remoteqth.com/download-count.php?Down=hw/web-switch-02-rl.pdf] !PCB *[Main board Top|http://remoteqth.com/hw/web-switch02_top.png] *[Main board Bottom|http://remoteqth.com/hw/web-switch02_bottom.png] *[Main board Relay Top|http://remoteqth.com/hw/web-switch02-rel_top.png] *[Main board Relay Bottom|http://remoteqth.com/hw/web-switch02-rel_bottom.png] !Assembly SMD KIT gallery [http://remoteqth.com/img/wiki-web-switch.png|link=Web switch 0.2 assembly] *[Main board|Web switch 0.2 assembly] *[16 Relay board (one bank)|Web switch Relay 0.2 assembly] *[Mouting to DIN rail|Web switch mounting to DIN rail] !Running for to run you need a six component: * '''Arduino mega''' * Arduino '''Ethernet shield''' * '''micro SD''' card, no larger than ??GB * '''Main board''' * '''Power supply''' (5V to USB or up to 12V in DC plug) * Four '''relay board''' controlled by grounded input (Bank0-Bank3) - '''MAX +50V DC / 500 mA''' ** Bank0 16 outputs ** Bank1 16 outputs ** Bank2 16 outputs ** Bank3 15 outputs !!Hardware !!!Compose individual parts [http://remoteqth.com/img/wiki-web-switch-10.png] ✔ Main board + Ethernet shield + microSD card + Arduino MEGA [http://remoteqth.com/img/wiki-web-switch-11.png] ✔ How to deploy ---- Before plug '''micro SD card''', format at FAT16 and upload ascii file config.cfg with this content [http://remoteqth.com/img/microsd.png|noborder|left] {{[ajaxUrl=http://192.168.1.230] [deviceIp=192.168.1.230] [gatewayIp=192.168.1.1] [title=DM5XX web realy] [jsUrl=http://remoteqth.com/dm5xx-web-relay.js] [cssUrl=http://remoteqth.com/dm5xx-web-relay.css] [faviconUrl=http://remoteqth.com/favicon.ico] [dotUrl=http://remoteqth.com/dm5xx-web-relay-dot.png]}}you '''must configure''' the first three lines (IP addresses), in accordance with the settings in the Arduino firmware [http://remoteqth.com/img/wiki-web-switch-12.png] ❏ microSD plug to Ethernet shield and deployed to Arduino MEGA [http://remoteqth.com/img/wiki-web-switch-13.png] ❏ then connect to Main board !!!Configure jumper [http://remoteqth.com/img/wiki-web-switch-8b.png|noborder] * '''JP1''' - short disable '''auto reset''' from USB (must be open at upload firmware) * '''JP2''' - short connect power between Arduino DC input and power on Relay board - '''{.redka#id color: #f23f37;}WARNING{/}''' to maximum voltage Arduino Mega !!!How to connect own relay [http://remoteqth.com/img/wiki-web-switch-relay.png|noborder] !!!Large relay board flat cable [http://remoteqth.com/img/wiki-web-switch-rel-8.jpg] ❏ Pressing two connector to flat cable - '''{.redka#id color: #f23f37;}attention to the orientation,{/} both ends must be in same orientation compared to red wire in cable.''' [http://remoteqth.com/img/wiki-web-switch-rel-9.jpg] !!!Mounting to DIN rail [http://remoteqth.com/img/wiki-web-switch-rel-16.jpg|link=Web switch mounting to DIN rail] !!Firmware * For beginners [Getting Started with Arduino|http://arduino.cc/en/Guide/HomePage] * You can configure firmware from master tree [GitHub|https://github.com/dm5xx/mega_webswitch] **Or '''download''' preconfigured version ** [2015-10-14.zip|http://remoteqth.com/download-count.php?Down=sw/web-switch-dm5xx.zip] **'''config.cfg''' edited and copy to microSD card and plug to Ethernet shield * Download Arduino [IDE|https://www.arduino.cc/en/Main/Software] ** open'''.ino''' file, compile and upload to Arduino MEGA !!!Configure firmware * '''Network''' in section{{byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; byte ip[] = { 192, 168, 1, 230 }; byte gateway[] = { 192, 168, 1, 1 }; byte subnet[] = { 255, 255, 255, 0 };}} * '''Button function'''{{// arrays to store the state if a button shoud be stay online even if its switched of aka "5s-ON"-Buttons // everything is left as 16 part arrays. this means more ram, but less loops boolean stayOnPinsBank0[16] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; boolean stayOnPinsBank1[16] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; boolean stayOnPinsBank2[16] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; boolean stayOnPinsBank3[16] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; //arrays to define which buttons are long-on-button. startin with 0, setting 1 to the long switch buttons. must be 1:1 matched to the js buttons/description boolean is5sPinBank0[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; // 3 in bank0 boolean is5sPinBank1[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; // 3 in bank1 boolean is5sPinBank2[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; // 6 in bank2 boolean is5sPinBank3[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; // 0 in bank 3 boolean isOffPinBank0[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; // define if a button is a long-off-button. uses index from js file as everything else boolean isOffPinBank1[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; boolean isOffPinBank2[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; boolean isOffPinBank3[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; byte indexOfOffPinPairBank0[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; // definition which on-index the off-index belongs to byte indexOfOffPinPairBank1[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; byte indexOfOffPinPairBank2[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; byte indexOfOffPinPairBank3[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; // push duration - Adjust the individual push duration of a "long push button" here - On & Off byte pushDurationBank0[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; byte pushDurationBank1[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; byte pushDurationBank2[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; byte pushDurationBank3[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };}} ---- [<-- Web page|http://remoteqth.com/arduino-web-switch.php]
Password
Summary of changes