├── ARDUINO SKETCH ├── wl_pro │ ├── MyBoardNRF5.cpp │ ├── MyBoardNRF5.h │ ├── wl_pro.txt │ └── wl_pro_test.ino ├── wl_standart │ ├── MyBoardNRF5.cpp │ ├── MyBoardNRF5.h │ ├── wl_standart.txt │ └── wl_standart_test.ino └── wl_tiny │ └── wl_tiny.txt ├── CASE ├── Pro │ ├── 50.STL │ ├── 70.STL │ └── pro.txt ├── Standart │ ├── 10.STL │ ├── 20.STL │ └── standart.txt ├── Tiny │ └── tiny.txt └── case.txt ├── CERNOHLv1_1_howto.txt ├── GERBER_FILES ├── LUT_HAND_MADE │ ├── Pro │ │ ├── Through.drl │ │ ├── pro.txt │ │ ├── Верхний.gbr │ │ ├── Верхняяграфика.gbr │ │ ├── Верхняямаска.gbr │ │ ├── Верхняяп.маска.gbr │ │ ├── Вехнийразмер.gbr │ │ ├── Границыплаты.gbr │ │ ├── Нижний.gbr │ │ ├── Нижнийразмер.gbr │ │ ├── Нижняяграфика.gbr │ │ ├── Нижняямаска.gbr │ │ └── Нижняяп.маска.gbr │ ├── Standart │ │ ├── Through.drl │ │ ├── standart.txt │ │ ├── Верхний.gbr │ │ ├── Верхняяграфика.gbr │ │ ├── Верхняямаска.gbr │ │ ├── Верхняяп.маска.gbr │ │ ├── Вехнийразмер.gbr │ │ ├── Границыплаты.gbr │ │ ├── Нижний.gbr │ │ ├── Нижнийразмер.gbr │ │ ├── Нижняяграфика.gbr │ │ ├── Нижняямаска.gbr │ │ └── Нижняяп.маска.gbr │ ├── Tiny │ │ └── tiny.txt │ └── lut.txt └── PROD │ ├── Pro │ ├── 001.png │ └── pro.txt │ ├── Standart │ └── WLS_St_V1.2.rar │ ├── Tiny │ └── tiny.txt │ └── prod.txt ├── IMAGES ├── Pro │ ├── IMG_20190710_142758.jpg │ ├── IMG_20190710_142942.jpg │ ├── IMG_20190710_142956.jpg │ ├── IMG_20190711_011533.jpg │ ├── IMG_20190711_011544.jpg │ ├── IMG_20190711_011553.jpg │ ├── IMG_20190711_011656.jpg │ ├── IMG_20190711_011746.jpg │ ├── IMG_20190711_012035.jpg │ ├── IMG_20190711_012125.jpg │ ├── IMG_20190711_012132.jpg │ ├── IMG_20190711_012139.jpg │ └── pro.txt ├── Standart │ ├── IMG_20190710_142758.jpg │ ├── IMG_20190710_142942.jpg │ ├── IMG_20190710_142956.jpg │ ├── IMG_20190710_175220.jpg │ ├── IMG_20190710_175248.jpg │ ├── IMG_20190710_175327.jpg │ ├── IMG_20190710_175327_1.jpg │ ├── IMG_20190710_175426.jpg │ ├── IMG_20190710_175558.jpg │ ├── IMG_20190710_175626.jpg │ └── standart.txt ├── Tiny │ └── tiny.txt └── images.txt ├── Licensed under CERN OHL v.1.1.txt ├── README.md └── product.txt /ARDUINO SKETCH/wl_pro/MyBoardNRF5.cpp: -------------------------------------------------------------------------------- 1 | #ifdef MYBOARDNRF5 2 | #include 3 | 4 | /* 5 | * Pins descriptions. Attributes are ignored by arduino-nrf5 variant. 6 | * Definition taken from Arduino Primo Core with ordered ports 7 | */ 8 | const PinDescription g_APinDescription[]= 9 | { 10 | { NOT_A_PORT, 0, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // LFCLK 11 | { NOT_A_PORT, 1, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // LFCLK 12 | { PORT0, 2, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A0, PWM4, NOT_ON_TIMER}, 13 | { PORT0, 3, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A1, PWM5, NOT_ON_TIMER}, 14 | { PORT0, 4, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A2, PWM6, NOT_ON_TIMER}, 15 | { PORT0, 5, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A3, PWM7, NOT_ON_TIMER}, 16 | { PORT0, 6, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT3 17 | { PORT0, 7, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT4 18 | { PORT0, 8, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM10, NOT_ON_TIMER}, //USER_LED 19 | { PORT0, 9, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // NFC1 20 | { PORT0, 10, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // NFC2 21 | { PORT0, 11, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // TX 22 | { PORT0, 12, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // RX 23 | { PORT0, 13, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // SDA 24 | { PORT0, 14, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // SCL 25 | { PORT0, 15, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // SDA1 26 | { PORT0, 16, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // SCL1 27 | { PORT0, 17, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // TP4 28 | { PORT0, 18, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // TP5 29 | { PORT0, 19, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT2 30 | { PORT0, 20, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT1 31 | { PORT0, 21, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT1 32 | { PORT0, 22, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM9, NOT_ON_TIMER}, 33 | { PORT0, 23, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM8, NOT_ON_TIMER}, 34 | { PORT0, 24, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT 35 | { PORT0, 25, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM11, NOT_ON_TIMER}, //RED_LED 36 | { PORT0, 26, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM11, NOT_ON_TIMER}, //GREEN_LED 37 | { PORT0, 27, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM11, NOT_ON_TIMER}, //BLUE_LED 38 | { PORT0, 28, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A4, PWM3, NOT_ON_TIMER}, 39 | { PORT0, 29, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A5, PWM2, NOT_ON_TIMER}, 40 | { PORT0, 30, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A6, PWM1, NOT_ON_TIMER}, 41 | { PORT0, 31, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A7, PWM0, NOT_ON_TIMER} 42 | }; 43 | 44 | // Don't remove this line 45 | #include 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /ARDUINO SKETCH/wl_pro/MyBoardNRF5.h: -------------------------------------------------------------------------------- 1 | #ifndef _MYBOARDNRF5_H_ 2 | #define _MYBOARDNRF5_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif // __cplusplus 8 | 9 | #define PINS_COUNT (32u) 10 | #define NUM_DIGITAL_PINS (32u) 11 | #define NUM_ANALOG_INPUTS (8u) 12 | #define NUM_ANALOG_OUTPUTS (8u) 13 | 14 | #define PIN_LED1 (28) 15 | #define PIN_LED2 (27) 16 | #define PIN_LED3 (26) 17 | #define RED_LED (PIN_LED1) 18 | #define GREEN_LED (PIN_LED2) 19 | #define BLUE_LED (PIN_LED3) 20 | 21 | #define PIN_BUTTON (13) 22 | #define W_L_SENS (17) 23 | 24 | #define POWER_PIN (18) 25 | 26 | #define TXEN_PIN (24) 27 | #define RXEN_PIN (20) 28 | 29 | static const uint8_t A0 = ADC_A0; 30 | static const uint8_t A1 = ADC_A1; 31 | static const uint8_t A2 = ADC_A2; 32 | static const uint8_t A3 = ADC_A3; 33 | static const uint8_t A4 = ADC_A4; 34 | static const uint8_t A5 = ADC_A5; 35 | static const uint8_t A6 = ADC_A6; 36 | static const uint8_t A7 = ADC_A7; 37 | 38 | #define PIN_SERIAL_RX (12) 39 | #define PIN_SERIAL_TX (11) 40 | 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /ARDUINO SKETCH/wl_pro/wl_pro.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ARDUINO SKETCH/wl_pro/wl_pro_test.ino: -------------------------------------------------------------------------------- 1 | bool button_flag; 2 | bool send_flag; 3 | bool detection; 4 | bool nosleep; 5 | byte timer; 6 | bool AckG; 7 | bool AckB; 8 | bool AckL; 9 | bool PRESENT_ACK; 10 | bool flag_lq; 11 | //unsigned long SLEEP_TIME = 86400000; //24 hours 12 | unsigned long SLEEP_TIME = 3600000; //1 hours 13 | unsigned long oldmillis; 14 | unsigned long newmillis; 15 | unsigned long interrupt_time; 16 | unsigned long SLEEP_TIME_W; 17 | uint16_t currentBatteryPercent; 18 | uint16_t batteryVoltage = 0; 19 | uint16_t battery_vcc_min = 2400; 20 | uint16_t battery_vcc_max = 3600; 21 | 22 | int16_t linkQuality; 23 | 24 | #define MY_DISABLED_SERIAL 25 | #define MY_RADIO_NRF5_ESB 26 | #define MY_RF24_PA_LEVEL (NRF5_PA_MAX) 27 | //#define MY_PASSIVE_NODE 28 | #define MY_NODE_ID 87 29 | #define MY_PARENT_NODE_ID 0 30 | #define MY_PARENT_NODE_IS_STATIC 31 | #define MY_TRANSPORT_UPLINK_CHECK_DISABLED 32 | #define INTR_PIN 6 //(PORT0, gpio 30) 33 | #include 34 | // see https://www.mysensors.org/download/serial_api_20 35 | #define W_L_SENS_CHILD_ID 0 36 | #define LINK_QUALITY_CHILD_ID 253 37 | MyMessage sensMsg(W_L_SENS_CHILD_ID, V_VAR1); 38 | //MyMessage voltMsg(CHILD_ID_VOLT, V_VOLTAGE); 39 | 40 | 41 | void preHwInit() { 42 | pinMode(POWER_PIN, OUTPUT); 43 | digitalWrite(POWER_PIN, HIGH); 44 | wait(3000); 45 | pinMode(RED_LED, OUTPUT); 46 | digitalWrite(RED_LED, HIGH); 47 | pinMode(GREEN_LED, OUTPUT); 48 | digitalWrite(GREEN_LED, HIGH); 49 | pinMode(BLUE_LED, OUTPUT); 50 | digitalWrite(BLUE_LED, HIGH); 51 | pinMode(PIN_BUTTON, INPUT); 52 | pinMode(W_L_SENS, INPUT); 53 | 54 | pinMode(TXEN_PIN, OUTPUT); 55 | pinMode(RXEN_PIN, OUTPUT); 56 | } 57 | 58 | void before() 59 | { 60 | NRF_POWER->DCDCEN = 1; 61 | NRF_UART0->ENABLE = 0; 62 | sleep(100); 63 | digitalWrite(BLUE_LED, LOW); 64 | sleep(150); 65 | digitalWrite(BLUE_LED, HIGH); 66 | sleep(150); 67 | 68 | digitalWrite(TXEN_PIN, HIGH); 69 | digitalWrite(RXEN_PIN, HIGH); 70 | } 71 | 72 | void presentation() { 73 | digitalWrite(TXEN_PIN, LOW); 74 | digitalWrite(RXEN_PIN, LOW); 75 | wait(100); 76 | digitalWrite(TXEN_PIN, HIGH); 77 | digitalWrite(RXEN_PIN, HIGH); 78 | sendSketchInfo("EFEKTA PRO WL Sensor", "1.1"); 79 | digitalWrite(TXEN_PIN, LOW); 80 | digitalWrite(RXEN_PIN, LOW); 81 | wait(300); 82 | digitalWrite(TXEN_PIN, HIGH); 83 | digitalWrite(RXEN_PIN, HIGH); 84 | present(W_L_SENS_CHILD_ID, S_CUSTOM, "SWITCH STATUS"); 85 | digitalWrite(TXEN_PIN, LOW); 86 | digitalWrite(RXEN_PIN, LOW); 87 | wait(300); 88 | /* 89 | wait(3000, 0, S_CUSTOM); 90 | //CORE_DEBUG(PSTR("MyS: TEST WAIT AFTER PRESENT SENSOR\n")); 91 | if (PRESENT_ACK == 0) { 92 | sleep(2000); 93 | wait(100); 94 | present(W_L_SENS_CHILD_ID, S_CUSTOM, "SWITCH STATUS", 1); 95 | wait(3000, 0, S_CUSTOM); 96 | //CORE_DEBUG(PSTR("MyS: TEST WAIT AFTER PRESENT SENSOR\n")); 97 | } else { 98 | PRESENT_ACK = 0; 99 | } 100 | */ 101 | digitalWrite(TXEN_PIN, HIGH); 102 | digitalWrite(RXEN_PIN, HIGH); 103 | present(LINK_QUALITY_CHILD_ID, S_CUSTOM, "LINK_QUALITY"); 104 | digitalWrite(TXEN_PIN, LOW); 105 | digitalWrite(RXEN_PIN, LOW); 106 | wait(300); 107 | /* 108 | wait(3000, 0, S_CUSTOM); 109 | //CORE_DEBUG(PSTR("MyS: TEST WAIT AFTER PRESENT SENSOR\n")); 110 | if (PRESENT_ACK == 0) { 111 | sleep(2000); 112 | wait(100); 113 | present(LINK_QUALITY_CHILD_ID, S_CUSTOM, "LINK_QUALITY", 1); 114 | wait(3000, 0, S_CUSTOM); 115 | //CORE_DEBUG(PSTR("MyS: TEST WAIT AFTER PRESENT SENSOR\n")); 116 | } else { 117 | PRESENT_ACK = 0; 118 | } 119 | */ 120 | } 121 | 122 | void setup() { 123 | digitalWrite(TXEN_PIN, LOW); 124 | digitalWrite(RXEN_PIN, LOW); 125 | 126 | 127 | digitalWrite(BLUE_LED, LOW); 128 | wait(100); 129 | digitalWrite(BLUE_LED, HIGH); 130 | wait(200); 131 | digitalWrite(BLUE_LED, LOW); 132 | wait(100); 133 | digitalWrite(BLUE_LED, HIGH); 134 | lpComp(); 135 | detection = false; 136 | SLEEP_TIME_W = SLEEP_TIME; 137 | /* 138 | while (timer < 10) { 139 | timer++; 140 | digitalWrite(GREEN_LED, LOW); 141 | wait(5); 142 | digitalWrite(GREEN_LED, HIGH); 143 | wait(500); 144 | } 145 | timer = 0; 146 | */ 147 | wait(100); 148 | sendBatteryStatus(); 149 | wait(100); 150 | digitalWrite(TXEN_PIN, HIGH); 151 | digitalWrite(RXEN_PIN, HIGH); 152 | send(sensMsg.set(detection), 1); 153 | digitalWrite(TXEN_PIN, LOW); 154 | wait(2000, 1, V_VAR1); 155 | digitalWrite(RXEN_PIN, LOW); 156 | } 157 | 158 | void loop() { 159 | if (nosleep == 0) { 160 | oldmillis = millis(); 161 | sleep(SLEEP_TIME_W); 162 | } 163 | 164 | if (detection) { 165 | if (digitalRead(PIN_BUTTON) == 1 && button_flag == 0 && digitalRead(W_L_SENS) == 0) { 166 | //back side button detection 167 | button_flag = 1; 168 | nosleep = 1; 169 | } 170 | if (digitalRead(PIN_BUTTON) == 1 && button_flag == 1 && digitalRead(W_L_SENS) == 0) { 171 | digitalWrite(GREEN_LED, LOW); 172 | wait(10); 173 | digitalWrite(GREEN_LED, HIGH); 174 | wait(50); 175 | } 176 | if (digitalRead(PIN_BUTTON) == 0 && button_flag == 1 && digitalRead(W_L_SENS) == 0) { 177 | nosleep = 0; 178 | button_flag = 0; 179 | digitalWrite(GREEN_LED, HIGH); 180 | lpComp_reset(); 181 | } 182 | 183 | if (digitalRead(W_L_SENS) == 1 && digitalRead(PIN_BUTTON) == 0) { 184 | //sens detection 185 | newmillis = millis(); 186 | interrupt_time = newmillis - oldmillis; 187 | SLEEP_TIME_W = SLEEP_TIME_W - interrupt_time; 188 | wait(100); 189 | digitalWrite(TXEN_PIN, HIGH); 190 | digitalWrite(RXEN_PIN, HIGH); 191 | send(sensMsg.set(detection), 1); 192 | digitalWrite(TXEN_PIN, LOW); 193 | wait(3000, 1, V_VAR1); 194 | digitalWrite(RXEN_PIN, LOW); 195 | if (AckG == 1) { 196 | while (timer < 10) { 197 | timer++; 198 | //digitalWrite(RED_LED, LOW); 199 | //wait(20); 200 | //digitalWrite(RED_LED, HIGH); 201 | //wait(30); 202 | digitalWrite(BLUE_LED, LOW); 203 | wait(20); 204 | digitalWrite(BLUE_LED, HIGH); 205 | wait(30); 206 | } 207 | timer = 0; 208 | AckG = 0; 209 | wait(200); 210 | } else { 211 | while (timer < 10) { 212 | timer++; 213 | digitalWrite(RED_LED, LOW); 214 | wait(20); 215 | digitalWrite(RED_LED, HIGH); 216 | wait(30); 217 | } 218 | timer = 0; 219 | digitalWrite(TXEN_PIN, HIGH); 220 | digitalWrite(RXEN_PIN, HIGH); 221 | send(sensMsg.set(detection), 1); 222 | digitalWrite(TXEN_PIN, LOW); 223 | wait(3000, 1, V_VAR1); 224 | digitalWrite(RXEN_PIN, LOW); 225 | if (AckG == 1) { 226 | while (timer < 10) { 227 | timer++; 228 | digitalWrite(RED_LED, LOW); 229 | wait(20); 230 | digitalWrite(RED_LED, HIGH); 231 | wait(30); 232 | digitalWrite(BLUE_LED, LOW); 233 | wait(20); 234 | digitalWrite(BLUE_LED, HIGH); 235 | wait(30); 236 | } 237 | timer = 0; 238 | AckG = 0; 239 | } else { 240 | while (timer < 20) { 241 | timer++; 242 | digitalWrite(RED_LED, LOW); 243 | wait(20); 244 | digitalWrite(RED_LED, HIGH); 245 | wait(30); 246 | } 247 | timer = 0; 248 | } 249 | lpComp_reset(); 250 | } 251 | } 252 | 253 | if (SLEEP_TIME_W < 60000) { 254 | SLEEP_TIME_W = SLEEP_TIME; 255 | sendBatteryStatus(); 256 | } 257 | } 258 | 259 | else { 260 | //if (detection == -1) { 261 | SLEEP_TIME_W = SLEEP_TIME; 262 | sendBatteryStatus(); 263 | } 264 | } 265 | 266 | 267 | void receive(const MyMessage & message) { 268 | if (message.type == V_VAR1) { 269 | if (message.sensor == W_L_SENS_CHILD_ID) { 270 | if (mGetCommand(message) == 1) { 271 | if (message.isAck()) { 272 | AckG = 1; 273 | } else { 274 | 275 | } 276 | } 277 | } 278 | } 279 | if (message.type == I_BATTERY_LEVEL) { 280 | if (message.sensor == 255) { 281 | if (mGetCommand(message) == 3) { 282 | if (message.isAck()) { 283 | AckB = 1; 284 | } else { 285 | 286 | } 287 | } 288 | } 289 | } 290 | if (message.type == V_VAR1) { 291 | if (message.sensor == 255) { 292 | if (mGetCommand(message) == 1) { 293 | if (message.isAck()) { 294 | AckL = 1; 295 | } else { 296 | 297 | } 298 | } 299 | } 300 | } 301 | /* 302 | if (mGetCommand(message) == 0) { 303 | PRESENT_ACK = 1; 304 | CORE_DEBUG(PSTR("MyS: !!!ACK OF THE PRESENTATION IN THE FUNCTION RECEIVE RECEIVED!!!\n")); 305 | } 306 | */ 307 | } 308 | 309 | 310 | void sendBatteryStatus() { 311 | wait(100); 312 | batteryVoltage = hwCPUVoltage(); 313 | wait(20); 314 | 315 | if (batteryVoltage > battery_vcc_max) { 316 | currentBatteryPercent = 100; 317 | } 318 | else if (batteryVoltage < battery_vcc_min) { 319 | currentBatteryPercent = 0; 320 | } else { 321 | currentBatteryPercent = (100 * (batteryVoltage - battery_vcc_min)) / (battery_vcc_max - battery_vcc_min); 322 | } 323 | digitalWrite(TXEN_PIN, HIGH); 324 | digitalWrite(RXEN_PIN, HIGH); 325 | sendBatteryLevel(currentBatteryPercent, 1); 326 | digitalWrite(TXEN_PIN, LOW); 327 | wait(3000, C_INTERNAL, I_BATTERY_LEVEL); 328 | digitalWrite(RXEN_PIN, LOW); 329 | if (AckB == 1) { 330 | AckB = 0; 331 | flag_lq = 1; 332 | } else { 333 | digitalWrite(TXEN_PIN, HIGH); 334 | digitalWrite(RXEN_PIN, HIGH); 335 | sendBatteryLevel(currentBatteryPercent, 1); 336 | digitalWrite(TXEN_PIN, LOW); 337 | wait(3000, C_INTERNAL, I_BATTERY_LEVEL); 338 | digitalWrite(RXEN_PIN, LOW); 339 | if (AckB == 1) { 340 | AckB = 0; 341 | flag_lq = 1; 342 | } 343 | } 344 | //send(powerMsg.set(batteryVoltage), 1); 345 | //wait(2000, 1, V_VAR1); 346 | 347 | //sleep(10000); // 348 | if (flag_lq == 1) { 349 | linkQuality = calculationRxQuality(); 350 | wait(50); 351 | digitalWrite(TXEN_PIN, HIGH); 352 | digitalWrite(RXEN_PIN, HIGH); 353 | sendSignalStrength(linkQuality, 1); 354 | digitalWrite(TXEN_PIN, LOW); 355 | wait(2000, 1, V_VAR1); 356 | digitalWrite(RXEN_PIN, LOW); 357 | if (AckL == 1) { 358 | AckL = 0; 359 | } else { 360 | sendSignalStrength(linkQuality, 1); 361 | wait(2000, 1, V_VAR1); 362 | if (AckL == 1) { 363 | AckG = 0; 364 | } 365 | } 366 | flag_lq = 0; 367 | } 368 | } 369 | 370 | 371 | void lpComp() { 372 | NRF_LPCOMP->PSEL = INTR_PIN; 373 | NRF_LPCOMP->ANADETECT = 1; 374 | NRF_LPCOMP->INTENSET = B0100; 375 | NRF_LPCOMP->ENABLE = 1; 376 | NRF_LPCOMP->TASKS_START = 1; 377 | NVIC_SetPriority(LPCOMP_IRQn, 15); 378 | NVIC_ClearPendingIRQ(LPCOMP_IRQn); 379 | NVIC_EnableIRQ(LPCOMP_IRQn); 380 | } 381 | 382 | void s_lpComp() { 383 | if ((NRF_LPCOMP->ENABLE) && (NRF_LPCOMP->EVENTS_READY)) { 384 | NRF_LPCOMP->INTENCLR = B0100; 385 | } 386 | } 387 | 388 | void r_lpComp() { 389 | NRF_LPCOMP->INTENSET = B0100; 390 | } 391 | 392 | #if __CORTEX_M == 0x04 393 | #define NRF5_RESET_EVENT(event) \ 394 | event = 0; \ 395 | (void)event 396 | #else 397 | #define NRF5_RESET_EVENT(event) event = 0 398 | #endif 399 | 400 | 401 | void lpComp_reset () { 402 | s_lpComp(); 403 | detection = false; 404 | NRF_LPCOMP->EVENTS_UP = 0; 405 | r_lpComp(); 406 | } 407 | 408 | //****************************** very experimental ******************************* 409 | 410 | 411 | bool sendSignalStrength(const int16_t level, const bool ack) 412 | { 413 | return _sendRoute(build(_msgTmp, GATEWAY_ADDRESS, NODE_SENSOR_ID, C_SET, V_VAR1, 414 | ack).set(level)); 415 | } 416 | int16_t calculationRxQuality() { 417 | int16_t nRFRSSI_temp = transportGetReceivingRSSI(); 418 | int16_t nRFRSSI = map(nRFRSSI_temp, -85, -40, 0, 100); 419 | if (nRFRSSI < 0) { 420 | nRFRSSI = 0; 421 | } 422 | if (nRFRSSI > 100) { 423 | nRFRSSI = 100; 424 | } 425 | return nRFRSSI; 426 | } 427 | 428 | //****************************** very experimental ******************************* 429 | 430 | 431 | extern "C" { 432 | void LPCOMP_IRQHandler(void) { 433 | detection = true; 434 | NRF5_RESET_EVENT(NRF_LPCOMP->EVENTS_UP); 435 | NRF_LPCOMP->EVENTS_UP = 0; 436 | MY_HW_RTC->CC[0] = (MY_HW_RTC->COUNTER + 2); 437 | } 438 | } 439 | -------------------------------------------------------------------------------- /ARDUINO SKETCH/wl_standart/MyBoardNRF5.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | If you don't use an nRF5 board, you can ignore this file. 3 | 4 | This file was part of the "My Sensors nRF5 Boards" board repository 5 | available at https://github.com/mysensors/ArduinoBoards If you have 6 | questions, please refer the documentation at 7 | https://github.com/mysensors/ArduinoHwNRF5 first. 8 | 9 | This file is compatible with ArduinoHwNRF5 >= 0.2.0 10 | This file allows you to change the relation between pins referenced in 11 | the Arduino IDE (0..31) and pins of the nRF5 MCU (P0.00..P0.31). 12 | 13 | If you can live with addressing the GPIO pins by using the Arduino pins 14 | 0..31 instead of a custom mapping, don't change this file. If you have 15 | a lot of Arduino code with fixed pin numbers and you need to map these 16 | pins to specific pins of the nRF5 MCU; you need to change this file. 17 | 18 | If you fill the "g_APinDescription" Array with numbers between 0..31, 19 | the Arduino pins 0..31 are assigned to pins P0.00..P0.31 of the MCU. 20 | 21 | As an example, if you need to change the pin mapping for Arduino pin 5 22 | to P0.12 of the MCU, you have to write the 12 after PORT0 into the sixth 23 | position in the "g_APinDescription" Array. 24 | 25 | The extended attributes only affects the nRF5 variants provided with 26 | official Arduino boards. The arduino-nrf5 variant ignores the extended 27 | attributes. 28 | 29 | The pin mapping effects commands like "pinMode()", "digitalWrite()", 30 | "analogRead()" and "analogWrite()". 31 | 32 | If you change the pin mapping, you have to modify the pins in 33 | "MyBoardNRF5.h". Especially the analog pin mapping must be replaced with 34 | your pin numbers by replacing PIN_AIN0..7 with a number of your mapping 35 | array. You can use the constants PIN_AIN0..7 in the "g_APinDescription" 36 | Array if you want to reference analog ports MCU independent. You cannot 37 | use the pins P0.00 and P0.01 for GPIO, when the 32kHz crystal is connected. 38 | 39 | ########################################################################### 40 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 41 | Copyright (c) 2016 Arduino Srl. All right reserved. 42 | Copyright (c) 2017 Sensnology AB. All right reserved. 43 | This library is free software; you can redistribute it and/or 44 | modify it under the terms of the GNU Lesser General Public 45 | License as published by the Free Software Foundation; either 46 | version 2.1 of the License, or (at your option) any later version. 47 | This library is distributed in the hope that it will be useful, 48 | but WITHOUT ANY WARRANTY; without even the implied warranty of 49 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 50 | See the GNU Lesser General Public License for more details. 51 | You should have received a copy of the GNU Lesser General Public 52 | License along with this library; if not, write to the Free Software 53 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 54 | */ 55 | 56 | 57 | 58 | #ifdef MYBOARDNRF5 59 | #include 60 | 61 | /* 62 | * Pins descriptions. Attributes are ignored by arduino-nrf5 variant. 63 | * Definition taken from Arduino Primo Core with ordered ports 64 | */ 65 | const PinDescription g_APinDescription[]= 66 | { 67 | { NOT_A_PORT, 0, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // LFCLK 68 | { NOT_A_PORT, 1, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // LFCLK 69 | { PORT0, 2, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A0, PWM4, NOT_ON_TIMER}, 70 | { PORT0, 3, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A1, PWM5, NOT_ON_TIMER}, 71 | { PORT0, 4, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A2, PWM6, NOT_ON_TIMER}, 72 | { PORT0, 5, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A3, PWM7, NOT_ON_TIMER}, 73 | { PORT0, 6, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT3 74 | { PORT0, 7, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT4 75 | { PORT0, 8, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM10, NOT_ON_TIMER}, //USER_LED 76 | { PORT0, 9, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // NFC1 77 | { PORT0, 10, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // NFC2 78 | { PORT0, 11, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // TX 79 | { PORT0, 12, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // RX 80 | { PORT0, 13, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // SDA 81 | { PORT0, 14, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // SCL 82 | { PORT0, 15, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // SDA1 83 | { PORT0, 16, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // SCL1 84 | { PORT0, 17, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // TP4 85 | { PORT0, 18, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // TP5 86 | { PORT0, 19, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT2 87 | { PORT0, 20, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT1 88 | { PORT0, 21, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT1 89 | { PORT0, 22, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM9, NOT_ON_TIMER}, 90 | { PORT0, 23, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM8, NOT_ON_TIMER}, 91 | { PORT0, 24, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT 92 | { PORT0, 25, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM11, NOT_ON_TIMER}, //RED_LED 93 | { PORT0, 26, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM11, NOT_ON_TIMER}, //GREEN_LED 94 | { PORT0, 27, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM11, NOT_ON_TIMER}, //BLUE_LED 95 | { PORT0, 28, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A4, PWM3, NOT_ON_TIMER}, 96 | { PORT0, 29, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A5, PWM2, NOT_ON_TIMER}, 97 | { PORT0, 30, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A6, PWM1, NOT_ON_TIMER}, 98 | { PORT0, 31, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A7, PWM0, NOT_ON_TIMER} 99 | }; 100 | 101 | // Don't remove this line 102 | #include 103 | 104 | #endif 105 | -------------------------------------------------------------------------------- /ARDUINO SKETCH/wl_standart/MyBoardNRF5.h: -------------------------------------------------------------------------------- 1 | #ifndef _MYBOARDNRF5_H_ 2 | #define _MYBOARDNRF5_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif // __cplusplus 8 | 9 | 10 | #define PINS_COUNT (32u) 11 | #define NUM_DIGITAL_PINS (32u) 12 | #define NUM_ANALOG_INPUTS (8u) 13 | #define NUM_ANALOG_OUTPUTS (8u) 14 | 15 | #define PIN_LED1 (27) 16 | #define PIN_LED2 (25) 17 | #define PIN_LED3 (26) 18 | #define RED_LED (PIN_LED1) 19 | #define GREEN_LED (PIN_LED2) 20 | #define BLUE_LED (PIN_LED3) 21 | #define LED_BUILTIN (PIN_LED1) 22 | 23 | #define PIN_BUTTON (14) 24 | #define W_L_SENS (8) 25 | 26 | #define POWER_PIN (7) 27 | 28 | 29 | 30 | static const uint8_t A0 = ADC_A0; 31 | static const uint8_t A1 = ADC_A1; 32 | static const uint8_t A2 = ADC_A2; 33 | static const uint8_t A3 = ADC_A3; 34 | static const uint8_t A4 = ADC_A4; 35 | static const uint8_t A5 = ADC_A5; 36 | static const uint8_t A6 = ADC_A6; 37 | static const uint8_t A7 = ADC_A7; 38 | 39 | 40 | #define PIN_SERIAL_RX (12) 41 | #define PIN_SERIAL_TX (11) 42 | 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /ARDUINO SKETCH/wl_standart/wl_standart.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ARDUINO SKETCH/wl_standart/wl_standart_test.ino: -------------------------------------------------------------------------------- 1 | bool button_flag; 2 | bool send_flag; 3 | bool detection; 4 | bool nosleep; 5 | byte timer; 6 | bool AckG; 7 | bool AckB; 8 | bool AckL; 9 | bool PRESENT_ACK; 10 | bool flag_lq; 11 | unsigned long SLEEP_TIME = 43200000; //12 hours 12 | //unsigned long SLEEP_TIME = 3600000; //1 hours 13 | unsigned long oldmillis; 14 | unsigned long newmillis; 15 | unsigned long interrupt_time; 16 | unsigned long SLEEP_TIME_W; 17 | uint16_t currentBatteryPercent; 18 | uint16_t batteryVoltage = 0; 19 | uint16_t battery_vcc_min = 2200; 20 | uint16_t battery_vcc_max = 3000; 21 | 22 | int16_t linkQuality; 23 | 24 | #define MY_DISABLED_SERIAL 25 | #define MY_RADIO_NRF5_ESB 26 | #define MY_RF24_PA_LEVEL (NRF5_PA_MAX) 27 | //#define MY_PASSIVE_NODE 28 | #define MY_NODE_ID 86 29 | #define MY_PARENT_NODE_ID 0 30 | #define MY_PARENT_NODE_IS_STATIC 31 | #define MY_TRANSPORT_UPLINK_CHECK_DISABLED 32 | #define INTR_PIN 3 //(PORT0, gpio 5) 33 | #include 34 | // see https://www.mysensors.org/download/serial_api_20 35 | #define W_L_SENS_CHILD_ID 0 36 | #define LINK_QUALITY_CHILD_ID 253 37 | MyMessage sensMsg(W_L_SENS_CHILD_ID, V_VAR1); 38 | //MyMessage voltMsg(CHILD_ID_VOLT, V_VOLTAGE); 39 | 40 | 41 | void preHwInit() { 42 | pinMode(POWER_PIN, OUTPUT); 43 | digitalWrite(POWER_PIN, HIGH); 44 | wait(3000); 45 | pinMode(RED_LED, OUTPUT); 46 | digitalWrite(RED_LED, HIGH); 47 | pinMode(GREEN_LED, OUTPUT); 48 | digitalWrite(GREEN_LED, HIGH); 49 | pinMode(BLUE_LED, OUTPUT); 50 | digitalWrite(BLUE_LED, HIGH); 51 | pinMode(PIN_BUTTON, INPUT); 52 | pinMode(W_L_SENS, INPUT); 53 | 54 | //pinMode(24, OUTPUT); 55 | //pinMode(20, OUTPUT); 56 | } 57 | 58 | void before() 59 | { 60 | NRF_POWER->DCDCEN = 1; 61 | NRF_UART0->ENABLE = 0; 62 | digitalWrite(BLUE_LED, LOW); 63 | sleep(50); 64 | digitalWrite(BLUE_LED, HIGH); 65 | } 66 | 67 | void presentation() { 68 | sendSketchInfo("EFEKTA ST WL Sensor", "1.1"); 69 | present(W_L_SENS_CHILD_ID, S_CUSTOM, "SWITCH STATUS"); 70 | present(LINK_QUALITY_CHILD_ID, S_CUSTOM, "LINK_QUALITY"); 71 | } 72 | 73 | void setup() { 74 | digitalWrite(BLUE_LED, LOW); 75 | wait(100); 76 | digitalWrite(BLUE_LED, HIGH); 77 | wait(200); 78 | digitalWrite(BLUE_LED, LOW); 79 | wait(100); 80 | digitalWrite(BLUE_LED, HIGH); 81 | lpComp(); 82 | detection = false; 83 | SLEEP_TIME_W = SLEEP_TIME; 84 | wait(100); 85 | sendBatteryStatus(); 86 | wait(100); 87 | send(sensMsg.set(detection), 1); 88 | wait(2000, 1, V_VAR1); 89 | } 90 | 91 | void loop() { 92 | if (nosleep == 0) { 93 | oldmillis = millis(); 94 | sleep(SLEEP_TIME_W); 95 | } 96 | 97 | if (detection) { 98 | if (digitalRead(PIN_BUTTON) == 1 && button_flag == 0 && digitalRead(W_L_SENS) == 0) { 99 | //back side button detection 100 | button_flag = 1; 101 | nosleep = 1; 102 | } 103 | if (digitalRead(PIN_BUTTON) == 1 && button_flag == 1 && digitalRead(W_L_SENS) == 0) { 104 | digitalWrite(GREEN_LED, LOW); 105 | wait(10); 106 | digitalWrite(GREEN_LED, HIGH); 107 | wait(50); 108 | } 109 | if (digitalRead(PIN_BUTTON) == 0 && button_flag == 1 && digitalRead(W_L_SENS) == 0) { 110 | nosleep = 0; 111 | button_flag = 0; 112 | digitalWrite(GREEN_LED, HIGH); 113 | lpComp_reset(); 114 | } 115 | 116 | if (digitalRead(W_L_SENS) == 1 && digitalRead(PIN_BUTTON) == 0) { 117 | //sens detection 118 | newmillis = millis(); 119 | interrupt_time = newmillis - oldmillis; 120 | SLEEP_TIME_W = SLEEP_TIME_W - interrupt_time; 121 | send(sensMsg.set(detection), 1); 122 | wait(3000, 1, V_VAR1); 123 | if (AckG == 1) { 124 | while (timer < 10) { 125 | timer++; 126 | digitalWrite(BLUE_LED, LOW); 127 | wait(20); 128 | digitalWrite(BLUE_LED, HIGH); 129 | wait(30); 130 | } 131 | timer = 0; 132 | AckG = 0; 133 | wait(200); 134 | } else { 135 | while (timer < 10) { 136 | timer++; 137 | digitalWrite(RED_LED, LOW); 138 | wait(20); 139 | digitalWrite(RED_LED, HIGH); 140 | wait(30); 141 | } 142 | timer = 0; 143 | send(sensMsg.set(detection), 1); 144 | wait(3000, 1, V_VAR1); 145 | if (AckG == 1) { 146 | while (timer < 10) { 147 | timer++; 148 | digitalWrite(BLUE_LED, LOW); 149 | wait(20); 150 | digitalWrite(BLUE_LED, HIGH); 151 | wait(30); 152 | } 153 | timer = 0; 154 | AckG = 0; 155 | } else { 156 | while (timer < 10) { 157 | timer++; 158 | digitalWrite(RED_LED, LOW); 159 | wait(20); 160 | digitalWrite(RED_LED, HIGH); 161 | wait(30); 162 | } 163 | timer = 0; 164 | } 165 | lpComp_reset(); 166 | } 167 | } 168 | 169 | if (SLEEP_TIME_W < 60000) { 170 | SLEEP_TIME_W = SLEEP_TIME; 171 | sendBatteryStatus(); 172 | } 173 | } 174 | else { 175 | //if (detection == -1) { 176 | SLEEP_TIME_W = SLEEP_TIME; 177 | sendBatteryStatus(); 178 | } 179 | } 180 | 181 | 182 | void receive(const MyMessage & message) { 183 | if (message.type == V_VAR1) { 184 | if (message.sensor == W_L_SENS_CHILD_ID) { 185 | if (mGetCommand(message) == 1) { 186 | if (message.isAck()) { 187 | AckG = 1; 188 | } else { 189 | 190 | } 191 | } 192 | } 193 | } 194 | if (message.type == I_BATTERY_LEVEL) { 195 | if (message.sensor == 255) { 196 | if (mGetCommand(message) == 3) { 197 | if (message.isAck()) { 198 | AckB = 1; 199 | } else { 200 | 201 | } 202 | } 203 | } 204 | } 205 | if (message.type == V_VAR1) { 206 | if (message.sensor == 255) { 207 | if (mGetCommand(message) == 1) { 208 | if (message.isAck()) { 209 | AckL = 1; 210 | } else { 211 | 212 | } 213 | } 214 | } 215 | } 216 | } 217 | 218 | 219 | void sendBatteryStatus() { 220 | wait(100); 221 | batteryVoltage = hwCPUVoltage(); 222 | wait(20); 223 | 224 | if (batteryVoltage > battery_vcc_max) { 225 | currentBatteryPercent = 100; 226 | } 227 | else if (batteryVoltage < battery_vcc_min) { 228 | currentBatteryPercent = 0; 229 | } else { 230 | currentBatteryPercent = (100 * (batteryVoltage - battery_vcc_min)) / (battery_vcc_max - battery_vcc_min); 231 | } 232 | sendBatteryLevel(currentBatteryPercent, 1); 233 | wait(3000, C_INTERNAL, I_BATTERY_LEVEL); 234 | if (AckB == 1) { 235 | AckB = 0; 236 | flag_lq = 1; 237 | } else { 238 | sendBatteryLevel(currentBatteryPercent, 1); 239 | wait(3000, C_INTERNAL, I_BATTERY_LEVEL); 240 | if (AckB == 1) { 241 | AckB = 0; 242 | flag_lq = 1; 243 | } 244 | } 245 | //send(powerMsg.set(batteryVoltage), 1); 246 | //wait(2000, 1, V_VAR1); 247 | 248 | //sleep(10000); // 249 | if (flag_lq == 1) { 250 | linkQuality = calculationRxQuality(); 251 | wait(50); 252 | sendSignalStrength(linkQuality, 1); 253 | wait(2000, 1, V_VAR1); 254 | if (AckL == 1) { 255 | AckL = 0; 256 | } else { 257 | sendSignalStrength(linkQuality, 1); 258 | wait(2000, 1, V_VAR1); 259 | if (AckL == 1) { 260 | AckG = 0; 261 | } 262 | } 263 | flag_lq = 0; 264 | } 265 | } 266 | 267 | 268 | void lpComp() { 269 | NRF_LPCOMP->PSEL = INTR_PIN; 270 | NRF_LPCOMP->ANADETECT = 1; 271 | NRF_LPCOMP->INTENSET = B0100; 272 | NRF_LPCOMP->ENABLE = 1; 273 | NRF_LPCOMP->TASKS_START = 1; 274 | NVIC_SetPriority(LPCOMP_IRQn, 15); 275 | NVIC_ClearPendingIRQ(LPCOMP_IRQn); 276 | NVIC_EnableIRQ(LPCOMP_IRQn); 277 | } 278 | 279 | void s_lpComp() { 280 | if ((NRF_LPCOMP->ENABLE) && (NRF_LPCOMP->EVENTS_READY)) { 281 | NRF_LPCOMP->INTENCLR = B0100; 282 | } 283 | } 284 | 285 | void r_lpComp() { 286 | NRF_LPCOMP->INTENSET = B0100; 287 | } 288 | 289 | #if __CORTEX_M == 0x04 290 | #define NRF5_RESET_EVENT(event) \ 291 | event = 0; \ 292 | (void)event 293 | #else 294 | #define NRF5_RESET_EVENT(event) event = 0 295 | #endif 296 | 297 | 298 | void lpComp_reset () { 299 | s_lpComp(); 300 | detection = false; 301 | NRF_LPCOMP->EVENTS_UP = 0; 302 | r_lpComp(); 303 | } 304 | 305 | //****************************** very experimental ******************************* 306 | 307 | 308 | bool sendSignalStrength(const int16_t level, const bool ack) 309 | { 310 | return _sendRoute(build(_msgTmp, GATEWAY_ADDRESS, NODE_SENSOR_ID, C_SET, V_VAR1, 311 | ack).set(level)); 312 | } 313 | int16_t calculationRxQuality() { 314 | int16_t nRFRSSI_temp = transportGetReceivingRSSI(); 315 | int16_t nRFRSSI = map(nRFRSSI_temp, -85, -40, 0, 100); 316 | if (nRFRSSI < 0) { 317 | nRFRSSI = 0; 318 | } 319 | if (nRFRSSI > 100) { 320 | nRFRSSI = 100; 321 | } 322 | return nRFRSSI; 323 | } 324 | 325 | //****************************** very experimental ******************************* 326 | 327 | 328 | extern "C" { 329 | void LPCOMP_IRQHandler(void) { 330 | detection = true; 331 | NRF5_RESET_EVENT(NRF_LPCOMP->EVENTS_UP); 332 | NRF_LPCOMP->EVENTS_UP = 0; 333 | MY_HW_RTC->CC[0] = (MY_HW_RTC->COUNTER + 2); 334 | } 335 | } 336 | -------------------------------------------------------------------------------- /ARDUINO SKETCH/wl_tiny/wl_tiny.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /CASE/Pro/50.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/CASE/Pro/50.STL -------------------------------------------------------------------------------- /CASE/Pro/70.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/CASE/Pro/70.STL -------------------------------------------------------------------------------- /CASE/Pro/pro.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /CASE/Standart/10.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/CASE/Standart/10.STL -------------------------------------------------------------------------------- /CASE/Standart/20.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/CASE/Standart/20.STL -------------------------------------------------------------------------------- /CASE/Standart/standart.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /CASE/Tiny/tiny.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /CASE/case.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /CERNOHLv1_1_howto.txt: -------------------------------------------------------------------------------- 1 | Guide to the CERN OHL v.1.1 2 | 3 | This document contains guidelines on how to apply the CERN OHL v.1.1 4 | to a given hardware design, and on the use of hardware designs 5 | licensed under the CERN OHL v.1.1. 6 | 7 | How to apply the CERN OHL v.1.1 to a hardware design 8 | 9 | Pre-requisite: 10 | 11 | Authorship/ownership of the design must be clear and undisputed. Only 12 | the legal owner of the rights in the hardware design may decide under 13 | what conditions to make it available. If ownership is vested in more 14 | than one person/entity, there must be an agreement among the owners to 15 | release the hardware design as open hardware, and under the CERN OHL 16 | in particular. 17 | 18 | The hardware design documentation and files package 19 | 20 | Pack all your hardware design documentation files (schematics, 21 | layout...) as well as the documents listed below in an archive 22 | file. This will ensure the licensee downloads everything in one go. It 23 | is best to archive the files using a format everybody can 24 | open. Schematics and layouts should be included in both source form 25 | and a format readable by everybody, such as pdf. 26 | 27 | The following documents must be distributed together with the hardware 28 | design documentation: 29 | 30 | Document containing the CERN OHL v.1.1 (e.g. LICENSE.PDF) 31 | 32 | This Guide 33 | 34 | Text files (plain ASCII file), where information can be added to but 35 | not removed from, listing: 36 | 37 | Contact point of any Licensor who wishes to receive modified 38 | Documentation (see section 3.3.d) (e.g. CONTRIB.TXT); 39 | 40 | Contact point wishing to receive information about manufactured 41 | Products (see section 4.2) (e.g. PRODUCT.TXT); 42 | 43 | Modifications made by Licensee (see section 3.3.b) 44 | (e.g. CHANGES.TXT) 45 | 46 | What to do with the hardware design documentation 47 | 48 | Include in the hardware design documentation, for instance as a 49 | header, the following elements (see section 3.1 CERN OHL v.1.1): 50 | 51 | a copyright notice reflecting actual ownership; 52 | 53 | a notice that the hardware design documentation is licensed under the 54 | CERN OHL v.1.1, possibly with a link to http://ohwr.org/cernohl where 55 | the licence texts are hosted: 56 | “Licensed under CERN OHL v.1.1 or later” 57 | “Licensed under CERN OHL v.1.1”; 58 | 59 | a disclaimer of warranties; 60 | 61 | The following is an example of header if CERN is the Licensor: 62 | Copyright CERN 2011. 63 | This documentation describes Open Hardware and is licensed under the 64 | CERN OHL v. 1.1. You may redistribute and modify this documentation 65 | under the terms of the CERN OHL v.1.1. (http://ohwr.org/cernohl). This 66 | documentation is distributed WITHOUT ANY EXPRESS OR IMPLIED WARRANTY, 67 | INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS FOR A 68 | PARTICULAR PURPOSE. Please see the CERN OHL v.1.1 for applicable 69 | conditions 70 | 71 | Include on the silkscreen: 72 | the licence notice: “Licensed under CERN OHL v.1.1” 73 | Do not include the CERN logo or the copyright notice 74 | 75 | How to deal with hardware designs licensed under the CERN OHL v.1.1 76 | 77 | Generally speaking, you must always comply with any obligations 78 | applying to a particular design (detailed in a contract or 79 | accompanying licence). If you receive hardware designs licensed under 80 | the CERN OHL v.1.0, the obligations are to: 81 | 82 | Keep intact all the copyright and trademark notices that are on the 83 | hardware design documentation; 84 | 85 | Keep intact the references to the CERN OHL v.1.1; 86 | 87 | Keep intact the disclaimer of warranties. 88 | 89 | If you modify hardware design that you received from someone else that 90 | is licensed under the CERN OHL v.1.1, you must 91 | 92 | Keep intact all the notices referred to above; 93 | 94 | Include notices that you have modified the hardware designs, detailing 95 | what modifications where made (e.g. in a CHANGES.TXT file); 96 | 97 | Add the appropriate copyright notice to the modifications that were 98 | made; 99 | 100 | license the modifications under the CERN OHL v.1.1 if you distribute 101 | them. 102 | -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Pro/Through.drl: -------------------------------------------------------------------------------- 1 | M48 2 | METRIC,0000.00 3 | T01C0.3 4 | T02C1.2 5 | T03C1.5 6 | T04C1.8 7 | T05C3.3 8 | % 9 | T01 10 | X+000497Y-000690 11 | X+000346Y-000683 12 | X-000207Y-000841 13 | X-000667Y-000665 14 | X-001512Y-000393 15 | X-001398Y+000394 16 | X-000854Y+000340 17 | X-000672Y+000528 18 | X-000276Y+000650 19 | X+000001Y+000649 20 | X+000130Y+000531 21 | X+000610Y+000535 22 | X-000443Y+001605 23 | X-000911Y+001377 24 | X-001165Y+001715 25 | X-001200Y+001945 26 | X-001534Y+001211 27 | T02 28 | X+000000Y-001473 29 | X+000000Y+001473 30 | T03 31 | X+001440Y+001810 32 | X-001440Y+001810 33 | X-001440Y-001810 34 | X+001440Y-001810 35 | T04 36 | X+000712Y+001473 37 | T05 38 | X+000000Y+002050 39 | X+000000Y-002050 40 | T00 41 | M30 42 | -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Pro/pro.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Pro/Верхний.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Pro/Верхний.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Pro/Верхняяграфика.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Pro/Верхняяграфика.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Pro/Верхняямаска.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Pro/Верхняямаска.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Pro/Верхняяп.маска.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Pro/Верхняяп.маска.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Pro/Вехнийразмер.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Pro/Вехнийразмер.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Pro/Границыплаты.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Pro/Границыплаты.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Pro/Нижний.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Pro/Нижний.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Pro/Нижнийразмер.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Pro/Нижнийразмер.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Pro/Нижняяграфика.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Pro/Нижняяграфика.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Pro/Нижняямаска.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Pro/Нижняямаска.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Pro/Нижняяп.маска.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Pro/Нижняяп.маска.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Standart/Through.drl: -------------------------------------------------------------------------------- 1 | M48 2 | METRIC,0000.00 3 | T01C0.3 4 | T02C0.9 5 | T03C1.5 6 | T04C3.3 7 | % 8 | T01 9 | X+000082Y-000215 10 | X-000133Y-000074 11 | X-000414Y+000123 12 | X-000410Y+000295 13 | X-000419Y+000487 14 | X-000422Y+000649 15 | X+000001Y+000649 16 | X-000546Y+001168 17 | X-000720Y+001185 18 | X-000425Y+001601 19 | X-000553Y+001838 20 | X-000730Y+001876 21 | X-001057Y+001597 22 | X-001434Y+001150 23 | X-001434Y+000396 24 | X-000972Y+000341 25 | X-001410Y-000389 26 | X-000667Y-000665 27 | X-000207Y-000841 28 | T02 29 | X+000000Y+001575 30 | X-000127Y-001575 31 | X+000127Y-001575 32 | T03 33 | X+001345Y+001435 34 | X-001345Y+001435 35 | X-001345Y-001435 36 | X+001345Y-001435 37 | T04 38 | X+000675Y+001655 39 | X-000675Y-001655 40 | T00 41 | M30 42 | -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Standart/standart.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Standart/Верхний.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Standart/Верхний.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Standart/Верхняяграфика.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Standart/Верхняяграфика.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Standart/Верхняямаска.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Standart/Верхняямаска.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Standart/Верхняяп.маска.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Standart/Верхняяп.маска.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Standart/Вехнийразмер.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Standart/Вехнийразмер.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Standart/Границыплаты.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Standart/Границыплаты.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Standart/Нижний.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Standart/Нижний.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Standart/Нижнийразмер.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Standart/Нижнийразмер.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Standart/Нижняяграфика.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Standart/Нижняяграфика.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Standart/Нижняямаска.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Standart/Нижняямаска.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Standart/Нижняяп.маска.gbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/LUT_HAND_MADE/Standart/Нижняяп.маска.gbr -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/Tiny/tiny.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /GERBER_FILES/LUT_HAND_MADE/lut.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /GERBER_FILES/PROD/Pro/001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/PROD/Pro/001.png -------------------------------------------------------------------------------- /GERBER_FILES/PROD/Pro/pro.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /GERBER_FILES/PROD/Standart/WLS_St_V1.2.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/GERBER_FILES/PROD/Standart/WLS_St_V1.2.rar -------------------------------------------------------------------------------- /GERBER_FILES/PROD/Tiny/tiny.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /GERBER_FILES/PROD/prod.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /IMAGES/Pro/IMG_20190710_142758.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Pro/IMG_20190710_142758.jpg -------------------------------------------------------------------------------- /IMAGES/Pro/IMG_20190710_142942.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Pro/IMG_20190710_142942.jpg -------------------------------------------------------------------------------- /IMAGES/Pro/IMG_20190710_142956.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Pro/IMG_20190710_142956.jpg -------------------------------------------------------------------------------- /IMAGES/Pro/IMG_20190711_011533.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Pro/IMG_20190711_011533.jpg -------------------------------------------------------------------------------- /IMAGES/Pro/IMG_20190711_011544.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Pro/IMG_20190711_011544.jpg -------------------------------------------------------------------------------- /IMAGES/Pro/IMG_20190711_011553.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Pro/IMG_20190711_011553.jpg -------------------------------------------------------------------------------- /IMAGES/Pro/IMG_20190711_011656.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Pro/IMG_20190711_011656.jpg -------------------------------------------------------------------------------- /IMAGES/Pro/IMG_20190711_011746.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Pro/IMG_20190711_011746.jpg -------------------------------------------------------------------------------- /IMAGES/Pro/IMG_20190711_012035.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Pro/IMG_20190711_012035.jpg -------------------------------------------------------------------------------- /IMAGES/Pro/IMG_20190711_012125.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Pro/IMG_20190711_012125.jpg -------------------------------------------------------------------------------- /IMAGES/Pro/IMG_20190711_012132.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Pro/IMG_20190711_012132.jpg -------------------------------------------------------------------------------- /IMAGES/Pro/IMG_20190711_012139.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Pro/IMG_20190711_012139.jpg -------------------------------------------------------------------------------- /IMAGES/Pro/pro.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /IMAGES/Standart/IMG_20190710_142758.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Standart/IMG_20190710_142758.jpg -------------------------------------------------------------------------------- /IMAGES/Standart/IMG_20190710_142942.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Standart/IMG_20190710_142942.jpg -------------------------------------------------------------------------------- /IMAGES/Standart/IMG_20190710_142956.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Standart/IMG_20190710_142956.jpg -------------------------------------------------------------------------------- /IMAGES/Standart/IMG_20190710_175220.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Standart/IMG_20190710_175220.jpg -------------------------------------------------------------------------------- /IMAGES/Standart/IMG_20190710_175248.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Standart/IMG_20190710_175248.jpg -------------------------------------------------------------------------------- /IMAGES/Standart/IMG_20190710_175327.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Standart/IMG_20190710_175327.jpg -------------------------------------------------------------------------------- /IMAGES/Standart/IMG_20190710_175327_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Standart/IMG_20190710_175327_1.jpg -------------------------------------------------------------------------------- /IMAGES/Standart/IMG_20190710_175426.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Standart/IMG_20190710_175426.jpg -------------------------------------------------------------------------------- /IMAGES/Standart/IMG_20190710_175558.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Standart/IMG_20190710_175558.jpg -------------------------------------------------------------------------------- /IMAGES/Standart/IMG_20190710_175626.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartboxchannel/EFEKTA_WATER_LEAK_SENSOR/0b3c30a97c76af725a354d3ddda54de1586d5da4/IMAGES/Standart/IMG_20190710_175626.jpg -------------------------------------------------------------------------------- /IMAGES/Standart/standart.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /IMAGES/Tiny/tiny.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /IMAGES/images.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Licensed under CERN OHL v.1.1.txt: -------------------------------------------------------------------------------- 1 | CERN OPEN HARDWARE LICENCE v1.1 2 | 3 | Preamble 4 | 5 | Through this CERN Open Hardware Licence ("CERN OHL") version 1.1, the 6 | Organization wishes to disseminate its hardware designs (as published 7 | on http://www.ohwr.org/) as widely as possible, and generally to 8 | foster collaboration among public research hardware designers. The 9 | CERN OHL is copyright of CERN. Anyone is welcome to use the CERN OHL, 10 | in unmodified form only, for the distribution of his own Open Hardware 11 | designs. Any other right is reserved. 12 | 13 | 1. Definitions 14 | 15 | In this Licence, the following terms have the following meanings: 16 | 17 | “Licence” means this CERN OHL. 18 | 19 | “Documentation” means schematic diagrams, designs, circuit or circuit 20 | board layouts, mechanical drawings, flow charts and descriptive text, 21 | and other explanatory material that is explicitly stated as being made 22 | available under the conditions of this Licence. The Documentation may 23 | be in any medium, including but not limited to computer files and 24 | representations on paper, film, or any other media. 25 | 26 | “Product” means either an entire, or any part of a, device built using 27 | the Documentation or the modified Documentation. 28 | 29 | “Licensee” means any natural or legal person exercising rights under 30 | this Licence. 31 | 32 | “Licensor” means any natural or legal person that creates or modifies 33 | Documentation and subsequently communicates to the public and/ or 34 | distributes the resulting Documentation under the terms and conditions 35 | of this Licence. 36 | 37 | A Licensee may at the same time be a Licensor, and vice versa. 38 | 39 | 2. Applicability 40 | 41 | 2.1 This Licence governs the use, copying, modification, communication 42 | to the public and distribution of the Documentation, and the 43 | manufacture and distribution of Products. By exercising any right 44 | granted under this Licence, the Licensee irrevocably accepts these 45 | terms and conditions. 46 | 47 | 2.2 This Licence is granted by the Licensor directly to the Licensee, 48 | and shall apply worldwide and without limitation in time. The Licensee 49 | may assign his licence rights or grant sub-licences. 50 | 51 | 2.3 This Licence does not apply to software, firmware, or code loaded 52 | into programmable devices which may be used in conjunction with the 53 | Documentation, the modified Documentation or with Products. The use of 54 | such software, firmware, or code is subject to the applicable licence 55 | terms and conditions. 56 | 57 | 3. Copying, modification, communication to the public and distribution 58 | of the Documentation 59 | 60 | 3.1 The Licensee shall keep intact all copyright and trademarks 61 | notices and all notices that refer to this Licence and to the 62 | disclaimer of warranties that is included in the Documentation. He 63 | shall include a copy thereof in every copy of the Documentation or, as 64 | the case may be, modified Documentation, that he communicates to the 65 | public or distributes. 66 | 67 | 3.2 The Licensee may use, copy, communicate to the public and 68 | distribute verbatim copies of the Documentation, in any medium, 69 | subject to the requirements specified in section 3.1. 70 | 71 | 3.3 The Licensee may modify the Documentation or any portion 72 | thereof. The Licensee may communicate to the public and distribute the 73 | modified Documentation (thereby in addition to being a Licensee also 74 | becoming a Licensor), always provided that he shall: 75 | a. comply with section 3.1; 76 | b. cause the modified Documentation to carry prominent notices stating 77 | that the Licensee has modified the Documentation, with the date and 78 | details of the modifications; 79 | c. license the modified Documentation under the terms and conditions 80 | of this Licence or, where applicable, a later version of this Licence 81 | as may be issued by CERN; and 82 | d. send a copy of the modified Documentation to all Licensors that 83 | contributed to the parts of the Documentation that were modified, as 84 | well as to any other Licensor who has requested to receive a copy of 85 | the modified Documentation and has provided a means of contact with 86 | the Documentation. 87 | 88 | 3.4 The Licence includes a licence to those patents or registered 89 | designs that are held by the Licensor, to the extent necessary to make 90 | use of the rights granted under this Licence. The scope of this 91 | section 3.4 shall be strictly limited to the parts of the 92 | Documentation or modified Documentation created by the Licensor. 93 | 94 | 4. Manufacture and distribution of Products 95 | 96 | 4.1 The Licensee may manufacture or distribute Products always 97 | provided that the Licensee distributes to each recipient of such 98 | Products a copy of the Documentation or modified Documentation, as 99 | applicable, and complies with section 3. 100 | 101 | 4.2 The Licensee is invited to inform in writing any Licensor who has 102 | indicated its wish to receive this information about the type, 103 | quantity and dates of production of Products the Licensee has (had) 104 | manufactured. 105 | 106 | 5. Warranty and liability 107 | 108 | 5.1 DISCLAIMER – The Documentation and any modified Documentation are 109 | provided "as is" and any express or implied warranties, including, but 110 | not limited to, implied warranties of merchantability, of satisfactory 111 | quality, and fitness for a particular purpose or use are disclaimed in 112 | respect of the Documentation, the modified Documentation or any 113 | Product. The Licensor makes no representation that the Documentation, 114 | modified Documentation, or any Product, does or will not infringe any 115 | patent, copyright, trade secret or other proprietary right. The entire 116 | risk as to the use, quality, and performance of a Product shall be 117 | with the Licensee and not the Licensor. This disclaimer of warranty is 118 | an essential part of this Licence and a condition for the grant of any 119 | rights granted under this Licence. The Licensee warrants that it does 120 | not act in a consumer capacity. 121 | 122 | 5.2 LIMITATION OF LIABILITY – The Licensor shall have no liability for 123 | direct, indirect, special, incidental, consequential, exemplary, 124 | punitive or other damages of any character including, without 125 | limitation, procurement of substitute goods or services, loss of use, 126 | data or profits, or business interruption, however caused and on any 127 | theory of contract, warranty, tort (including negligence), product 128 | liability or otherwise, arising in any way in relation to the 129 | Documentation, modified Documentation and/or the use, manufacture or 130 | distribution of a Product, even if advised of the possibility of such 131 | damages, and the Licensee shall hold the Licensor(s) free and harmless 132 | from any liability, costs, damages, fees and expenses, including 133 | claims by third parties, in relation to such use. 134 | 135 | 6. General 136 | 137 | 6.1 The rights granted under this Licence do not imply or represent 138 | any transfer or assignment of intellectual property rights to the 139 | Licensee. 140 | 141 | 6.2 The Licensee shall not use or make reference to any of the names, 142 | acronyms, images or logos under which the Licensor is known, save in 143 | so far as required to comply with section 3. Any such permitted use or 144 | reference shall be factual and shall in no event suggest any kind of 145 | endorsement by the Licensor or its personnel of the modified 146 | Documentation or any Product, or any kind of implication by the 147 | Licensor or its personnel in the preparation of the modified 148 | Documentation or Product. 149 | 150 | 6.3 CERN may publish updated versions of this Licence which retain the 151 | same general provisions as this version, but differ in detail so far 152 | this is required and reasonable. New versions will be published with a 153 | unique version number. 154 | 155 | 6.4 This Licence shall terminate with immediate effect, upon written 156 | notice and without involvement of a court if the Licensee fails to 157 | comply with any of its terms and conditions, or if the Licensee 158 | initiates legal action against Licensor in relation to this 159 | Licence. Section 5 shall continue to apply. 160 | 161 | 6.5 Except as may be otherwise agreed with the Intergovernmental 162 | Organization, any dispute with respect to this Licence involving an 163 | Intergovernmental Organization shall, by virtue of the latter's 164 | Intergovernmental status, be settled by international arbitration. The 165 | arbitration proceedings shall be held at the place where the 166 | Intergovernmental Organization has its seat. The arbitral award shall 167 | be final and binding upon the parties, who hereby expressly agree to 168 | renounce any form of appeal or revision. 169 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Wireless Water Leak sensor based on nRF52832. 2 | 3 | Standart version running on cr2477 battery (900mA). 4 | Pro version running on 2/AA(14250) battery (1200mA). 5 | Tiny version running on cr2032 battery (200mA). 6 | 7 | Use the MySensors library 8 | 9 | #### Don't donate to me, it doesn't work in this world: https://paypal.me/efektalab , just buy: 10 | 11 | More info at http://efektalab.com/wls52 12 | 13 | Contact: hello@efektalab.com 14 | 15 | Video(Standart version): https://youtu.be/5jZt3NWf9GA 16 | 17 | Video(Pro version): https://youtu.be/BB_674CVZLk 18 | 19 | Video(Tiny version): 20 | 21 | 22 | 23 | --- 24 | 25 | --- 26 | 27 | Components (see also BOM.CSV): 28 | 29 | YJ-17103 (Standart version) - http://ali.ski/1Hm3u 30 | 31 | YJ-17029 (Pro version) - http://ali.ski/q58oo 32 | 33 | SKB369 (Tiny version) - http://ali.ski/WdZx8 34 | 35 | SN74LVC1G00 - http://ali.ski/iLK_F 36 | 37 | 1PS76SB10.115(SOD-323) SMD Schottky Barrier Diode(2) - http://ali.ski/5dTu7U 38 | 39 | 100UF 107C D-type SMD Tantalum Capacitor - http://ali.ski/-NkuK 40 | 41 | 100nF | 50v | +80-20% | SMD 0805 | SMD ceramic capacitor 100nF | Y5V - http://ali.ski/nnISH 42 | 43 | 2UF | 50v | +80-20% | SMD 0805 | SMD ceramic capacitor 2UF | Y5V - http://ali.ski/nnISH 44 | 45 | (Standart version) CR2450 Battery Socket Holder Case (TBH-CR2450-03) - http://ali.ski/49emH8 46 | 47 | (Pro version) 14250 Battery Holder 1/2 AA - http://ali.ski/ul0KpU 48 | 49 | (Tiny version) CR2032 plastic button cell battery base holder - http://ali.ski/YCrdZ 50 | 51 | Micro Button Tact Switch SMD 4Pin 3X4X2.5MM White(2) - http://ali.ski/8wHa4- 52 | 53 | 2x3P | 6pin | 1.27mm | SMT | J1 Pin Header Female - http://ali.ski/tKqX1J 54 | 55 | 10K | 5% | SMD 0603 | SMD resistor 10K Ohm(3) - http://ali.ski/1xMf- 56 | 57 | 100K | 5% | SMD 0603 | SMD resistor 100K Ohm - http://ali.ski/1xMf- 58 | 59 | 2K7 | 5% | SMD 0603 | SMD resistor 2K7 Ohm - http://ali.ski/1xMf- 60 | 61 | 6K8 | 5% | SMD 0603 | SMD resistor 6K8 Ohm - http://ali.ski/1xMf- 62 | 63 | 9K1 | 5% | SMD 0603 | SMD resistor 9K1 Ohm - http://ali.ski/1xMf- 64 | 65 | 1M | 5% | SMD 0603 | SMD resistor 1M Ohm - http://ali.ski/1xMf- 66 | 67 | 100 | 5% | SMD 0603 | SMD resistor 100 Ohm - http://ali.ski/1xMf- 68 | 69 | RGB LED | SMD 0805 | RGBL | RGB LED - http://ali.ski/BPc4y 70 | 71 | 72 | --- 73 | 74 | 75 | M1.4 4mm Round Head Micro Screws(4) - http://ali.ski/sV_W2 76 | 77 | (Standart version) M3 11mm Nickel plated Brass Standoff Spacer Female(2) - http://ali.ski/gxLz3d 78 | 79 | (Pro version) M3 15mm Nickel plated Brass Standoff Spacer Female(2) - http://ali.ski/gxLz3d 80 | 81 | M3 6mm Hexagon Socket Thin low Short Head Cap Screw(2) - http://ali.ski/y_jhn 82 | 83 | M3 4mm Hexagon Socket Button Head Screws(2) - http://ali.ski/Fsm9k 84 | 85 | 86 | --- 87 | 88 | ANYCUBIC 405nm UV Resin For Photon 3D Printer - http://ali.ski/MQ5yO3 89 | 90 | -------------------------------------------------------------------------------- /product.txt: -------------------------------------------------------------------------------- 1 | hello@efektalab.com 2 | --------------------------------------------------------------------------------