From cf2476a01895feb3e889f9f65021c04125730182 Mon Sep 17 00:00:00 2001 From: Dejvino Date: Tue, 29 Mar 2022 09:59:41 +0200 Subject: [PATCH] Adding details --- README.md | 18 ++++++++++-------- code.ino | 9 +++++---- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1d91d0b..297c77a 100644 --- a/README.md +++ b/README.md @@ -10,17 +10,19 @@ TODO: image of result A microcontroller is powered from a 5V brick (always connected). It controls a set of relays, which in turn enable power to individual power sockets. Upon boot the microcontroller waits a few seconds before enabling each of the power sockets. Then it sits idly by until the next power outage. All of this is enclosed in an electrical distribution box. +Optionally a speaker is used to indicate the state of the power socket "boot" process. A circuit breaker may be added to guard the whole device from tripping the main circuit breaker in the building. + ## Bill of Materials -- microcontroller (Arduino) -- multi-relay module -- 5V power brick -- electrical distribution box -- power sockets modules for the distribution box -- corded power plug +- microcontroller (MCU, Arduino) +- multi-relay module board +- 5V power brick (to power the MCU and relays) +- socket for the power brick +- electrical distribution box (safe housing for the whole device) +- power socket modules suitable for the distribution box +- corded power plug (for connecting the whole device to electricity) - cables suitable for electrical wiring - speaker (optional) -- circuit breaker (optional) +- circuit breaker module (optional) TODO: image of internals - diff --git a/code.ino b/code.ino index fde2cb4..39fb25f 100644 --- a/code.ino +++ b/code.ino @@ -1,6 +1,6 @@ -#define LOW_POWER_SLEEP +#define LOW_POWER_SLEEP // dependency: Adafruit SleepyDog -#define SLOW_START_DELAY 1000 // ms +#define SLOW_START_DELAY 5000 // ms #define PIN_SPEAKER 12 #define RELAYS 8 @@ -37,8 +37,9 @@ void setup() { for (int i = 0; i < RELAYS; i++) { Serial.println("..."); + delay(SLOW_START_DELAY/2); beep(100, 10); - delay(SLOW_START_DELAY); + delay(SLOW_START_DELAY/2); Serial.print("Starting "); Serial.print(i+1); @@ -56,7 +57,7 @@ void setup() { delay(1000); beep(210, 100); beep(420, 100); - beep(560, 200); + beep(560, 500); digitalWrite(LED_BUILTIN, LOW); delay(1000); }