Skip to content

Commit 9b00ef0

Browse files
committed
User Manual writing commit 13
1 parent ef80511 commit 9b00ef0

File tree

5 files changed

+135
-3
lines changed

5 files changed

+135
-3
lines changed
Loading
1.96 MB
Loading

content/hardware/05.pro-solutions/solutions-and-kits/edge-control/tutorials/user-manual/content.md

Lines changed: 135 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ The Edge Control can be powered by:
9898
- Using a **12V lead-acid battery** connected to `BATT+` pin and `GND`. **It can be powered for up to 34 months on a 12V/5Ah battery**.
9999
- Using a whole **off grid** power system including an **18V Solar Panel** and a **12V lead-acid battery**.
100100

101-
![Edge Control powered by external power supply](assets/ext-power-v2.png)
101+
![Edge Control powered by external power supply](assets/ext-power.png)
102102
![Edge Control solar and battery powered](assets/green-power-v2.png)
103103

104104
### Hello World Example
@@ -420,7 +420,7 @@ This is a brief explanation of the mathematical expression used inside the sketc
420420

421421
`float w_level = ((voltsReference / 220.0 * 1000.0) - 4.0) * 6.25;`
422422

423-
![4-20mA example wiring](assets/4-20mA-wiring.png)
423+
![4-20mA example wiring](assets/4-20mA-wiring-v2.png)
424424

425425
```arduino
426426
#include <Arduino_EdgeControl.h>
@@ -751,6 +751,8 @@ MEASURES - Median: 1891.00Ω - Average: 1884.95Ω - Lowest: 1815.00Ω - Highest:
751751
14 CENTIBARS/kPa
752752
```
753753

754+
***You can buy the Watermarkd sensor directly from our [store](https://store-usa.arduino.cc/products/soil-humidity-sensor-watermark-2-m-75-cm-pack-).***
755+
754756
## Outputs
755757
### Latching Outputs
756758

@@ -872,10 +874,140 @@ Relay.off(RELAY_CH01); // this command opens the channel 1 relay contacts
872874
```
873875
![AC load wiring through channel 1 relay contact](assets/relay-outputs.png)
874876

875-
### Power Outputs
877+
The example code shown below closes and opens the first channel `Relay Contact` repetitively, turning on and off the connected load:
878+
879+
```cpp
880+
#include "Arduino_EdgeControl.h"
881+
882+
// #define SSR_POLL
883+
884+
constexpr unsigned long onInterval = { 5000 };
885+
constexpr unsigned long offInterval = { 5000 };
886+
constexpr unsigned long pollInterval = { 1000 };
887+
unsigned long offTime;
888+
unsigned long onTime;
889+
unsigned long pollTime;
890+
bool on = false;
891+
892+
int relayChannel { RELAY_CH01 };
893+
894+
void setup()
895+
{
896+
Serial.begin(9600);
897+
while (!Serial)
898+
;
899+
900+
delay(2000);
901+
902+
Serial.println("Hello, SolidStateRelay!");
903+
904+
Power.on(PWR_3V3);
905+
Power.on(PWR_VBAT);
906+
907+
Wire.begin();
908+
Serial.print("Waiting for IO Expander Initialization...");
909+
while (!Expander) {
910+
Serial.print(".");
911+
delay(100);
912+
}
913+
Serial.println(" done.");
914+
Expander.pinMode(EXP_LED1, OUTPUT);
915+
916+
for (auto i = 0; i < 3; i++) {
917+
Expander.digitalWrite(EXP_LED1, LOW);
918+
delay(50);
919+
Expander.digitalWrite(EXP_LED1, HIGH);
920+
delay(100);
921+
}
922+
923+
Relay.begin();
924+
}
925+
926+
void loop()
927+
{
928+
if (millis() > onTime && !on) {
929+
Serial.println("RELAY ON");
930+
931+
Relay.on(RELAY_CH01);
932+
933+
Expander.digitalWrite(EXP_LED1, LOW);
934+
935+
on = true;
936+
offTime = onInterval + millis();
937+
}
938+
939+
if (millis() > offTime && on) {
940+
Serial.println("RELAY OFF");
941+
942+
Relay.off(RELAY_CH01);
943+
944+
Expander.digitalWrite(EXP_LED1, HIGH);
945+
946+
on = false;
947+
onTime = millis() + offInterval;
948+
}
949+
950+
#if defined(SSR_POLL)
951+
if (millis() > pollTime && on) {
952+
Serial.println("POLLING");
953+
954+
Relay.poll(relayChannel);
955+
956+
pollTime = millis() + pollInterval;
957+
}
958+
#endif
959+
}
960+
```
876961
877962
## Edge Control Enclosure Kit
878963
964+
![Edge Control Enclosure Kit](assets/EnclosureKit-low.png)
965+
966+
Designed for industrial and smart agriculture applications, the Arduino Edge Control Enclosure Kit is the perfect companion for Arduino Edge Control. It provides the module with a sturdy case that protects it from the elements, dust, and accidental blows. It is IP40-certified and compatible with DIN rails, making it safe and easy to fit in any standard rack or cabinet.
967+
968+
On top of this, the Arduino Edge Control Enclosure Kit features a 2-row/16-character LCD display with white backlight and a programmable push button, so it can be customized by users to instantly visualize sensor data, such as weather conditions and soil parameters. Different data can be displayed at every push of the button, on the spot and in real time, without requiring connectivity.
969+
970+
### LCD Control
971+
972+
The functions to control the LCD are mostly the same as the ones we are used to in the Arduino ecosystem.
973+
974+
We need to include the `Arduino_EdgeContro.h` library and then, initialize the LCD with the `LCD.begin(16, 2)` function and start printing data on it.
975+
976+
With `LCD.backlight()` and `LCD.noBacklight()` we can turn on or off the LCD backlight respectively.
977+
978+
To define the cursor position, `LCD.setCursor(x, y)` is used, and to clear the display, `LCD.clear()`.
979+
980+
To display text, we use the `LCD.print(text)` function.
981+
982+
The example code below prints "Edge Control" in the first row and starts a seconds counter in the second one:
983+
984+
```cpp
985+
#include <Arduino_EdgeControl.h>
986+
987+
void setup() {
988+
989+
// set up the LCD's number of columns and rows:
990+
LCD.begin(16, 2);
991+
LCD.backlight();
992+
// Print a message to the LCD.
993+
LCD.home(); // go home
994+
LCD.print("Edge Control");
995+
996+
}
997+
998+
void loop() {
999+
1000+
LCD.setCursor(0, 1);
1001+
LCD.print(millis() / 1000);
1002+
delay(1000);
1003+
}
1004+
```
1005+
![LCD demo running the code from above](assets/LCD-demo.png)
1006+
1007+
### Push Button
1008+
1009+
1010+
8791011
## RTC
8801012

8811013
## Communication

0 commit comments

Comments
 (0)