From bee4d22053309ad3683061b40b3e8d4435e3c03f Mon Sep 17 00:00:00 2001 From: Alex Waclawik <63373427+AlexWaclawik@users.noreply.github.com> Date: Sat, 5 Feb 2022 23:25:46 -0500 Subject: [PATCH 1/7] Add files via upload --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 47cb367..ff1b854 100644 --- a/README.md +++ b/README.md @@ -10,19 +10,19 @@ interface for interacting with the microcontroller. 1. [ELEGOO UNO R3 Board ATmega328P with USB Cable (Arduino UNO Clone)](https://www.elegoo.com/products/elegoo-uno-r3-board) - Acts as the main board, and is fully compatible with Arduino. -![board](media/board-modem.jpg) + - ![board](media/board-modem.jpg) 2. [Botletics™ SIM7000A LTE CAT-M1/NB-IoT + GPS Shield Kit](https://www.botletics.com/products/sim7000-shield) - This kit acts as a modem. It also offers expanability for the future. -![antenna](media/antenna.jpg) + - ![antenna](media/antenna.jpg) 3. [1NCE FlexSIM Card](https://1nce.com/en/sim-cards/) - This pre-paid SIM card is offered for 10 years with a 500 MB limit, making it perfect for low-bandwith IoT devices. - TCP was chosen over SMS, as the 1NCE SIM Card only has an SMS limit of 250 messages, which is not enough for the 10 year period. 4. [MCIGICM 2 Channel DC 5V Relay Module for Arduino UNO](https://www.amazon.com/gp/product/B072BY3KJF?psc=1) - Opto-isolated relay for maximum safety of the outlet. -![relay](media/relay.jpg) + - ![relay](media/relay.jpg) 5. [Adafruit 328 Lithium Ion Battery, 3.7V, 2500mAh](https://www.adafruit.com/product/328) - Along with the power supply, provides additonal power for activating the relay. -![battery](media/battery.jpg) + - ![battery](media/battery.jpg)

From f9e2c80c8386cd353c3f2a1bca318e399e9d0636 Mon Sep 17 00:00:00 2001 From: Alex Waclawik <63373427+AlexWaclawik@users.noreply.github.com> Date: Sat, 5 Feb 2022 23:30:05 -0500 Subject: [PATCH 2/7] Add files via upload --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ff1b854..f53ed77 100644 --- a/README.md +++ b/README.md @@ -10,19 +10,19 @@ interface for interacting with the microcontroller. 1. [ELEGOO UNO R3 Board ATmega328P with USB Cable (Arduino UNO Clone)](https://www.elegoo.com/products/elegoo-uno-r3-board) - Acts as the main board, and is fully compatible with Arduino. - - ![board](media/board-modem.jpg) + ![board](media/board-modem.jpg) 2. [Botletics™ SIM7000A LTE CAT-M1/NB-IoT + GPS Shield Kit](https://www.botletics.com/products/sim7000-shield) - This kit acts as a modem. It also offers expanability for the future. - - ![antenna](media/antenna.jpg) + ![antenna](media/antenna.jpg) 3. [1NCE FlexSIM Card](https://1nce.com/en/sim-cards/) - This pre-paid SIM card is offered for 10 years with a 500 MB limit, making it perfect for low-bandwith IoT devices. - TCP was chosen over SMS, as the 1NCE SIM Card only has an SMS limit of 250 messages, which is not enough for the 10 year period. 4. [MCIGICM 2 Channel DC 5V Relay Module for Arduino UNO](https://www.amazon.com/gp/product/B072BY3KJF?psc=1) - Opto-isolated relay for maximum safety of the outlet. - - ![relay](media/relay.jpg) + ![relay](media/relay.jpg) 5. [Adafruit 328 Lithium Ion Battery, 3.7V, 2500mAh](https://www.adafruit.com/product/328) - Along with the power supply, provides additonal power for activating the relay. - - ![battery](media/battery.jpg) + ![battery](media/battery.jpg)

From a3bd95eb633ff1532f9947113baf7b13840afe2f Mon Sep 17 00:00:00 2001 From: Alex Waclawik <63373427+AlexWaclawik@users.noreply.github.com> Date: Sat, 5 Feb 2022 23:30:29 -0500 Subject: [PATCH 3/7] Add files via upload --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f53ed77..e4343f3 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ interface for interacting with the microcontroller. - Along with the power supply, provides additonal power for activating the relay. ![battery](media/battery.jpg) -

+

### Operation From b56efd3ba9f8dca7c6d2b1d688c9684679dcd546 Mon Sep 17 00:00:00 2001 From: Alex Waclawik <63373427+AlexWaclawik@users.noreply.github.com> Date: Sat, 5 Feb 2022 23:31:15 -0500 Subject: [PATCH 4/7] Add files via upload --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e4343f3..0c5fac6 100644 --- a/README.md +++ b/README.md @@ -11,20 +11,24 @@ interface for interacting with the microcontroller. 1. [ELEGOO UNO R3 Board ATmega328P with USB Cable (Arduino UNO Clone)](https://www.elegoo.com/products/elegoo-uno-r3-board) - Acts as the main board, and is fully compatible with Arduino. ![board](media/board-modem.jpg) + 2. [Botletics™ SIM7000A LTE CAT-M1/NB-IoT + GPS Shield Kit](https://www.botletics.com/products/sim7000-shield) - This kit acts as a modem. It also offers expanability for the future. ![antenna](media/antenna.jpg) + 3. [1NCE FlexSIM Card](https://1nce.com/en/sim-cards/) - This pre-paid SIM card is offered for 10 years with a 500 MB limit, making it perfect for low-bandwith IoT devices. - TCP was chosen over SMS, as the 1NCE SIM Card only has an SMS limit of 250 messages, which is not enough for the 10 year period. + 4. [MCIGICM 2 Channel DC 5V Relay Module for Arduino UNO](https://www.amazon.com/gp/product/B072BY3KJF?psc=1) - Opto-isolated relay for maximum safety of the outlet. ![relay](media/relay.jpg) + 5. [Adafruit 328 Lithium Ion Battery, 3.7V, 2500mAh](https://www.adafruit.com/product/328) - Along with the power supply, provides additonal power for activating the relay. ![battery](media/battery.jpg) -

+

### Operation From 53cf0afa9373c9a59174c156a19e3baf531ee882 Mon Sep 17 00:00:00 2001 From: Alex Waclawik <63373427+AlexWaclawik@users.noreply.github.com> Date: Sat, 5 Feb 2022 23:31:56 -0500 Subject: [PATCH 5/7] Add files via upload --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0c5fac6..ff1b854 100644 --- a/README.md +++ b/README.md @@ -10,23 +10,19 @@ interface for interacting with the microcontroller. 1. [ELEGOO UNO R3 Board ATmega328P with USB Cable (Arduino UNO Clone)](https://www.elegoo.com/products/elegoo-uno-r3-board) - Acts as the main board, and is fully compatible with Arduino. - ![board](media/board-modem.jpg) - + - ![board](media/board-modem.jpg) 2. [Botletics™ SIM7000A LTE CAT-M1/NB-IoT + GPS Shield Kit](https://www.botletics.com/products/sim7000-shield) - This kit acts as a modem. It also offers expanability for the future. - ![antenna](media/antenna.jpg) - + - ![antenna](media/antenna.jpg) 3. [1NCE FlexSIM Card](https://1nce.com/en/sim-cards/) - This pre-paid SIM card is offered for 10 years with a 500 MB limit, making it perfect for low-bandwith IoT devices. - TCP was chosen over SMS, as the 1NCE SIM Card only has an SMS limit of 250 messages, which is not enough for the 10 year period. - 4. [MCIGICM 2 Channel DC 5V Relay Module for Arduino UNO](https://www.amazon.com/gp/product/B072BY3KJF?psc=1) - Opto-isolated relay for maximum safety of the outlet. - ![relay](media/relay.jpg) - + - ![relay](media/relay.jpg) 5. [Adafruit 328 Lithium Ion Battery, 3.7V, 2500mAh](https://www.adafruit.com/product/328) - Along with the power supply, provides additonal power for activating the relay. - ![battery](media/battery.jpg) + - ![battery](media/battery.jpg)

From 409b7da4dbb3c03c0bdc9eca025627b15fabdfe3 Mon Sep 17 00:00:00 2001 From: Alex Waclawik <63373427+AlexWaclawik@users.noreply.github.com> Date: Sat, 5 Feb 2022 23:38:25 -0500 Subject: [PATCH 6/7] Add files via upload --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ff1b854..3988f67 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ interface for interacting with the microcontroller. - [Blynk](https://github.com/blynkkk/blynk-library) To Install: -1. [Download the latest release from here]() +1. [Download the latest release from here](https://github.com/AlexWaclawik/Arduino-IoT-Switch/releases) 2. Unzip the contents. The necessary libraries are located in ```/include``` 3. Place the dependancies into your Arduino Libraries Folder - On Windows: ```C:\Users\user\Documents\Arduino\libraries``` From 133d4acf6c84a0c89a932376c4466c1fa2404bb3 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 6 Feb 2022 13:35:11 -0500 Subject: [PATCH 7/7] fixed heartbeat interval --- main/main.ino | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/main/main.ino b/main/main.ino index 42aaf46..b817a27 100644 --- a/main/main.ino +++ b/main/main.ino @@ -2,6 +2,10 @@ * Author: Alex Waclawik * Github: https://github.com/AlexWaclawik/Arduino-IoT-Switch * This project is for a remote AC outlet switch that is made using an Arduino microcontroller. + * + * IMPORTANT: Adjust BLYNK_HEARTBEAT (in sec) in BlynkGsmClient.h to suit your application. + * newHeartbeatInterval * 2.3 formula will be applied. For example, for a 600 sec heartbeat + * you will get a notification regarding the connection status with 23 min delay in worst case. */ // these Blynk definitions ALWAYS have to be first @@ -32,7 +36,7 @@ #include SoftwareSerial SerialAT(TX, RX); -// configure GPRS settings (user and pass may be optional depending on your SIM carD) +// configure GPRS settings (user and pass may be optional depending on your SIM card) const char apn[] = "iot.1nce.net"; const char user[] = ""; const char pass[] = ""; @@ -94,8 +98,8 @@ void setup() { // configure relay and ensure it is off pinMode(RELAY_PIN1, OUTPUT); digitalWrite(RELAY_PIN1, HIGH); - // pinMode(RELAY_PIN1, OUTPUT); - // digitalWrite(RELAY_PIN1, HIGH); + // pinMode(RELAY_PIN2, OUTPUT); + // digitalWrite(RELAY_PIN2, HIGH); pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, LOW); @@ -119,6 +123,10 @@ void setup() { // connect to Blynk Blynk.begin(auth, modem, apn, user, pass); + + // verify heartbeat is set correctly + SerialMon.print("Heartbeat (sec): "); + SerialMon.println(BLYNK_HEARTBEAT); } @@ -133,4 +141,4 @@ void loop() { Blynk.syncVirtual(V1); startup = false; } -} \ No newline at end of file +}