213 Commits

Author SHA1 Message Date
Ollo
2cf17ec7b8 Serial debugging, when 1wire seonsors are missing. -> Check Board revision 2025-05-10 15:04:12 +02:00
Ollo
9435bf8392 Serial debug added for 1wire initialization 2025-05-03 16:46:53 +02:00
Ollo
1190b0324e Add messages on failed 1wire sensors 2025-05-03 15:37:10 +02:00
Ollo
cf1f631e07 Read water sensor only three times 2025-05-02 11:32:28 +02:00
Ollo
2fad7ebbaf Change solar factor to dd3888ba52 2024-06-25 20:53:15 +02:00
Ollo
7d6c1c3daa Disable all outputs (power safing), float number cannot be compared 2024-05-19 21:36:10 +02:00
Ollo
aa7cb31302 Activate Sensors and Pumps if Lipo is charged 2024-05-11 15:22:49 +02:00
Ollo
cd1e88e6e2 Print build date and time of firmware to upload 2024-05-09 11:41:20 +02:00
Ollo
cbde8ee11c Battery voltage below minimum should be treated as 0% 2024-04-20 13:39:16 +02:00
Ollo
dd3888ba52 Change Solar factor for Revision 0.10 2024-04-20 12:51:33 +02:00
Ollo
d2f1605b90 Sleep 2 hours on low battery 2024-04-07 12:50:12 +02:00
Ollo
cb37426fbb Deepsleep increased and Sensor-Enable for HW0.7 corrected 2024-04-01 13:03:04 +02:00
Ollo
48e5383106 Print Moisture measurement debugging in MQTT 2024-04-01 13:02:26 +02:00
Ollo
ff081a8d44 Increase deepsleep time 2024-04-01 12:10:22 +02:00
Ollo
3764183944 uniq message for ESP OTA state 2024-04-01 11:48:29 +02:00
Ollo
c85f69c545 Fixed low light information, by comparing it with minimum value 2024-03-28 20:39:43 +01:00
Ollo
7494f9de51 Different factor to read solar voltage between HW0.7 and HW0.10 2024-03-28 20:37:19 +01:00
Ollo
9c4e747b50 Added Compatibilitymode for hardware revision 0.7 2024-03-10 16:53:54 +01:00
Ollo
fb87907afc Updated example 2024-03-08 21:07:36 +01:00
Ollo
97a88ebb91 Merge master 2024-03-08 20:39:49 +01:00
Ollo
f8629586f8 Calculate water percentage below 30 percent 2024-02-24 16:21:39 +01:00
Ollo
4f7e57988b analog water measurement added 2024-02-18 15:07:06 +01:00
Empire
fbbbc5f5aa fix ota 2023-08-02 21:45:36 +02:00
Empire
5e16ca32e0 increase ota partition size for newer platform core 2023-08-02 21:44:54 +02:00
Empire
78193855a3 gpio 15 warnung 2023-08-02 21:44:17 +02:00
Empire
6d5f68fab5 Merge branch 'master' of github.com:0110/PlantCtrl 2023-07-20 20:11:58 +02:00
Ollo
9167da5a82 Refactoring 2023-06-20 18:06:29 +02:00
Ollo
f65132652c Optional features can be controlled via platformio.ini and are mentioned in firmware name on MQTT 2023-06-20 17:53:19 +02:00
Empire
703553beb4 Merge branch 'master' of github.com:0110/PlantCtrl 2023-06-15 21:44:00 +02:00
Ollo
2636e2defa Read more distances 2023-06-11 13:51:13 +02:00
Ollo
c6ddfea44b Handle unrealistic water values 2023-06-11 13:28:52 +02:00
Empire
85bcbd166c Fix remaining mqtt calculation 2023-06-04 19:21:53 +02:00
Ollo
6cb446735d Adapted default work time, as internal time is UTC 2023-05-28 10:53:43 +02:00
Ollo
ab17709435 More serial debuging (parsing 1WIRE Addresses failed) 2023-05-27 09:12:55 +02:00
Empire
e55b4abd49 added extension board 2023-05-18 11:06:12 +02:00
Empire
cf7ff9b0d1 added ota state debugging 2023-05-17 18:24:27 +02:00
Your Name
1cc46a360b fixed not watering when water is left 2023-04-26 08:33:12 +02:00
Ollo
9235e8a272 Changed to python3 2023-04-06 18:03:13 +02:00
Ollo
2a2a36b267 sleep at least several minutes, so the solar panel can charge the battery 2023-04-06 17:56:17 +02:00
Ollo
9f2e21d94c Sleep 3 times longer, if the battery voltage is low 2023-03-25 14:21:33 +01:00
Empire
a84344f978 Merge branch 'ollo-dev' 2023-03-24 19:55:14 +01:00
Ollo
5df69f20a8 Stop pumps due to water sensor 2023-03-24 18:40:57 +01:00
Ollo
704684d437 Fixed water distance and publish percentage 2023-03-24 18:06:21 +01:00
Ollo
90f2d821a7 Swapped water sensor pins 2023-03-22 22:04:49 +01:00
Empire
e8759435e7 frequency resistive sensor adjustment 2023-03-22 21:43:52 +01:00
Ollo
bd2e4d3da0 distance sensor is reset after powercycle 2023-03-22 21:06:14 +01:00
Ollo
9eb16637dc Reset as distance is > 8 meter 2023-03-22 21:01:24 +01:00
Ollo
66f61a69db Reset sensor on bad values 2023-03-22 20:50:25 +01:00
Ollo
939a5fe21a Print distance 2023-03-22 20:21:10 +01:00
Ollo
3a2ddb92e3 Set onewire bus 2023-03-22 20:06:35 +01:00
Ollo
1e79588e98 Merge branch 'ollo-dev' of github.com:0110/PlantCtrl into ollo-dev 2023-03-22 20:02:33 +01:00
Ollo
a0c657a418 VL53L0X test started 2023-03-22 20:02:23 +01:00
Ollo
ab480041b2 Removed timeout 2023-03-10 23:37:50 +01:00
Ollo
1fad63a84d Start I2C sensor after power was activated 2023-03-10 22:50:16 +01:00
Ollo
712ef73a30 Merged master into ollo-dev 2023-03-10 20:06:05 +01:00
Empire
63ed9afabc stuff changed 2023-03-03 19:58:55 +01:00
Empire
3835bd96a1 Revert "Revert "add resistive frequency sensor, updated dependencies""
This reverts commit 42ce4cdda2.
2023-02-12 12:51:52 +01:00
Empire
42ce4cdda2 Revert "add resistive frequency sensor, updated dependencies"
This reverts commit 17d16a6eef.
2023-02-12 12:40:38 +01:00
Empire
2b6d766492 fix water error code 2023-02-10 22:23:04 +01:00
Empire
68386ce02f Merge branch 'master' of github.com:0110/PlantCtrl 2023-02-10 22:12:57 +01:00
Empire
17d16a6eef add resistive frequency sensor, updated dependencies 2023-02-10 22:08:29 +01:00
Your Name
43e638a587 set more state retained 2022-12-20 00:07:25 +01:00
Your Name
0d15479268 remove leftover 2022-12-20 00:07:25 +01:00
Your Name
2914a0c7a1 slightly adjust range for better precision 2022-12-20 00:07:25 +01:00
37a08dede6 add frozen water mode 2022-12-20 00:04:57 +01:00
Ollo
195d3d3c1b Ignore voltages above 100V 2022-08-25 18:40:41 +02:00
Ollo
e820301490 Tweak state numbers 2022-08-23 20:26:11 +02:00
Ollo
29e3aa08cb Fixed unit description for cooldown 2022-08-22 18:08:19 +02:00
Ollo
791d6f04b0 Tweaked number 2022-08-21 12:12:07 +02:00
Ollo
79ffd8acff Version increased 2022-08-21 12:07:43 +02:00
Ollo
18b927bd59 Publish state as number and string 2022-08-21 12:05:43 +02:00
Ollo
c444117853 code refactoring: use the defined states of header file 2022-08-21 11:59:50 +02:00
Ollo
5d24a51bd9 Plant states defined in header 2022-08-21 11:52:15 +02:00
Ollo
71b9150279 Restore frequency boundaries (7a54065a5f) 2022-06-25 17:43:23 +02:00
Ollo
7eda866a91 Kept branch version of /esp32test/Esp32DeepSleepTest/src/main.cpp 2022-06-25 17:28:01 +02:00
Ollo
f18e4a7586 Show process in output (steps) 2022-06-25 17:20:11 +02:00
662d7bc853 add timer only mode, more sane default config 2022-05-20 01:00:04 +02:00
5dedc76727 formating only 2022-04-29 10:47:54 +02:00
15e96a4990 ensure compilation with bricking limits is not possible 2022-04-29 10:47:46 +02:00
0dd4553999 do not use pump for download indication anymore 2022-04-29 10:47:16 +02:00
7a841d423b use more sane default (pump always not only at night) 2022-04-29 10:45:59 +02:00
4a86d8c41c fixed analog probe being backwards, extended range for frequency one 2022-04-29 10:14:50 +02:00
Empire
c43da98245 Merge branch 'hydro'
# Conflicts:
#	esp32/PlantControl.code-workspace
#	esp32/include/ControllerConfiguration.h
#	esp32/platformio.ini
#	esp32/src/main.cpp
2022-04-27 19:19:26 +00:00
Ollo
f38cb6b564 Testsetup for frequency on GPIO17 2022-04-02 22:10:31 +02:00
Ollo
6c475a2ade Sensor types are defined in platformio.ini 2022-03-06 14:25:14 +01:00
Ollo
9a172c269e Swapped max and min for analog mapping 2022-03-06 14:05:54 +01:00
Ollo
868d3d912e Update the analog maximum according datasheet 2022-03-06 13:47:21 +01:00
Empire
defbcca8ae sht20 support 2022-03-05 09:31:43 +00:00
Empire
a9c4c32a22 Merge branch 'master' of github.com:0110/PlantCtrl 2022-02-19 17:47:00 +00:00
c3ma
1161c62a90 print into mqtt the sensor mode 2022-02-19 02:51:36 +01:00
c3ma
a0f8df7016 fix for capacitive sensors not working, enum introduction for sensormode 2022-02-19 02:24:19 +01:00
c3ma
d0320beaa7 allow sensor type selection per plant, changed calculations to use PCT values, due to different raw value meaning 2022-02-12 05:26:54 +01:00
Ollo
7a54065a5f Reduced frequrency boundery 2022-01-25 22:11:38 +01:00
Your Name
27cd6af02d cleanup power settings 2021-12-05 16:13:02 +01:00
Your Name
a745896643 added ulp-pwm logic for timedlight 2021-12-05 02:36:03 +01:00
Empire
80828eadd7 ulp tests 2021-12-04 16:04:18 +00:00
Empire
b9d8831dea Merge branch 'master' of github.com:0110/PlantCtrl
# Conflicts:
#	esp32/src/main.cpp
2021-12-03 18:42:37 +00:00
Empire
d69feb4143 basic pump ml calculation 2021-12-03 18:36:10 +00:00
Your Name
f131d9f39a hydro mode config and ignore low voltage light condition 2021-12-02 16:50:24 +01:00
Your Name
d7b854da75 allow disable light voltage range with -1 2021-12-02 14:40:06 +01:00
Ollo
16a722816c Use only Homie compliant datatypes: https://homieiot.github.io/specification/spec-core-v3_0_1/# 2021-11-29 17:25:08 +01:00
Ollo
9ff546b7b7 Remove Exception stuff 2021-11-28 16:02:08 +01:00
Empire
61fad8e14c Merge branch 'master' of https://github.com/0110/PlantCtrl 2021-11-19 18:58:26 +00:00
Empire
af618e73f3 pump refactor round 1 2021-11-19 18:48:14 +00:00
Ollo
c5bce25afe Added time into logs 2021-11-14 19:49:40 +01:00
Ollo
a457db4447 Fixed memory leak 2021-11-14 13:51:52 +01:00
c3ma
66d69eab6b Exceptions added 2021-11-13 17:26:39 +01:00
c3ma
f727971138 increased ota flash sizes 2021-10-27 22:04:44 +02:00
Your Name
d00517ec1e added epoxy form and sensor mod 2021-10-27 15:05:37 +02:00
Your Name
2ad351c41b remove selfTest causing sideeffects for pumploop trigger 2021-10-27 02:05:48 +02:00
Your Name
7d80d444cf use only seconds for time units, improve self test debug 2021-10-27 01:42:01 +02:00
Your Name
e70e467e9b properly set last run time, as it apparently was missing 2021-10-27 00:40:46 +02:00
Your Name
6a97215a04 fix for hydroponic not working at night 2021-10-27 00:40:26 +02:00
Your Name
2c8645121e added pump specific power level (requires controller that supports this or dc motor) 2021-10-26 21:50:55 +02:00
Your Name
dba39869d1 use shorter valid firmeware name 2021-10-26 21:12:00 +02:00
Your Name
9170a1fe05 some fixes for hydroponics mode 2021-10-26 20:46:40 +02:00
Empire
49664ba6f7 added initial support for hydroponic systems, changed cooldown to use minutes 2021-10-22 17:39:42 +00:00
Your Name
0bcef25528 Merge branch 'master' of https://github.com/0110/PlantCtrl 2021-10-22 15:53:58 +02:00
Your Name
f30a0a0c78 smooth battery sensor 2021-10-22 15:52:19 +02:00
Ollo
d819f7df4e Update documentation 2021-10-15 21:59:47 +02:00
c3ma
ecc03e9cb4 mqtt extraction 2021-10-06 22:00:17 +02:00
c3ma
2cd0a0f48b initial flowmeter logic and calculation 2021-10-06 21:24:34 +02:00
c3ma
b5569aa8ab Cleanup of last changes 2021-10-06 20:05:09 +02:00
Your Name
244dfb9b27 Merge branch 'master' of https://github.com/0110/PlantCtrl
# Conflicts:
#	esp32/src/main.cpp
2021-10-01 23:51:29 +02:00
Your Name
f4e13454e3 wip new pump system 2021-10-01 23:46:37 +02:00
Ollo
1619b93fa1 Updated ini.example 2021-10-01 23:00:24 +02:00
Ollo
58cb523e1b added determineTimeLightState in TIMED_LIGHT_PIN define 2021-10-01 22:53:40 +02:00
Ollo
e913ff462e Merge branch 'master' of github.com:0110/PlantCtrl 2021-10-01 21:40:41 +02:00
Your Name
f13a25b34d prevent light from being reenabled untill next day after low voltage trigger 2021-09-14 18:54:14 +02:00
Empire
88e4ceea8b fix for wrong validator 2021-08-30 08:02:12 +00:00
Your Name
f99f72b65a added timed light function 2021-08-29 20:45:50 +02:00
Your Name
e927fc8c70 add alarm if pumps did not change state to wet after X consecutive tries 2021-08-23 00:58:37 +02:00
Your Name
61098724b6 fixed wrong percent calculation, emit trigger value to mqtt 2021-08-17 16:55:57 +02:00
c3ma
2e052710e2 missing sensor error 2021-07-21 21:34:14 +02:00
c3ma
d043d873cc Reading sensors by frequency 2021-07-21 21:23:58 +02:00
Ollo
2d167c7393 adapted datatype 2021-07-14 21:43:03 +02:00
Ollo
f6c51f6d05 Updated example, more debug output in script 2021-07-14 21:33:47 +02:00
Ollo
02a882ebde Seperate setting itself into a local file 2021-07-14 21:21:49 +02:00
Ollo
697d470d29 Renamed file 2021-07-14 21:15:04 +02:00
Ollo
c448960415 Check values before publishing water stuff 2021-07-14 21:14:03 +02:00
c3ma
2d91f91290 react on switch from Mqtt 2021-07-09 22:51:50 +02:00
c3ma
df39c09c50 code cleanups 2021-07-09 21:50:51 +02:00
c3ma
99703e5ad1 Adjust moister sensor boundaries 2021-07-09 19:40:51 +02:00
Your Name
12d4c9950d fix cooldown memory without power, improved logging 2021-07-01 23:09:02 +02:00
Ollo
456f78042c Fixed concatination of strings in logging 2021-07-01 22:15:55 +02:00
Ollo
57d18af76d converted serial prints into MQTT status log messages 2021-07-01 22:06:50 +02:00
Your Name
f1d55ed603 extracte time stuff, started logger 2021-07-01 21:19:51 +02:00
Your Name
a1f2388c7f use mAlive instead of mqtt/homie varaibles 2021-07-01 20:50:47 +02:00
Your Name
d2010ddebb improved script reliability 2021-07-01 20:40:51 +02:00
Your Name
7c9a0bf6f1 clear averages for each run, ignore distances higher than tank depth 2021-07-01 20:39:51 +02:00
Your Name
11d29939f6 code stuff 2021-07-01 20:39:06 +02:00
Your Name
c32fd350c1 stuff 2021-06-29 23:50:41 +02:00
Your Name
a1de9ee2b9 config reduced, config json parser memory adjusted 2021-06-29 23:49:48 +02:00
Your Name
5568000d62 initial settings uploader added 2021-06-29 23:49:30 +02:00
Your Name
191e05b941 fixed config backup and restore 2021-06-29 22:09:30 +02:00
Your Name
c22c14a42b stop then script from sleeping the esp in case of an error 2021-06-29 20:14:36 +02:00
Your Name
54398b7bd6 adjust voltage divider to match 0.10 pcb layout 2021-06-29 20:14:19 +02:00
Your Name
0eeeb6dc60 set threshold for accumlator calculation 2021-06-29 20:14:03 +02:00
C3MA Werkstatt
e483b63400 Set 2k2 as pullup for I2C 2021-06-23 22:05:24 +02:00
Your Name
bc4d3ca271 0.10 rev final 2021-06-23 20:20:55 +02:00
Your Name
d08132c420 new extension header, improved labeling of connectors, optimized layout 2021-06-10 23:04:13 +02:00
Your Name
295673b6cb redesigned custom connector 2021-06-10 20:41:08 +02:00
Ollo
c400200e23 Merge branch 'master' of github.com:0110/PlantCtrl 2021-06-09 19:52:23 +02:00
Your Name
b5031124f4 Merge branch 'master' of https://github.com/0110/PlantCtrl
# Conflicts:
#	board/PlantCtrlESP32.kicad_pcb
2021-06-06 22:53:41 +02:00
3391dfb2c9 report raw distance for water sensor 2021-06-06 22:50:56 +02:00
c3ma
a8403a7c98 added distance sensor and adjusted pcb for it 2021-06-06 21:23:21 +02:00
c3ma
5fcf72602d fixed bootloader 2021-06-06 19:25:27 +02:00
c3ma
5980115298 added more correct pull down for download mode 2021-06-06 17:31:07 +02:00
e78f49b9da further reduced only once used parts 2021-06-04 12:52:11 +02:00
84690562b2 reduced odd resistors 2021-06-04 12:37:18 +02:00
7fcee1fb0d add high impendance pulldown to analog in 2021-06-04 12:31:00 +02:00
c3ma
2f21bd133e Signed-off-by: c3ma <c3ma@example.com> 2021-06-02 23:34:16 +02:00
Ollo
bb0eefa8bd Merge branch 'master' of github.com:0110/PlantCtrl 2021-06-02 22:20:26 +02:00
c3ma
89b982e59f Signed-off-by: c3ma <c3ma@example.com> 2021-06-02 22:20:05 +02:00
Ollo
8cbd96adda Merge branch 'master' of github.com:0110/PlantCtrl 2021-06-02 22:14:43 +02:00
c3ma
ac8e2bc4d4 use same pinout for moisture sensor as used on the sensor itself 2021-06-02 22:14:07 +02:00
Your Name
049246312e fixed labeling and spacing for sensors and pumps 2021-06-01 22:56:09 +02:00
Your Name
8c04bcbb7d fixed power on download mode, solar voltage sensor fixed 2021-06-01 22:44:31 +02:00
Your Name
dd58310fe9 make sensor address compare actually work 2021-05-29 22:07:47 +02:00
Your Name
ce1f75eae3 Merge branch 'master' of https://github.com/0110/PlantCtrl 2021-05-29 21:38:11 +02:00
Your Name
8e5a13d291 ensure DS18S20 are properly resolved via address 2021-05-29 21:37:27 +02:00
Your Name
200ff30f62 allow analog sensor some time to settle 2021-05-29 19:11:40 +02:00
c3ma
f275becb98 changed switches to cheaper alternative 2021-05-28 20:22:55 +02:00
Your Name
2c5d61a124 "improved" topic macro, added backup status and topic 2021-05-27 22:53:49 +02:00
Your Name
057e2b37c3 retry on crc error for onewire 2021-05-27 21:43:15 +02:00
Your Name
3d45a3fca3 config backup wip 2021-05-26 22:25:12 +02:00
Your Name
98799bd2d5 added testmode, fixed formating 2021-05-26 21:46:33 +02:00
Your Name
2c70ff1ed3 more capacitors, slight layout optimisation 2021-05-26 21:18:52 +02:00
Ollo
f0127921b1 Handle different start and end times to water plants 2021-05-26 20:19:27 +02:00
Your Name
cad836b070 fixed homie config fail mode 2021-05-24 20:35:41 +02:00
Your Name
72f8d36393 ignore bod while starting upstepper 2021-05-24 20:07:22 +02:00
Your Name
a90b59f69f use mqtt roundtrip to ensure all receiving messages are processed before ds 2021-05-24 19:37:27 +02:00
Your Name
50d07a3c02 fixed deepsleep procedure, homie shutdown, ensure pinhold is same as pin 2021-05-24 15:50:04 +02:00
Your Name
92005c1c33 control works again (fixed with wifi and fallback) 2021-05-24 14:58:35 +02:00
Ollo
5db0e2c82f Merged 2021-05-21 22:09:30 +02:00
Ollo
ad0ae88c3c More GPIO debug output added; checking GPIO15, too 2021-05-19 20:54:11 +02:00
c3ma
c7d98ef108 GPIO12 is evil 2021-05-16 22:24:14 +02:00
C3MA Werkstatt
3fffd41bcd Todos after building revision 2021-05-16 18:56:15 +02:00
C3MA Werkstatt
9af5a13e12 Nchannel is not Pchannel! 2021-05-16 18:18:11 +02:00
C3MA Werkstatt
758ae3ef57 Describe different buttons should be used 2021-05-16 17:49:12 +02:00
C3MA Werkstatt
04d7120adf Fix labels in pcb 2021-05-16 17:43:05 +02:00
Ollo
129b2b1478 Cleanup unused variables and code 2021-04-07 22:42:31 +02:00
Ollo
658bc7a389 Todos aufgerauemt 2021-04-07 22:21:58 +02:00
Ollo
0a1d755154 runtime optimization 2021-04-07 22:18:52 +02:00
Ollo
31229594fe One wire is initialized directly after start 2021-04-07 22:10:26 +02:00
Ollo
b8b8cf84d5 Reduce frequence of ESP32 to 80Mhz 2021-04-07 21:57:00 +02:00
Ollo
902c863873 Main logic introduced as seperate function. This is executed after MQTT is connected or a timeout occured 2021-04-07 21:54:53 +02:00
Ollo
47aba5387b Handle cooldown time for watering; add start and end time when pumping is allowed 2021-04-07 21:26:11 +02:00
Ollo
3932e82593 Address of tempsensors is published to MQTT 2021-04-07 20:27:42 +02:00
Ollo
dc5dc27ba5 Removed index to indentify temperatur sensors 2021-04-07 19:40:31 +02:00
Ollo
284fb4907d Renamed constants 2021-04-07 18:49:59 +02:00
Ollo
1eba578f20 Merge branch 'master' of github.com:0110/PlantCtrl 2020-11-11 22:16:30 +01:00
Ollo
060fa80efd read only once 2020-11-11 21:54:38 +01:00
104 changed files with 158158 additions and 16951 deletions

View File

@@ -12,15 +12,15 @@ Open hardware design (powered by KiCAD).
The complete PCB is stored in the ***board*** sub directory.
There the following components are connected:
* ESP32 NodeMCU Module (the one of A-Z Delivery was used)
* Lipo
* ESP32 **16MB flash required**
* Lipo monitoring (DS2438)
* 7 moist sensors
* 7 pump
* DC-DC convert (generating voltage from Lipo for pumps)
* DS18B20 temperature sensors
* water tank ultrasonic sensor (via JSN-SR04T-2.0)
* water level via laser distance sensor (VL53L0X)
* DS2438 battery monitor
* general purpose expansion pin
* general purpose expansion pins
# Software
The firmware for the controller is stored in ***esp32*** sub directory.

View File

@@ -0,0 +1,3 @@
EESchema-DOCLIB Version 2.0
#
#End Doc Library

11
board/PlantCtrlESP32.erc Normal file
View File

@@ -0,0 +1,11 @@
ERC report (Thu 10 Jun 2021 11:02:23 PM CEST, Encoding UTF8 )
***** Sheet /
ErrType(3): Pin connected to other pins, but not driven by any pin
@(476.25 mm, 236.22 mm): Pin 3 (Power input) of component U6 is not driven (Net 13).
ErrType(3): Pin connected to other pins, but not driven by any pin
@(71.12 mm, 154.94 mm): Pin 4 (Power input) of component U3 is not driven (Net 25).
ErrType(3): Pin connected to other pins, but not driven by any pin
@(558.80 mm, 274.32 mm): Pin 5 (Power input) of component U2 is not driven (Net 28).
** ERC messages: 3 Errors 0 Warnings 3

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,79 @@
{
"board": {
"active_layer": 0,
"active_layer_preset": "",
"auto_track_width": true,
"hidden_netclasses": [],
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"images": 0.6,
"pads": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 0.6
},
"ratsnest_display_mode": 0,
"selection_filter": {
"dimensions": true,
"footprints": true,
"graphics": true,
"keepouts": true,
"lockedItems": true,
"otherItems": true,
"pads": true,
"text": true,
"tracks": true,
"vias": true,
"zones": true
},
"visible_items": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
32,
33,
34,
35,
36
],
"visible_layers": "fffffff_ffffffff",
"zone_display_mode": 0
},
"meta": {
"filename": "PlantCtrlESP32.kicad_prl",
"version": 3
},
"project": {
"files": []
}
}

View File

@@ -0,0 +1,506 @@
{
"board": {
"3dviewports": [],
"design_settings": {
"defaults": {
"board_outline_line_width": 0.049999999999999996,
"copper_line_width": 0.19999999999999998,
"copper_text_italic": false,
"copper_text_size_h": 1.5,
"copper_text_size_v": 1.5,
"copper_text_thickness": 0.3,
"copper_text_upright": false,
"courtyard_line_width": 0.049999999999999996,
"dimension_precision": 4,
"dimension_units": 3,
"dimensions": {
"arrow_length": 1270000,
"extension_offset": 500000,
"keep_text_aligned": true,
"suppress_zeroes": false,
"text_position": 0,
"units_format": 1
},
"fab_line_width": 0.09999999999999999,
"fab_text_italic": false,
"fab_text_size_h": 1.0,
"fab_text_size_v": 1.0,
"fab_text_thickness": 0.15,
"fab_text_upright": false,
"other_line_width": 0.09999999999999999,
"other_text_italic": false,
"other_text_size_h": 1.0,
"other_text_size_v": 1.0,
"other_text_thickness": 0.15,
"other_text_upright": false,
"pads": {
"drill": 0.762,
"height": 1.524,
"width": 1.524
},
"silk_line_width": 0.12,
"silk_text_italic": false,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.15,
"silk_text_upright": false,
"zones": {
"45_degree_only": false,
"min_clearance": 0.508
}
},
"diff_pair_dimensions": [],
"drc_exclusions": [],
"meta": {
"filename": "board_design_settings.json",
"version": 2
},
"rule_severities": {
"annular_width": "error",
"clearance": "error",
"copper_edge_clearance": "error",
"courtyards_overlap": "error",
"diff_pair_gap_out_of_range": "error",
"diff_pair_uncoupled_length_too_long": "error",
"drill_out_of_range": "error",
"duplicate_footprints": "warning",
"extra_footprint": "warning",
"footprint_type_mismatch": "error",
"hole_clearance": "error",
"hole_near_hole": "error",
"invalid_outline": "error",
"item_on_disabled_layer": "error",
"items_not_allowed": "error",
"length_out_of_range": "error",
"malformed_courtyard": "error",
"microvia_drill_out_of_range": "error",
"missing_courtyard": "ignore",
"missing_footprint": "warning",
"net_conflict": "warning",
"npth_inside_courtyard": "ignore",
"padstack": "error",
"pth_inside_courtyard": "ignore",
"shorting_items": "error",
"silk_over_copper": "warning",
"silk_overlap": "warning",
"skew_out_of_range": "error",
"through_hole_pad_without_hole": "error",
"too_many_vias": "error",
"track_dangling": "warning",
"track_width": "error",
"tracks_crossing": "error",
"unconnected_items": "error",
"unresolved_variable": "error",
"via_dangling": "warning",
"zone_has_empty_net": "error",
"zones_intersect": "error"
},
"rule_severitieslegacy_courtyards_overlap": true,
"rule_severitieslegacy_no_courtyard_defined": false,
"rules": {
"allow_blind_buried_vias": false,
"allow_microvias": false,
"max_error": 0.005,
"min_clearance": 0.0,
"min_copper_edge_clearance": 0.024999999999999998,
"min_hole_clearance": 0.25,
"min_hole_to_hole": 0.25,
"min_microvia_diameter": 0.19999999999999998,
"min_microvia_drill": 0.09999999999999999,
"min_silk_clearance": 0.0,
"min_through_hole_diameter": 0.3,
"min_track_width": 0.19999999999999998,
"min_via_annular_width": 0.049999999999999996,
"min_via_diameter": 0.39999999999999997,
"use_height_for_length_calcs": true
},
"track_widths": [
0.0,
0.2,
0.5,
1.0
],
"via_dimensions": [
{
"diameter": 0.0,
"drill": 0.0
},
{
"diameter": 1.2,
"drill": 0.8
},
{
"diameter": 4.0,
"drill": 3.0
}
],
"zones_allow_external_fillets": false,
"zones_use_no_outline": true
},
"layer_presets": [],
"viewports": []
},
"boards": [],
"cvpcb": {
"equivalence_files": []
},
"erc": {
"erc_exclusions": [],
"meta": {
"version": 0
},
"pin_map": [
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
1,
0,
1,
2
],
[
0,
1,
0,
0,
0,
0,
1,
1,
2,
1,
1,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
],
[
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
2
],
[
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
1,
2,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
0,
2,
1,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
]
],
"rule_severities": {
"bus_definition_conflict": "error",
"bus_entry_needed": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"conflicting_netclasses": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"endpoint_off_grid": "warning",
"extra_units": "error",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "warning",
"missing_bidi_pin": "warning",
"missing_input_pin": "warning",
"missing_power_pin": "error",
"missing_unit": "warning",
"multiple_net_names": "warning",
"net_not_bus_member": "warning",
"no_connect_connected": "warning",
"no_connect_dangling": "warning",
"pin_not_connected": "error",
"pin_not_driven": "error",
"pin_to_pin": "warning",
"power_pin_not_driven": "error",
"similar_labels": "warning",
"simulation_model_issue": "ignore",
"unannotated": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "PlantCtrlESP32.kicad_pro",
"version": 1
},
"net_settings": {
"classes": [
{
"bus_width": 12,
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "Default",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 1.2,
"via_diameter": 0.8,
"via_drill": 0.4,
"wire_width": 6
},
{
"bus_width": 12,
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "5V",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 1.4,
"via_diameter": 0.8,
"via_drill": 0.4,
"wire_width": 6
},
{
"bus_width": 12,
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "Mini",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 1.0,
"via_diameter": 0.8,
"via_drill": 0.4,
"wire_width": 6
},
{
"bus_width": 12,
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "Power",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 1.7,
"via_diameter": 0.8,
"via_drill": 0.4,
"wire_width": 6
}
],
"meta": {
"version": 3
},
"net_colors": null,
"netclass_assignments": null,
"netclass_patterns": []
},
"pcbnew": {
"last_paths": {
"gencad": "",
"idf": "",
"netlist": "PlantCtrlESP32.net",
"specctra_dsn": "",
"step": "",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"annotate_start_num": 0,
"drawing": {
"dashed_lines_dash_length_ratio": 12.0,
"dashed_lines_gap_length_ratio": 3.0,
"default_line_thickness": 6.0,
"default_text_size": 50.0,
"field_names": [],
"intersheets_ref_own_page": false,
"intersheets_ref_prefix": "",
"intersheets_ref_short": false,
"intersheets_ref_show": false,
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.25,
"pin_symbol_size": 0.0,
"text_offset_ratio": 0.08
},
"legacy_lib_dir": "",
"legacy_lib_list": [],
"meta": {
"version": 1
},
"net_format_name": "Pcbnew",
"ngspice": {
"fix_include_paths": true,
"fix_passive_vals": false,
"meta": {
"version": 0
},
"model_mode": 0,
"workbook_filename": ""
},
"page_layout_descr_file": "",
"plot_directory": "/tmp/",
"spice_adjust_passive_values": false,
"spice_current_sheet_as_root": false,
"spice_external_command": "spice \"%I\"",
"spice_model_current_sheet_as_root": true,
"spice_save_all_currents": false,
"spice_save_all_voltages": false,
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [
[
"c26e8d55-0b6e-4c4e-b7c8-b1fed973201c",
""
]
],
"text_variables": {}
}

11677
board/PlantCtrlESP32.kicad_sch Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
update=Fri 27 Nov 2020 08:17:47 PM CET
update=Thu 10 Jun 2021 10:17:33 PM CEST
version=1
last_client=kicad
[general]
@@ -44,8 +44,10 @@ TrackWidth3=0.5
TrackWidth4=1
ViaDiameter1=0.8
ViaDrill1=0.4
ViaDiameter2=4
ViaDrill2=3
ViaDiameter2=1.2
ViaDrill2=0.8
ViaDiameter3=4
ViaDrill3=3
dPairWidth1=0.2
dPairGap1=0.25
dPairViaGap1=0.25

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Glue,Bot*
G04 #@! TF.FilePolarity,Positive*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*

View File

@@ -0,0 +1,32 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Other,User*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%ADD10C,0.050000*%
G04 APERTURE END LIST*
D10*
X237729200Y-51267800D02*
X237729200Y-60847800D01*
X237729200Y-51267800D02*
X242229200Y-51267800D01*
X242229200Y-60847800D02*
X237729200Y-60847800D01*
X242229200Y-60847800D02*
X242229200Y-51267800D01*
X231560800Y-64114800D02*
X223160800Y-64114800D01*
X231560800Y-57364800D02*
X231560800Y-64114800D01*
X223160800Y-57364800D02*
X231560800Y-57364800D01*
X223160800Y-64114800D02*
X223160800Y-57364800D01*
M02*

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,425 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Other,Fab,Bot*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%ADD10C,0.100000*%
%ADD11C,0.150000*%
G04 APERTURE END LIST*
D10*
X226110800Y-62614800D02*
X226735800Y-63614800D01*
X225485800Y-63614800D02*
X226110800Y-62614800D01*
X231060800Y-63614800D02*
X223660800Y-63614800D01*
X231060800Y-57864800D02*
X231060800Y-63614800D01*
X223660800Y-57864800D02*
X231060800Y-57864800D01*
X223660800Y-63614800D02*
X223660800Y-57864800D01*
D11*
X235812057Y-62843514D02*
X235764438Y-62891133D01*
X235716819Y-63033990D01*
X235716819Y-63129228D01*
X235764438Y-63272085D01*
X235859676Y-63367323D01*
X235954914Y-63414942D01*
X236145390Y-63462561D01*
X236288247Y-63462561D01*
X236478723Y-63414942D01*
X236573961Y-63367323D01*
X236669200Y-63272085D01*
X236716819Y-63129228D01*
X236716819Y-63033990D01*
X236669200Y-62891133D01*
X236621580Y-62843514D01*
X235716819Y-62272085D02*
X235764438Y-62367323D01*
X235812057Y-62414942D01*
X235907295Y-62462561D01*
X236193009Y-62462561D01*
X236288247Y-62414942D01*
X236335866Y-62367323D01*
X236383485Y-62272085D01*
X236383485Y-62129228D01*
X236335866Y-62033990D01*
X236288247Y-61986371D01*
X236193009Y-61938752D01*
X235907295Y-61938752D01*
X235812057Y-61986371D01*
X235764438Y-62033990D01*
X235716819Y-62129228D01*
X235716819Y-62272085D01*
X236383485Y-61510180D02*
X235716819Y-61510180D01*
X236288247Y-61510180D02*
X236335866Y-61462561D01*
X236383485Y-61367323D01*
X236383485Y-61224466D01*
X236335866Y-61129228D01*
X236240628Y-61081609D01*
X235716819Y-61081609D01*
X236383485Y-60605419D02*
X235716819Y-60605419D01*
X236288247Y-60605419D02*
X236335866Y-60557800D01*
X236383485Y-60462561D01*
X236383485Y-60319704D01*
X236335866Y-60224466D01*
X236240628Y-60176847D01*
X235716819Y-60176847D01*
X235621580Y-59938752D02*
X235621580Y-59176847D01*
X236716819Y-58748276D02*
X236716819Y-58653038D01*
X236669200Y-58557800D01*
X236621580Y-58510180D01*
X236526342Y-58462561D01*
X236335866Y-58414942D01*
X236097771Y-58414942D01*
X235907295Y-58462561D01*
X235812057Y-58510180D01*
X235764438Y-58557800D01*
X235716819Y-58653038D01*
X235716819Y-58748276D01*
X235764438Y-58843514D01*
X235812057Y-58891133D01*
X235907295Y-58938752D01*
X236097771Y-58986371D01*
X236335866Y-58986371D01*
X236526342Y-58938752D01*
X236621580Y-58891133D01*
X236669200Y-58843514D01*
X236716819Y-58748276D01*
X235716819Y-57462561D02*
X235716819Y-58033990D01*
X235716819Y-57748276D02*
X236716819Y-57748276D01*
X236573961Y-57843514D01*
X236478723Y-57938752D01*
X236431104Y-58033990D01*
X235716819Y-57129228D02*
X236383485Y-56605419D01*
X236383485Y-57129228D02*
X235716819Y-56605419D01*
X236716819Y-56033990D02*
X236716819Y-55938752D01*
X236669200Y-55843514D01*
X236621580Y-55795895D01*
X236526342Y-55748276D01*
X236335866Y-55700657D01*
X236097771Y-55700657D01*
X235907295Y-55748276D01*
X235812057Y-55795895D01*
X235764438Y-55843514D01*
X235716819Y-55938752D01*
X235716819Y-56033990D01*
X235764438Y-56129228D01*
X235812057Y-56176847D01*
X235907295Y-56224466D01*
X236097771Y-56272085D01*
X236335866Y-56272085D01*
X236526342Y-56224466D01*
X236621580Y-56176847D01*
X236669200Y-56129228D01*
X236716819Y-56033990D01*
X236621580Y-55319704D02*
X236669200Y-55272085D01*
X236716819Y-55176847D01*
X236716819Y-54938752D01*
X236669200Y-54843514D01*
X236621580Y-54795895D01*
X236526342Y-54748276D01*
X236431104Y-54748276D01*
X236288247Y-54795895D01*
X235716819Y-55367323D01*
X235716819Y-54748276D01*
X235621580Y-54557800D02*
X235621580Y-53795895D01*
X236240628Y-53224466D02*
X236240628Y-53557800D01*
X235716819Y-53557800D02*
X236716819Y-53557800D01*
X236716819Y-53081609D01*
X235764438Y-52319704D02*
X235716819Y-52414942D01*
X235716819Y-52605419D01*
X235764438Y-52700657D01*
X235859676Y-52748276D01*
X236240628Y-52748276D01*
X236335866Y-52700657D01*
X236383485Y-52605419D01*
X236383485Y-52414942D01*
X236335866Y-52319704D01*
X236240628Y-52272085D01*
X236145390Y-52272085D01*
X236050152Y-52748276D01*
X235716819Y-51843514D02*
X236383485Y-51843514D01*
X236288247Y-51843514D02*
X236335866Y-51795895D01*
X236383485Y-51700657D01*
X236383485Y-51557800D01*
X236335866Y-51462561D01*
X236240628Y-51414942D01*
X235716819Y-51414942D01*
X236240628Y-51414942D02*
X236335866Y-51367323D01*
X236383485Y-51272085D01*
X236383485Y-51129228D01*
X236335866Y-51033990D01*
X236240628Y-50986371D01*
X235716819Y-50986371D01*
X235716819Y-50081609D02*
X236240628Y-50081609D01*
X236335866Y-50129228D01*
X236383485Y-50224466D01*
X236383485Y-50414942D01*
X236335866Y-50510180D01*
X235764438Y-50081609D02*
X235716819Y-50176847D01*
X235716819Y-50414942D01*
X235764438Y-50510180D01*
X235859676Y-50557800D01*
X235954914Y-50557800D01*
X236050152Y-50510180D01*
X236097771Y-50414942D01*
X236097771Y-50176847D01*
X236145390Y-50081609D01*
X235716819Y-49462561D02*
X235764438Y-49557800D01*
X235859676Y-49605419D01*
X236716819Y-49605419D01*
X235764438Y-48700657D02*
X235716819Y-48795895D01*
X235716819Y-48986371D01*
X235764438Y-49081609D01*
X235859676Y-49129228D01*
X236240628Y-49129228D01*
X236335866Y-49081609D01*
X236383485Y-48986371D01*
X236383485Y-48795895D01*
X236335866Y-48700657D01*
X236240628Y-48653038D01*
X236145390Y-48653038D01*
X236050152Y-49129228D01*
X239526819Y-57486371D02*
X239526819Y-57962561D01*
X240526819Y-57962561D01*
X239526819Y-57153038D02*
X240526819Y-57153038D01*
X239526819Y-56676847D02*
X240526819Y-56676847D01*
X240526819Y-56295895D01*
X240479200Y-56200657D01*
X240431580Y-56153038D01*
X240336342Y-56105419D01*
X240193485Y-56105419D01*
X240098247Y-56153038D01*
X240050628Y-56200657D01*
X240003009Y-56295895D01*
X240003009Y-56676847D01*
X240526819Y-55486371D02*
X240526819Y-55295895D01*
X240479200Y-55200657D01*
X240383961Y-55105419D01*
X240193485Y-55057800D01*
X239860152Y-55057800D01*
X239669676Y-55105419D01*
X239574438Y-55200657D01*
X239526819Y-55295895D01*
X239526819Y-55486371D01*
X239574438Y-55581609D01*
X239669676Y-55676847D01*
X239860152Y-55724466D01*
X240193485Y-55724466D01*
X240383961Y-55676847D01*
X240479200Y-55581609D01*
X240526819Y-55486371D01*
X239526819Y-54105419D02*
X239526819Y-54676847D01*
X239526819Y-54391133D02*
X240526819Y-54391133D01*
X240383961Y-54486371D01*
X240288723Y-54581609D01*
X240241104Y-54676847D01*
X231098895Y-57021942D02*
X231146514Y-57069561D01*
X231289371Y-57117180D01*
X231384609Y-57117180D01*
X231527466Y-57069561D01*
X231622704Y-56974323D01*
X231670323Y-56879085D01*
X231717942Y-56688609D01*
X231717942Y-56545752D01*
X231670323Y-56355276D01*
X231622704Y-56260038D01*
X231527466Y-56164800D01*
X231384609Y-56117180D01*
X231289371Y-56117180D01*
X231146514Y-56164800D01*
X231098895Y-56212419D01*
X230527466Y-57117180D02*
X230622704Y-57069561D01*
X230670323Y-57021942D01*
X230717942Y-56926704D01*
X230717942Y-56640990D01*
X230670323Y-56545752D01*
X230622704Y-56498133D01*
X230527466Y-56450514D01*
X230384609Y-56450514D01*
X230289371Y-56498133D01*
X230241752Y-56545752D01*
X230194133Y-56640990D01*
X230194133Y-56926704D01*
X230241752Y-57021942D01*
X230289371Y-57069561D01*
X230384609Y-57117180D01*
X230527466Y-57117180D01*
X229765561Y-56450514D02*
X229765561Y-57117180D01*
X229765561Y-56545752D02*
X229717942Y-56498133D01*
X229622704Y-56450514D01*
X229479847Y-56450514D01*
X229384609Y-56498133D01*
X229336990Y-56593371D01*
X229336990Y-57117180D01*
X228860800Y-56450514D02*
X228860800Y-57117180D01*
X228860800Y-56545752D02*
X228813180Y-56498133D01*
X228717942Y-56450514D01*
X228575085Y-56450514D01*
X228479847Y-56498133D01*
X228432228Y-56593371D01*
X228432228Y-57117180D01*
X228194133Y-57212419D02*
X227432228Y-57212419D01*
X227003657Y-56117180D02*
X226908419Y-56117180D01*
X226813180Y-56164800D01*
X226765561Y-56212419D01*
X226717942Y-56307657D01*
X226670323Y-56498133D01*
X226670323Y-56736228D01*
X226717942Y-56926704D01*
X226765561Y-57021942D01*
X226813180Y-57069561D01*
X226908419Y-57117180D01*
X227003657Y-57117180D01*
X227098895Y-57069561D01*
X227146514Y-57021942D01*
X227194133Y-56926704D01*
X227241752Y-56736228D01*
X227241752Y-56498133D01*
X227194133Y-56307657D01*
X227146514Y-56212419D01*
X227098895Y-56164800D01*
X227003657Y-56117180D01*
X225717942Y-57117180D02*
X226289371Y-57117180D01*
X226003657Y-57117180D02*
X226003657Y-56117180D01*
X226098895Y-56260038D01*
X226194133Y-56355276D01*
X226289371Y-56402895D01*
X225384609Y-57117180D02*
X224860800Y-56450514D01*
X225384609Y-56450514D02*
X224860800Y-57117180D01*
X224289371Y-56117180D02*
X224194133Y-56117180D01*
X224098895Y-56164800D01*
X224051276Y-56212419D01*
X224003657Y-56307657D01*
X223956038Y-56498133D01*
X223956038Y-56736228D01*
X224003657Y-56926704D01*
X224051276Y-57021942D01*
X224098895Y-57069561D01*
X224194133Y-57117180D01*
X224289371Y-57117180D01*
X224384609Y-57069561D01*
X224432228Y-57021942D01*
X224479847Y-56926704D01*
X224527466Y-56736228D01*
X224527466Y-56498133D01*
X224479847Y-56307657D01*
X224432228Y-56212419D01*
X224384609Y-56164800D01*
X224289371Y-56117180D01*
X223575085Y-56212419D02*
X223527466Y-56164800D01*
X223432228Y-56117180D01*
X223194133Y-56117180D01*
X223098895Y-56164800D01*
X223051276Y-56212419D01*
X223003657Y-56307657D01*
X223003657Y-56402895D01*
X223051276Y-56545752D01*
X223622704Y-57117180D01*
X223003657Y-57117180D01*
X230860800Y-58493371D02*
X230527466Y-58493371D01*
X230384609Y-59017180D02*
X230860800Y-59017180D01*
X230860800Y-58017180D01*
X230384609Y-58017180D01*
X230051276Y-58017180D02*
X229384609Y-59017180D01*
X229384609Y-58017180D02*
X230051276Y-59017180D01*
X229146514Y-58017180D02*
X228575085Y-58017180D01*
X228860800Y-59017180D02*
X228860800Y-58017180D01*
X228479847Y-59112419D02*
X227717942Y-59112419D01*
X227479847Y-59017180D02*
X227479847Y-58017180D01*
X227098895Y-58017180D01*
X227003657Y-58064800D01*
X226956038Y-58112419D01*
X226908419Y-58207657D01*
X226908419Y-58350514D01*
X226956038Y-58445752D01*
X227003657Y-58493371D01*
X227098895Y-58540990D01*
X227479847Y-58540990D01*
X226575085Y-58017180D02*
X226336990Y-59017180D01*
X226146514Y-58302895D01*
X225956038Y-59017180D01*
X225717942Y-58017180D01*
X224765561Y-59017180D02*
X225098895Y-58540990D01*
X225336990Y-59017180D02*
X225336990Y-58017180D01*
X224956038Y-58017180D01*
X224860800Y-58064800D01*
X224813180Y-58112419D01*
X224765561Y-58207657D01*
X224765561Y-58350514D01*
X224813180Y-58445752D01*
X224860800Y-58493371D01*
X224956038Y-58540990D01*
X225336990Y-58540990D01*
X223813180Y-59017180D02*
X224384609Y-59017180D01*
X224098895Y-59017180D02*
X224098895Y-58017180D01*
X224194133Y-58160038D01*
X224289371Y-58255276D01*
X224384609Y-58302895D01*
M02*

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Paste,Bot*
G04 #@! TF.FilePolarity,Positive*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*

View File

@@ -0,0 +1,436 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Legend,Bot*
G04 #@! TF.FilePolarity,Positive*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%ADD10C,0.500000*%
%ADD11C,0.120000*%
%ADD12C,0.150000*%
G04 APERTURE END LIST*
D10*
X237963476Y-80549523D02*
X237963476Y-76549523D01*
X236439666Y-76549523D01*
X236058714Y-76740000D01*
X235868238Y-76930476D01*
X235677761Y-77311428D01*
X235677761Y-77882857D01*
X235868238Y-78263809D01*
X236058714Y-78454285D01*
X236439666Y-78644761D01*
X237963476Y-78644761D01*
X233392047Y-80549523D02*
X233773000Y-80359047D01*
X233963476Y-79978095D01*
X233963476Y-76549523D01*
X230153952Y-80549523D02*
X230153952Y-78454285D01*
X230344428Y-78073333D01*
X230725380Y-77882857D01*
X231487285Y-77882857D01*
X231868238Y-78073333D01*
X230153952Y-80359047D02*
X230534904Y-80549523D01*
X231487285Y-80549523D01*
X231868238Y-80359047D01*
X232058714Y-79978095D01*
X232058714Y-79597142D01*
X231868238Y-79216190D01*
X231487285Y-79025714D01*
X230534904Y-79025714D01*
X230153952Y-78835238D01*
X228249190Y-77882857D02*
X228249190Y-80549523D01*
X228249190Y-78263809D02*
X228058714Y-78073333D01*
X227677761Y-77882857D01*
X227106333Y-77882857D01*
X226725380Y-78073333D01*
X226534904Y-78454285D01*
X226534904Y-80549523D01*
X225201571Y-77882857D02*
X223677761Y-77882857D01*
X224630142Y-76549523D02*
X224630142Y-79978095D01*
X224439666Y-80359047D01*
X224058714Y-80549523D01*
X223677761Y-80549523D01*
X220058714Y-80168571D02*
X220249190Y-80359047D01*
X220820619Y-80549523D01*
X221201571Y-80549523D01*
X221773000Y-80359047D01*
X222153952Y-79978095D01*
X222344428Y-79597142D01*
X222534904Y-78835238D01*
X222534904Y-78263809D01*
X222344428Y-77501904D01*
X222153952Y-77120952D01*
X221773000Y-76740000D01*
X221201571Y-76549523D01*
X220820619Y-76549523D01*
X220249190Y-76740000D01*
X220058714Y-76930476D01*
X218915857Y-77882857D02*
X217392047Y-77882857D01*
X218344428Y-76549523D02*
X218344428Y-79978095D01*
X218153952Y-80359047D01*
X217773000Y-80549523D01*
X217392047Y-80549523D01*
X216058714Y-80549523D02*
X216058714Y-77882857D01*
X216058714Y-78644761D02*
X215868238Y-78263809D01*
X215677761Y-78073333D01*
X215296809Y-77882857D01*
X214915857Y-77882857D01*
X213011095Y-80549523D02*
X213392047Y-80359047D01*
X213582523Y-79978095D01*
X213582523Y-76549523D01*
X209011095Y-76549523D02*
X207677761Y-80549523D01*
X206344428Y-76549523D01*
X204249190Y-76549523D02*
X203868238Y-76549523D01*
X203487285Y-76740000D01*
X203296809Y-76930476D01*
X203106333Y-77311428D01*
X202915857Y-78073333D01*
X202915857Y-79025714D01*
X203106333Y-79787619D01*
X203296809Y-80168571D01*
X203487285Y-80359047D01*
X203868238Y-80549523D01*
X204249190Y-80549523D01*
X204630142Y-80359047D01*
X204820619Y-80168571D01*
X205011095Y-79787619D01*
X205201571Y-79025714D01*
X205201571Y-78073333D01*
X205011095Y-77311428D01*
X204820619Y-76930476D01*
X204630142Y-76740000D01*
X204249190Y-76549523D01*
X201201571Y-80168571D02*
X201011095Y-80359047D01*
X201201571Y-80549523D01*
X201392047Y-80359047D01*
X201201571Y-80168571D01*
X201201571Y-80549523D01*
X197201571Y-80549523D02*
X199487285Y-80549523D01*
X198344428Y-80549523D02*
X198344428Y-76549523D01*
X198725380Y-77120952D01*
X199106333Y-77501904D01*
X199487285Y-77692380D01*
X194725380Y-76549523D02*
X194344428Y-76549523D01*
X193963476Y-76740000D01*
X193773000Y-76930476D01*
X193582523Y-77311428D01*
X193392047Y-78073333D01*
X193392047Y-79025714D01*
X193582523Y-79787619D01*
X193773000Y-80168571D01*
X193963476Y-80359047D01*
X194344428Y-80549523D01*
X194725380Y-80549523D01*
X195106333Y-80359047D01*
X195296809Y-80168571D01*
X195487285Y-79787619D01*
X195677761Y-79025714D01*
X195677761Y-78073333D01*
X195487285Y-77311428D01*
X195296809Y-76930476D01*
X195106333Y-76740000D01*
X194725380Y-76549523D01*
D11*
X223260800Y-64014800D02*
X223260800Y-62764800D01*
X224510800Y-64014800D02*
X223260800Y-64014800D01*
X230410800Y-58514800D02*
X227360800Y-58514800D01*
X230410800Y-61464800D02*
X230410800Y-58514800D01*
X231160800Y-61464800D02*
X230410800Y-61464800D01*
X224310800Y-58514800D02*
X227360800Y-58514800D01*
X224310800Y-61464800D02*
X224310800Y-58514800D01*
X223560800Y-61464800D02*
X224310800Y-61464800D01*
X231160800Y-63714800D02*
X229360800Y-63714800D01*
X231160800Y-62964800D02*
X231160800Y-63714800D01*
X229360800Y-62964800D02*
X231160800Y-62964800D01*
X229360800Y-63714800D02*
X229360800Y-62964800D01*
X225360800Y-63714800D02*
X223560800Y-63714800D01*
X225360800Y-62964800D02*
X225360800Y-63714800D01*
X223560800Y-62964800D02*
X225360800Y-62964800D01*
X223560800Y-63714800D02*
X223560800Y-62964800D01*
X227860800Y-63714800D02*
X226860800Y-63714800D01*
X227860800Y-62964800D02*
X227860800Y-63714800D01*
X226860800Y-62964800D02*
X227860800Y-62964800D01*
X226860800Y-63714800D02*
X226860800Y-62964800D01*
X231170800Y-63724800D02*
X223550800Y-63724800D01*
X231170800Y-57754800D02*
X231170800Y-63724800D01*
X223550800Y-57754800D02*
X231170800Y-57754800D01*
X223550800Y-63724800D02*
X223550800Y-57754800D01*
D12*
X185356285Y-137866380D02*
X185689619Y-137390190D01*
X185927714Y-137866380D02*
X185927714Y-136866380D01*
X185546761Y-136866380D01*
X185451523Y-136914000D01*
X185403904Y-136961619D01*
X185356285Y-137056857D01*
X185356285Y-137199714D01*
X185403904Y-137294952D01*
X185451523Y-137342571D01*
X185546761Y-137390190D01*
X185927714Y-137390190D01*
X184546761Y-137818761D02*
X184642000Y-137866380D01*
X184832476Y-137866380D01*
X184927714Y-137818761D01*
X184975333Y-137723523D01*
X184975333Y-137342571D01*
X184927714Y-137247333D01*
X184832476Y-137199714D01*
X184642000Y-137199714D01*
X184546761Y-137247333D01*
X184499142Y-137342571D01*
X184499142Y-137437809D01*
X184975333Y-137533047D01*
X184118190Y-137818761D02*
X184022952Y-137866380D01*
X183832476Y-137866380D01*
X183737238Y-137818761D01*
X183689619Y-137723523D01*
X183689619Y-137675904D01*
X183737238Y-137580666D01*
X183832476Y-137533047D01*
X183975333Y-137533047D01*
X184070571Y-137485428D01*
X184118190Y-137390190D01*
X184118190Y-137342571D01*
X184070571Y-137247333D01*
X183975333Y-137199714D01*
X183832476Y-137199714D01*
X183737238Y-137247333D01*
X182880095Y-137818761D02*
X182975333Y-137866380D01*
X183165809Y-137866380D01*
X183261047Y-137818761D01*
X183308666Y-137723523D01*
X183308666Y-137342571D01*
X183261047Y-137247333D01*
X183165809Y-137199714D01*
X182975333Y-137199714D01*
X182880095Y-137247333D01*
X182832476Y-137342571D01*
X182832476Y-137437809D01*
X183308666Y-137533047D01*
X182546761Y-137199714D02*
X182165809Y-137199714D01*
X182403904Y-136866380D02*
X182403904Y-137723523D01*
X182356285Y-137818761D01*
X182261047Y-137866380D01*
X182165809Y-137866380D01*
X181308666Y-137866380D02*
X181880095Y-137866380D01*
X181594380Y-137866380D02*
X181594380Y-136866380D01*
X181689619Y-137009238D01*
X181784857Y-137104476D01*
X181880095Y-137152095D01*
X197683238Y-137596571D02*
X197540380Y-137644190D01*
X197492761Y-137691809D01*
X197445142Y-137787047D01*
X197445142Y-137929904D01*
X197492761Y-138025142D01*
X197540380Y-138072761D01*
X197635619Y-138120380D01*
X198016571Y-138120380D01*
X198016571Y-137120380D01*
X197683238Y-137120380D01*
X197588000Y-137168000D01*
X197540380Y-137215619D01*
X197492761Y-137310857D01*
X197492761Y-137406095D01*
X197540380Y-137501333D01*
X197588000Y-137548952D01*
X197683238Y-137596571D01*
X198016571Y-137596571D01*
X196873714Y-138120380D02*
X196968952Y-138072761D01*
X197016571Y-138025142D01*
X197064190Y-137929904D01*
X197064190Y-137644190D01*
X197016571Y-137548952D01*
X196968952Y-137501333D01*
X196873714Y-137453714D01*
X196730857Y-137453714D01*
X196635619Y-137501333D01*
X196588000Y-137548952D01*
X196540380Y-137644190D01*
X196540380Y-137929904D01*
X196588000Y-138025142D01*
X196635619Y-138072761D01*
X196730857Y-138120380D01*
X196873714Y-138120380D01*
X195968952Y-138120380D02*
X196064190Y-138072761D01*
X196111809Y-138025142D01*
X196159428Y-137929904D01*
X196159428Y-137644190D01*
X196111809Y-137548952D01*
X196064190Y-137501333D01*
X195968952Y-137453714D01*
X195826095Y-137453714D01*
X195730857Y-137501333D01*
X195683238Y-137548952D01*
X195635619Y-137644190D01*
X195635619Y-137929904D01*
X195683238Y-138025142D01*
X195730857Y-138072761D01*
X195826095Y-138120380D01*
X195968952Y-138120380D01*
X195349904Y-137453714D02*
X194968952Y-137453714D01*
X195207047Y-137120380D02*
X195207047Y-137977523D01*
X195159428Y-138072761D01*
X195064190Y-138120380D01*
X194968952Y-138120380D01*
X194111809Y-138120380D02*
X194683238Y-138120380D01*
X194397523Y-138120380D02*
X194397523Y-137120380D01*
X194492761Y-137263238D01*
X194588000Y-137358476D01*
X194683238Y-137406095D01*
X243336819Y-57486371D02*
X243336819Y-57962561D01*
X244336819Y-57962561D01*
X243336819Y-57153038D02*
X244336819Y-57153038D01*
X243336819Y-56676847D02*
X244336819Y-56676847D01*
X244336819Y-56295895D01*
X244289200Y-56200657D01*
X244241580Y-56153038D01*
X244146342Y-56105419D01*
X244003485Y-56105419D01*
X243908247Y-56153038D01*
X243860628Y-56200657D01*
X243813009Y-56295895D01*
X243813009Y-56676847D01*
X244336819Y-55486371D02*
X244336819Y-55295895D01*
X244289200Y-55200657D01*
X244193961Y-55105419D01*
X244003485Y-55057800D01*
X243670152Y-55057800D01*
X243479676Y-55105419D01*
X243384438Y-55200657D01*
X243336819Y-55295895D01*
X243336819Y-55486371D01*
X243384438Y-55581609D01*
X243479676Y-55676847D01*
X243670152Y-55724466D01*
X244003485Y-55724466D01*
X244193961Y-55676847D01*
X244289200Y-55581609D01*
X244336819Y-55486371D01*
X243336819Y-54105419D02*
X243336819Y-54676847D01*
X243336819Y-54391133D02*
X244336819Y-54391133D01*
X244193961Y-54486371D01*
X244098723Y-54581609D01*
X244051104Y-54676847D01*
X230860800Y-64743371D02*
X230527466Y-64743371D01*
X230384609Y-65267180D02*
X230860800Y-65267180D01*
X230860800Y-64267180D01*
X230384609Y-64267180D01*
X230051276Y-64267180D02*
X229384609Y-65267180D01*
X229384609Y-64267180D02*
X230051276Y-65267180D01*
X229146514Y-64267180D02*
X228575085Y-64267180D01*
X228860800Y-65267180D02*
X228860800Y-64267180D01*
X228479847Y-65362419D02*
X227717942Y-65362419D01*
X227479847Y-65267180D02*
X227479847Y-64267180D01*
X227098895Y-64267180D01*
X227003657Y-64314800D01*
X226956038Y-64362419D01*
X226908419Y-64457657D01*
X226908419Y-64600514D01*
X226956038Y-64695752D01*
X227003657Y-64743371D01*
X227098895Y-64790990D01*
X227479847Y-64790990D01*
X226575085Y-64267180D02*
X226336990Y-65267180D01*
X226146514Y-64552895D01*
X225956038Y-65267180D01*
X225717942Y-64267180D01*
X224765561Y-65267180D02*
X225098895Y-64790990D01*
X225336990Y-65267180D02*
X225336990Y-64267180D01*
X224956038Y-64267180D01*
X224860800Y-64314800D01*
X224813180Y-64362419D01*
X224765561Y-64457657D01*
X224765561Y-64600514D01*
X224813180Y-64695752D01*
X224860800Y-64743371D01*
X224956038Y-64790990D01*
X225336990Y-64790990D01*
X223813180Y-65267180D02*
X224384609Y-65267180D01*
X224098895Y-65267180D02*
X224098895Y-64267180D01*
X224194133Y-64410038D01*
X224289371Y-64505276D01*
X224384609Y-64552895D01*
M02*

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,748 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,OtherDrawing,Comment*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%ADD10C,0.100000*%
%ADD11C,0.150000*%
G04 APERTURE END LIST*
D10*
X169862000Y-119918000D02*
X159082000Y-119918000D01*
X169862000Y-91918000D02*
X169862000Y-119918000D01*
X169862000Y-91918000D02*
X159082000Y-91918000D01*
X159082000Y-91918000D02*
X159082000Y-119918000D01*
X159082000Y-118443000D02*
X160172000Y-119918000D01*
X159082000Y-116443000D02*
X161787000Y-119918000D01*
X159082000Y-114443000D02*
X163402000Y-119918000D01*
X159082000Y-112443000D02*
X165017000Y-119918000D01*
X159082000Y-110443000D02*
X166632000Y-119918000D01*
X159082000Y-108443000D02*
X168247000Y-119918000D01*
X159082000Y-106443000D02*
X169862000Y-119918000D01*
X159082000Y-104443000D02*
X169862000Y-117918000D01*
X159082000Y-102443000D02*
X169862000Y-115918000D01*
X169862000Y-113918000D02*
X159082000Y-100443000D01*
X159082000Y-98443000D02*
X169862000Y-111918000D01*
X159082000Y-96443000D02*
X169862000Y-109918000D01*
X159082000Y-94443000D02*
X169862000Y-107918000D01*
X159082000Y-92443000D02*
X169862000Y-105918000D01*
X160172000Y-91918000D02*
X169862000Y-103918000D01*
X161787000Y-91918000D02*
X169862000Y-101918000D01*
X163402000Y-91918000D02*
X169862000Y-99918000D01*
X165017000Y-91918000D02*
X169862000Y-97918000D01*
X166632000Y-91918000D02*
X169862000Y-95918000D01*
X168247000Y-91918000D02*
X169862000Y-93918000D01*
D11*
X260475480Y-68863421D02*
X260475480Y-68768183D01*
X260523100Y-68672945D01*
X260570719Y-68625326D01*
X260665957Y-68577707D01*
X260856433Y-68530088D01*
X261094528Y-68530088D01*
X261285004Y-68577707D01*
X261380242Y-68625326D01*
X261427861Y-68672945D01*
X261475480Y-68768183D01*
X261475480Y-68863421D01*
X261427861Y-68958659D01*
X261380242Y-69006278D01*
X261285004Y-69053897D01*
X261094528Y-69101516D01*
X260856433Y-69101516D01*
X260665957Y-69053897D01*
X260570719Y-69006278D01*
X260523100Y-68958659D01*
X260475480Y-68863421D01*
X261380242Y-68101516D02*
X261427861Y-68053897D01*
X261475480Y-68101516D01*
X261427861Y-68149135D01*
X261380242Y-68101516D01*
X261475480Y-68101516D01*
X260475480Y-67434850D02*
X260475480Y-67339611D01*
X260523100Y-67244373D01*
X260570719Y-67196754D01*
X260665957Y-67149135D01*
X260856433Y-67101516D01*
X261094528Y-67101516D01*
X261285004Y-67149135D01*
X261380242Y-67196754D01*
X261427861Y-67244373D01*
X261475480Y-67339611D01*
X261475480Y-67434850D01*
X261427861Y-67530088D01*
X261380242Y-67577707D01*
X261285004Y-67625326D01*
X261094528Y-67672945D01*
X260856433Y-67672945D01*
X260665957Y-67625326D01*
X260570719Y-67577707D01*
X260523100Y-67530088D01*
X260475480Y-67434850D01*
X260475480Y-66196754D02*
X260475480Y-66672945D01*
X260951671Y-66720564D01*
X260904052Y-66672945D01*
X260856433Y-66577707D01*
X260856433Y-66339611D01*
X260904052Y-66244373D01*
X260951671Y-66196754D01*
X261046909Y-66149135D01*
X261285004Y-66149135D01*
X261380242Y-66196754D01*
X261427861Y-66244373D01*
X261475480Y-66339611D01*
X261475480Y-66577707D01*
X261427861Y-66672945D01*
X261380242Y-66720564D01*
X260904052Y-65577707D02*
X260856433Y-65672945D01*
X260808814Y-65720564D01*
X260713576Y-65768183D01*
X260665957Y-65768183D01*
X260570719Y-65720564D01*
X260523100Y-65672945D01*
X260475480Y-65577707D01*
X260475480Y-65387230D01*
X260523100Y-65291992D01*
X260570719Y-65244373D01*
X260665957Y-65196754D01*
X260713576Y-65196754D01*
X260808814Y-65244373D01*
X260856433Y-65291992D01*
X260904052Y-65387230D01*
X260904052Y-65577707D01*
X260951671Y-65672945D01*
X260999290Y-65720564D01*
X261094528Y-65768183D01*
X261285004Y-65768183D01*
X261380242Y-65720564D01*
X261427861Y-65672945D01*
X261475480Y-65577707D01*
X261475480Y-65387230D01*
X261427861Y-65291992D01*
X261380242Y-65244373D01*
X261285004Y-65196754D01*
X261094528Y-65196754D01*
X260999290Y-65244373D01*
X260951671Y-65291992D01*
X260904052Y-65387230D01*
X261475480Y-64768183D02*
X260808814Y-64768183D01*
X260475480Y-64768183D02*
X260523100Y-64815802D01*
X260570719Y-64768183D01*
X260523100Y-64720564D01*
X260475480Y-64768183D01*
X260570719Y-64768183D01*
X260808814Y-64291992D02*
X261475480Y-64291992D01*
X260904052Y-64291992D02*
X260856433Y-64244373D01*
X260808814Y-64149135D01*
X260808814Y-64006278D01*
X260856433Y-63911040D01*
X260951671Y-63863421D01*
X261475480Y-63863421D01*
X260427861Y-62672945D02*
X261713576Y-63530088D01*
X261475480Y-61815802D02*
X261475480Y-62387230D01*
X261475480Y-62101516D02*
X260475480Y-62101516D01*
X260618338Y-62196754D01*
X260713576Y-62291992D01*
X260761195Y-62387230D01*
X261380242Y-61387230D02*
X261427861Y-61339611D01*
X261475480Y-61387230D01*
X261427861Y-61434850D01*
X261380242Y-61387230D01*
X261475480Y-61387230D01*
X260808814Y-60482469D02*
X261475480Y-60482469D01*
X260427861Y-60720564D02*
X261142147Y-60958659D01*
X261142147Y-60339611D01*
X260475480Y-59530088D02*
X260475480Y-59720564D01*
X260523100Y-59815802D01*
X260570719Y-59863421D01*
X260713576Y-59958659D01*
X260904052Y-60006278D01*
X261285004Y-60006278D01*
X261380242Y-59958659D01*
X261427861Y-59911040D01*
X261475480Y-59815802D01*
X261475480Y-59625326D01*
X261427861Y-59530088D01*
X261380242Y-59482469D01*
X261285004Y-59434850D01*
X261046909Y-59434850D01*
X260951671Y-59482469D01*
X260904052Y-59530088D01*
X260856433Y-59625326D01*
X260856433Y-59815802D01*
X260904052Y-59911040D01*
X260951671Y-59958659D01*
X261046909Y-60006278D01*
X261475480Y-59006278D02*
X260808814Y-59006278D01*
X260904052Y-59006278D02*
X260856433Y-58958659D01*
X260808814Y-58863421D01*
X260808814Y-58720564D01*
X260856433Y-58625326D01*
X260951671Y-58577707D01*
X261475480Y-58577707D01*
X260951671Y-58577707D02*
X260856433Y-58530088D01*
X260808814Y-58434850D01*
X260808814Y-58291992D01*
X260856433Y-58196754D01*
X260951671Y-58149135D01*
X261475480Y-58149135D01*
X261475480Y-57672945D02*
X260808814Y-57672945D01*
X260904052Y-57672945D02*
X260856433Y-57625326D01*
X260808814Y-57530088D01*
X260808814Y-57387230D01*
X260856433Y-57291992D01*
X260951671Y-57244373D01*
X261475480Y-57244373D01*
X260951671Y-57244373D02*
X260856433Y-57196754D01*
X260808814Y-57101516D01*
X260808814Y-56958659D01*
X260856433Y-56863421D01*
X260951671Y-56815802D01*
X261475480Y-56815802D01*
X270305280Y-72063761D02*
X270305280Y-71968523D01*
X270352900Y-71873285D01*
X270400519Y-71825666D01*
X270495757Y-71778047D01*
X270686233Y-71730428D01*
X270924328Y-71730428D01*
X271114804Y-71778047D01*
X271210042Y-71825666D01*
X271257661Y-71873285D01*
X271305280Y-71968523D01*
X271305280Y-72063761D01*
X271257661Y-72159000D01*
X271210042Y-72206619D01*
X271114804Y-72254238D01*
X270924328Y-72301857D01*
X270686233Y-72301857D01*
X270495757Y-72254238D01*
X270400519Y-72206619D01*
X270352900Y-72159000D01*
X270305280Y-72063761D01*
X271210042Y-71301857D02*
X271257661Y-71254238D01*
X271305280Y-71301857D01*
X271257661Y-71349476D01*
X271210042Y-71301857D01*
X271305280Y-71301857D01*
X270400519Y-70873285D02*
X270352900Y-70825666D01*
X270305280Y-70730428D01*
X270305280Y-70492333D01*
X270352900Y-70397095D01*
X270400519Y-70349476D01*
X270495757Y-70301857D01*
X270590995Y-70301857D01*
X270733852Y-70349476D01*
X271305280Y-70920904D01*
X271305280Y-70301857D01*
X271305280Y-69349476D02*
X271305280Y-69920904D01*
X271305280Y-69635190D02*
X270305280Y-69635190D01*
X270448138Y-69730428D01*
X270543376Y-69825666D01*
X270590995Y-69920904D01*
X270638614Y-68492333D02*
X271305280Y-68492333D01*
X270257661Y-68730428D02*
X270971947Y-68968523D01*
X270971947Y-68349476D01*
X271305280Y-67968523D02*
X270638614Y-67968523D01*
X270305280Y-67968523D02*
X270352900Y-68016142D01*
X270400519Y-67968523D01*
X270352900Y-67920904D01*
X270305280Y-67968523D01*
X270400519Y-67968523D01*
X270638614Y-67492333D02*
X271305280Y-67492333D01*
X270733852Y-67492333D02*
X270686233Y-67444714D01*
X270638614Y-67349476D01*
X270638614Y-67206619D01*
X270686233Y-67111380D01*
X270781471Y-67063761D01*
X271305280Y-67063761D01*
X270257661Y-65873285D02*
X271543376Y-66730428D01*
X270305280Y-65063761D02*
X270305280Y-65539952D01*
X270781471Y-65587571D01*
X270733852Y-65539952D01*
X270686233Y-65444714D01*
X270686233Y-65206619D01*
X270733852Y-65111380D01*
X270781471Y-65063761D01*
X270876709Y-65016142D01*
X271114804Y-65016142D01*
X271210042Y-65063761D01*
X271257661Y-65111380D01*
X271305280Y-65206619D01*
X271305280Y-65444714D01*
X271257661Y-65539952D01*
X271210042Y-65587571D01*
X271210042Y-64587571D02*
X271257661Y-64539952D01*
X271305280Y-64587571D01*
X271257661Y-64635190D01*
X271210042Y-64587571D01*
X271305280Y-64587571D01*
X270638614Y-63682809D02*
X271305280Y-63682809D01*
X270257661Y-63920904D02*
X270971947Y-64159000D01*
X270971947Y-63539952D01*
X270638614Y-62730428D02*
X271305280Y-62730428D01*
X270257661Y-62968523D02*
X270971947Y-63206619D01*
X270971947Y-62587571D01*
X270733852Y-62063761D02*
X270686233Y-62159000D01*
X270638614Y-62206619D01*
X270543376Y-62254238D01*
X270495757Y-62254238D01*
X270400519Y-62206619D01*
X270352900Y-62159000D01*
X270305280Y-62063761D01*
X270305280Y-61873285D01*
X270352900Y-61778047D01*
X270400519Y-61730428D01*
X270495757Y-61682809D01*
X270543376Y-61682809D01*
X270638614Y-61730428D01*
X270686233Y-61778047D01*
X270733852Y-61873285D01*
X270733852Y-62063761D01*
X270781471Y-62159000D01*
X270829090Y-62206619D01*
X270924328Y-62254238D01*
X271114804Y-62254238D01*
X271210042Y-62206619D01*
X271257661Y-62159000D01*
X271305280Y-62063761D01*
X271305280Y-61873285D01*
X271257661Y-61778047D01*
X271210042Y-61730428D01*
X271114804Y-61682809D01*
X270924328Y-61682809D01*
X270829090Y-61730428D01*
X270781471Y-61778047D01*
X270733852Y-61873285D01*
X271305280Y-61254238D02*
X270638614Y-61254238D01*
X270733852Y-61254238D02*
X270686233Y-61206619D01*
X270638614Y-61111380D01*
X270638614Y-60968523D01*
X270686233Y-60873285D01*
X270781471Y-60825666D01*
X271305280Y-60825666D01*
X270781471Y-60825666D02*
X270686233Y-60778047D01*
X270638614Y-60682809D01*
X270638614Y-60539952D01*
X270686233Y-60444714D01*
X270781471Y-60397095D01*
X271305280Y-60397095D01*
X271305280Y-59920904D02*
X270638614Y-59920904D01*
X270733852Y-59920904D02*
X270686233Y-59873285D01*
X270638614Y-59778047D01*
X270638614Y-59635190D01*
X270686233Y-59539952D01*
X270781471Y-59492333D01*
X271305280Y-59492333D01*
X270781471Y-59492333D02*
X270686233Y-59444714D01*
X270638614Y-59349476D01*
X270638614Y-59206619D01*
X270686233Y-59111380D01*
X270781471Y-59063761D01*
X271305280Y-59063761D01*
X267295380Y-77835911D02*
X267295380Y-77740673D01*
X267343000Y-77645435D01*
X267390619Y-77597816D01*
X267485857Y-77550197D01*
X267676333Y-77502578D01*
X267914428Y-77502578D01*
X268104904Y-77550197D01*
X268200142Y-77597816D01*
X268247761Y-77645435D01*
X268295380Y-77740673D01*
X268295380Y-77835911D01*
X268247761Y-77931150D01*
X268200142Y-77978769D01*
X268104904Y-78026388D01*
X267914428Y-78074007D01*
X267676333Y-78074007D01*
X267485857Y-78026388D01*
X267390619Y-77978769D01*
X267343000Y-77931150D01*
X267295380Y-77835911D01*
X268200142Y-77074007D02*
X268247761Y-77026388D01*
X268295380Y-77074007D01*
X268247761Y-77121626D01*
X268200142Y-77074007D01*
X268295380Y-77074007D01*
X267295380Y-76407340D02*
X267295380Y-76312102D01*
X267343000Y-76216864D01*
X267390619Y-76169245D01*
X267485857Y-76121626D01*
X267676333Y-76074007D01*
X267914428Y-76074007D01*
X268104904Y-76121626D01*
X268200142Y-76169245D01*
X268247761Y-76216864D01*
X268295380Y-76312102D01*
X268295380Y-76407340D01*
X268247761Y-76502578D01*
X268200142Y-76550197D01*
X268104904Y-76597816D01*
X267914428Y-76645435D01*
X267676333Y-76645435D01*
X267485857Y-76597816D01*
X267390619Y-76550197D01*
X267343000Y-76502578D01*
X267295380Y-76407340D01*
X267390619Y-75693054D02*
X267343000Y-75645435D01*
X267295380Y-75550197D01*
X267295380Y-75312102D01*
X267343000Y-75216864D01*
X267390619Y-75169245D01*
X267485857Y-75121626D01*
X267581095Y-75121626D01*
X267723952Y-75169245D01*
X268295380Y-75740673D01*
X268295380Y-75121626D01*
X268295380Y-74169245D02*
X268295380Y-74740673D01*
X268295380Y-74454959D02*
X267295380Y-74454959D01*
X267438238Y-74550197D01*
X267533476Y-74645435D01*
X267581095Y-74740673D01*
X268295380Y-73740673D02*
X267628714Y-73740673D01*
X267295380Y-73740673D02*
X267343000Y-73788292D01*
X267390619Y-73740673D01*
X267343000Y-73693054D01*
X267295380Y-73740673D01*
X267390619Y-73740673D01*
X267628714Y-73264483D02*
X268295380Y-73264483D01*
X267723952Y-73264483D02*
X267676333Y-73216864D01*
X267628714Y-73121626D01*
X267628714Y-72978769D01*
X267676333Y-72883530D01*
X267771571Y-72835911D01*
X268295380Y-72835911D01*
X267247761Y-71645435D02*
X268533476Y-72502578D01*
X267295380Y-71121626D02*
X267295380Y-71026388D01*
X267343000Y-70931150D01*
X267390619Y-70883530D01*
X267485857Y-70835911D01*
X267676333Y-70788292D01*
X267914428Y-70788292D01*
X268104904Y-70835911D01*
X268200142Y-70883530D01*
X268247761Y-70931150D01*
X268295380Y-71026388D01*
X268295380Y-71121626D01*
X268247761Y-71216864D01*
X268200142Y-71264483D01*
X268104904Y-71312102D01*
X267914428Y-71359721D01*
X267676333Y-71359721D01*
X267485857Y-71312102D01*
X267390619Y-71264483D01*
X267343000Y-71216864D01*
X267295380Y-71121626D01*
X268200142Y-70359721D02*
X268247761Y-70312102D01*
X268295380Y-70359721D01*
X268247761Y-70407340D01*
X268200142Y-70359721D01*
X268295380Y-70359721D01*
X267295380Y-69407340D02*
X267295380Y-69883530D01*
X267771571Y-69931150D01*
X267723952Y-69883530D01*
X267676333Y-69788292D01*
X267676333Y-69550197D01*
X267723952Y-69454959D01*
X267771571Y-69407340D01*
X267866809Y-69359721D01*
X268104904Y-69359721D01*
X268200142Y-69407340D01*
X268247761Y-69454959D01*
X268295380Y-69550197D01*
X268295380Y-69788292D01*
X268247761Y-69883530D01*
X268200142Y-69931150D01*
X267295380Y-69026388D02*
X267295380Y-68407340D01*
X267676333Y-68740673D01*
X267676333Y-68597816D01*
X267723952Y-68502578D01*
X267771571Y-68454959D01*
X267866809Y-68407340D01*
X268104904Y-68407340D01*
X268200142Y-68454959D01*
X268247761Y-68502578D01*
X268295380Y-68597816D01*
X268295380Y-68883530D01*
X268247761Y-68978769D01*
X268200142Y-69026388D01*
X267295380Y-68074007D02*
X267295380Y-67454959D01*
X267676333Y-67788292D01*
X267676333Y-67645435D01*
X267723952Y-67550197D01*
X267771571Y-67502578D01*
X267866809Y-67454959D01*
X268104904Y-67454959D01*
X268200142Y-67502578D01*
X268247761Y-67550197D01*
X268295380Y-67645435D01*
X268295380Y-67931150D01*
X268247761Y-68026388D01*
X268200142Y-68074007D01*
X268295380Y-67026388D02*
X267628714Y-67026388D01*
X267723952Y-67026388D02*
X267676333Y-66978769D01*
X267628714Y-66883530D01*
X267628714Y-66740673D01*
X267676333Y-66645435D01*
X267771571Y-66597816D01*
X268295380Y-66597816D01*
X267771571Y-66597816D02*
X267676333Y-66550197D01*
X267628714Y-66454959D01*
X267628714Y-66312102D01*
X267676333Y-66216864D01*
X267771571Y-66169245D01*
X268295380Y-66169245D01*
X268295380Y-65693054D02*
X267628714Y-65693054D01*
X267723952Y-65693054D02*
X267676333Y-65645435D01*
X267628714Y-65550197D01*
X267628714Y-65407340D01*
X267676333Y-65312102D01*
X267771571Y-65264483D01*
X268295380Y-65264483D01*
X267771571Y-65264483D02*
X267676333Y-65216864D01*
X267628714Y-65121626D01*
X267628714Y-64978769D01*
X267676333Y-64883530D01*
X267771571Y-64835911D01*
X268295380Y-64835911D01*
X266660380Y-65339230D02*
X266660380Y-65243992D01*
X266708000Y-65148754D01*
X266755619Y-65101135D01*
X266850857Y-65053516D01*
X267041333Y-65005897D01*
X267279428Y-65005897D01*
X267469904Y-65053516D01*
X267565142Y-65101135D01*
X267612761Y-65148754D01*
X267660380Y-65243992D01*
X267660380Y-65339230D01*
X267612761Y-65434469D01*
X267565142Y-65482088D01*
X267469904Y-65529707D01*
X267279428Y-65577326D01*
X267041333Y-65577326D01*
X266850857Y-65529707D01*
X266755619Y-65482088D01*
X266708000Y-65434469D01*
X266660380Y-65339230D01*
X267565142Y-64577326D02*
X267612761Y-64529707D01*
X267660380Y-64577326D01*
X267612761Y-64624945D01*
X267565142Y-64577326D01*
X267660380Y-64577326D01*
X266660380Y-63910659D02*
X266660380Y-63815421D01*
X266708000Y-63720183D01*
X266755619Y-63672564D01*
X266850857Y-63624945D01*
X267041333Y-63577326D01*
X267279428Y-63577326D01*
X267469904Y-63624945D01*
X267565142Y-63672564D01*
X267612761Y-63720183D01*
X267660380Y-63815421D01*
X267660380Y-63910659D01*
X267612761Y-64005897D01*
X267565142Y-64053516D01*
X267469904Y-64101135D01*
X267279428Y-64148754D01*
X267041333Y-64148754D01*
X266850857Y-64101135D01*
X266755619Y-64053516D01*
X266708000Y-64005897D01*
X266660380Y-63910659D01*
X266660380Y-62672564D02*
X266660380Y-63148754D01*
X267136571Y-63196373D01*
X267088952Y-63148754D01*
X267041333Y-63053516D01*
X267041333Y-62815421D01*
X267088952Y-62720183D01*
X267136571Y-62672564D01*
X267231809Y-62624945D01*
X267469904Y-62624945D01*
X267565142Y-62672564D01*
X267612761Y-62720183D01*
X267660380Y-62815421D01*
X267660380Y-63053516D01*
X267612761Y-63148754D01*
X267565142Y-63196373D01*
X267660380Y-62196373D02*
X266993714Y-62196373D01*
X266660380Y-62196373D02*
X266708000Y-62243992D01*
X266755619Y-62196373D01*
X266708000Y-62148754D01*
X266660380Y-62196373D01*
X266755619Y-62196373D01*
X266993714Y-61720183D02*
X267660380Y-61720183D01*
X267088952Y-61720183D02*
X267041333Y-61672564D01*
X266993714Y-61577326D01*
X266993714Y-61434469D01*
X267041333Y-61339230D01*
X267136571Y-61291611D01*
X267660380Y-61291611D01*
X266612761Y-60101135D02*
X267898476Y-60958278D01*
X267660380Y-59243992D02*
X267660380Y-59815421D01*
X267660380Y-59529707D02*
X266660380Y-59529707D01*
X266803238Y-59624945D01*
X266898476Y-59720183D01*
X266946095Y-59815421D01*
X267565142Y-58815421D02*
X267612761Y-58767802D01*
X267660380Y-58815421D01*
X267612761Y-58863040D01*
X267565142Y-58815421D01*
X267660380Y-58815421D01*
X266755619Y-58386850D02*
X266708000Y-58339230D01*
X266660380Y-58243992D01*
X266660380Y-58005897D01*
X266708000Y-57910659D01*
X266755619Y-57863040D01*
X266850857Y-57815421D01*
X266946095Y-57815421D01*
X267088952Y-57863040D01*
X267660380Y-58434469D01*
X267660380Y-57815421D01*
X266660380Y-57482088D02*
X266660380Y-56815421D01*
X267660380Y-57243992D01*
X267660380Y-56434469D02*
X266993714Y-56434469D01*
X267088952Y-56434469D02*
X267041333Y-56386850D01*
X266993714Y-56291611D01*
X266993714Y-56148754D01*
X267041333Y-56053516D01*
X267136571Y-56005897D01*
X267660380Y-56005897D01*
X267136571Y-56005897D02*
X267041333Y-55958278D01*
X266993714Y-55863040D01*
X266993714Y-55720183D01*
X267041333Y-55624945D01*
X267136571Y-55577326D01*
X267660380Y-55577326D01*
X267660380Y-55101135D02*
X266993714Y-55101135D01*
X267088952Y-55101135D02*
X267041333Y-55053516D01*
X266993714Y-54958278D01*
X266993714Y-54815421D01*
X267041333Y-54720183D01*
X267136571Y-54672564D01*
X267660380Y-54672564D01*
X267136571Y-54672564D02*
X267041333Y-54624945D01*
X266993714Y-54529707D01*
X266993714Y-54386850D01*
X267041333Y-54291611D01*
X267136571Y-54243992D01*
X267660380Y-54243992D01*
M02*

View File

@@ -0,0 +1,14 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Other,ECO1*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*

View File

@@ -0,0 +1,14 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Other,ECO2*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*

View File

@@ -0,0 +1,28 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Profile,NP*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 #@! TA.AperFunction,Profile*
%ADD10C,0.050000*%
G04 #@! TD*
G04 APERTURE END LIST*
D10*
X170180000Y-40640000D02*
X269240000Y-40640000D01*
X170180000Y-43180000D02*
X170180000Y-40640000D01*
X170180000Y-139700000D02*
X170180000Y-43180000D01*
X269240000Y-139700000D02*
X269240000Y-40640000D01*
X170180000Y-139700000D02*
X269240000Y-139700000D01*
M02*

View File

@@ -0,0 +1,32 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Glue,Top*
G04 #@! TF.FilePolarity,Positive*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%ADD10C,0.380000*%
G04 APERTURE END LIST*
D10*
X211413132Y-73660000D02*
G75*
G03*
X211413132Y-73660000I-212132J0D01*
G01*
X211751000Y-73660000D02*
G75*
G03*
X211751000Y-73660000I-550000J0D01*
G01*
X212101000Y-73660000D02*
G75*
G03*
X212101000Y-73660000I-900000J0D01*
G01*
M02*

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Other,User*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*

View File

@@ -0,0 +1,20 @@
M48
; DRILL file {KiCad 5.1.10} date Thu Jun 10 23:11:37 2021
; FORMAT={-:-/ absolute / inch / decimal}
; #@! TF.CreationDate,2021-06-10T23:11:37+02:00
; #@! TF.GenerationSoftware,Kicad,Pcbnew,5.1.10
; #@! TF.FileFunction,NonPlated,1,2,NPTH
FMAT,2
INCH
T1C0.0941
T2C0.1358
%
G90
G05
T1
X9.8951Y-2.461
T2
X7.394Y-2.461
X9.5672Y-1.831
T0
M30

View File

@@ -0,0 +1,304 @@
M48
; DRILL file {KiCad 5.1.10} date Thu Jun 10 23:11:37 2021
; FORMAT={-:-/ absolute / inch / decimal}
; #@! TF.CreationDate,2021-06-10T23:11:37+02:00
; #@! TF.GenerationSoftware,Kicad,Pcbnew,5.1.10
; #@! TF.FileFunction,Plated,1,2,PTH
FMAT,2
INCH
T1C0.0157
T2C0.0295
T3C0.0315
T4C0.0374
T5C0.0394
T6C0.0591
T7C0.0591
T8C0.0787
T9C0.1181
%
G90
G05
T1
X6.7418Y-4.8632
X6.755Y-4.285
X6.8055Y-4.415
X6.825Y-3.525
X6.845Y-3.93
X6.8754Y-4.7304
X6.8757Y-4.3343
X6.905Y-4.58
X6.96Y-4.585
X6.98Y-3.19
X6.985Y-3.91
X7.005Y-4.37
X7.025Y-2.385
X7.025Y-4.75
X7.04Y-4.6
X7.045Y-5.035
X7.05Y-3.48
X7.055Y-4.38
X7.055Y-4.89
X7.08Y-2.99
X7.11Y-5.025
X7.13Y-2.45
X7.13Y-4.96
X7.14Y-4.77
X7.15Y-2.92
X7.1528Y-5.1602
X7.17Y-5.43
X7.21Y-4.3
X7.22Y-4.77
X7.225Y-4.35
X7.225Y-4.35
X7.2274Y-4.2647
X7.23Y-3.06
X7.25Y-5.16
X7.255Y-4.41
X7.2866Y-5.2154
X7.29Y-3.41
X7.3Y-4.41
X7.315Y-2.385
X7.32Y-4.77
X7.3282Y-3.95
X7.34Y-4.075
X7.35Y-3.73
X7.3621Y-4.3489
X7.37Y-3.67
X7.37Y-4.12
X7.42Y-4.77
X7.4275Y-5.0525
X7.43Y-4.92
X7.43Y-4.96
X7.45Y-3.15
X7.5Y-3.78
X7.52Y-4.77
X7.5434Y-4.5416
X7.55Y-4.35
X7.58Y-4.58
X7.59Y-4.15
X7.59Y-5.29
X7.5965Y-4.9528
X7.62Y-4.77
X7.64Y-4.18
X7.66Y-2.095
X7.665Y-1.99
X7.69Y-5.41
X7.7Y-2.36
X7.72Y-4.77
X7.78Y-2.525
X7.78Y-5.37
X7.825Y-3.25
X7.875Y-3.45
X7.975Y-3.45
X7.975Y-4.45
X8.025Y-1.97
X8.0625Y-2.8075
X8.07Y-2.09
X8.072Y-4.652
X8.09Y-5.2
X8.125Y-3.4
X8.145Y-2.32
X8.15Y-5.09
X8.18Y-4.44
X8.22Y-3.92
X8.24Y-4.72
X8.2779Y-3.7421
X8.2779Y-3.9179
X8.2779Y-4.1879
X8.29Y-5.44
X8.3Y-5.26
X8.31Y-3.275
X8.31Y-3.645
X8.3299Y-3.8453
X8.33Y-4.58
X8.35Y-4.645
X8.375Y-3.66
X8.38Y-5.37
X8.4Y-1.72
X8.43Y-4.7
X8.48Y-4.595
X8.49Y-1.815
X8.54Y-3.85
X8.57Y-1.78
X8.615Y-4.375
X8.637Y-4.8689
X8.6726Y-3.6326
X8.695Y-4.59
X8.695Y-4.7
X8.8Y-3.15
X8.83Y-3.85
X8.841Y-1.761
X8.847Y-1.646
X8.915Y-4.38
X8.9526Y-3.6326
X8.955Y-4.705
X8.9559Y-4.861
X8.96Y-4.58
X9.06Y-2.97
X9.11Y-2.1
X9.11Y-2.34
X9.13Y-3.85
X9.2Y-3.34
X9.22Y-4.37
X9.2526Y-3.6326
X9.2551Y-4.8335
X9.27Y-4.585
X9.27Y-4.705
X9.28Y-3.21
X9.319Y-1.656
X9.32Y-3.46
X9.325Y-1.764
X9.35Y-2.48
X9.44Y-3.85
X9.45Y-3.21
X9.47Y-2.59
X9.515Y-3.375
X9.52Y-4.38
X9.525Y-3.46
X9.525Y-4.585
X9.53Y-4.7
X9.5374Y-3.6326
X9.5588Y-3.2462
X9.58Y-4.85
X9.59Y-4.955
X9.715Y-2.025
X9.74Y-3.85
X9.75Y-4.7
X9.79Y-3.465
X9.84Y-4.385
X9.84Y-4.85
X9.845Y-1.835
X9.851Y-1.657
X9.854Y-1.744
X9.8774Y-3.6326
X9.885Y-4.955
X9.925Y-4.58
X10.03Y-3.27
X10.03Y-3.41
X10.05Y-3.85
X10.12Y-4.375
X10.125Y-4.22
X10.14Y-4.01
X10.17Y-4.85
X10.185Y-4.525
X10.185Y-4.955
X10.21Y-3.265
X10.315Y-4.715
X10.328Y-2.639
X10.3328Y-2.1392
X10.3378Y-3.8453
X10.34Y-3.41
X10.345Y-4.275
X10.355Y-3.585
X10.36Y-4.485
X10.365Y-2.6
X10.375Y-3.29
X10.4Y-3.945
X10.4028Y-3.85
X10.42Y-3.405
X10.475Y-3.63
X10.48Y-3.015
X10.505Y-4.41
X10.5051Y-3.5849
X10.51Y-3.195
X10.57Y-3.559
X10.572Y-2.412
T2
X8.47Y-1.645
X8.52Y-1.645
X8.57Y-1.645
T3
X8.655Y-3.03
X10.145Y-3.47
X10.1474Y-3.6326
T4
X6.861Y-2.737
X6.861Y-2.8354
X6.861Y-2.9339
X7.5247Y-5.07
X7.6231Y-5.07
X7.7216Y-5.07
X7.82Y-5.07
X8.45Y-4.9031
X8.45Y-5.0016
X8.45Y-5.1
X8.75Y-4.9031
X8.75Y-5.0016
X8.75Y-5.1
X9.05Y-4.9031
X9.05Y-5.0016
X9.05Y-5.1
X9.35Y-4.9031
X9.35Y-5.0016
X9.35Y-5.1
X9.65Y-4.9031
X9.65Y-5.0016
X9.65Y-5.1
X9.95Y-4.9031
X9.95Y-5.0016
X9.95Y-5.1
X10.25Y-4.9031
X10.25Y-5.0016
X10.25Y-5.1
T5
X6.95Y-3.4
X7.1381Y-2.805
X7.1469Y-3.4
X7.335Y-2.805
X7.5781Y-2.795
X7.775Y-2.795
X7.825Y-3.775
X7.825Y-3.875
X7.9Y-4.55
X7.925Y-3.775
X7.925Y-3.875
X8.0Y-4.55
X8.025Y-3.775
X8.025Y-3.875
X8.1Y-4.55
X8.125Y-3.775
X8.125Y-3.875
X8.39Y-3.4
X8.45Y-4.3516
X8.45Y-4.45
X8.5869Y-3.4
X8.707Y-2.665
X8.75Y-4.3516
X8.75Y-4.45
X8.807Y-2.665
X8.85Y-3.4
X8.902Y-2.412
X8.907Y-2.665
X9.0004Y-2.412
X9.007Y-2.665
X9.0469Y-3.4
X9.05Y-4.3516
X9.05Y-4.45
X9.35Y-4.3516
X9.35Y-4.45
X9.65Y-4.3516
X9.65Y-4.45
X9.95Y-4.3516
X9.95Y-4.45
X10.225Y-2.815
X10.225Y-2.915
X10.225Y-3.015
X10.225Y-3.115
X10.25Y-4.3516
X10.25Y-4.45
T6
X9.1502Y-2.8
X10.04Y-2.8
T7
X9.448Y-2.107
X9.448Y-2.307
T8
X6.9321Y-2.146
X10.029Y-2.146
T9
X6.85Y-1.75
X6.85Y-5.34
X10.45Y-1.75
X10.45Y-5.34
T0
M30

BIN
board/gerber/gerber.zip Normal file

Binary file not shown.

View File

@@ -1,7 +1,8 @@
(sym_lib_table
(lib (name LP38690DT-3.3)(type Legacy)(uri ${KIPRJMOD}/kicad-stuff/LP38690DT-3.3.lib)(options "")(descr ""))
(lib (name ESP32-DEVKITC-32D)(type Legacy)(uri ${KIPRJMOD}/kicad-stuff/ESP32/ESP32-DEVKITC-32D.lib)(options "")(descr ""))
(lib (name DW01)(type Legacy)(uri ${KIPRJMOD}/kicad-stuff/DW01.lib)(options "")(descr ""))
(lib (name SX1308)(type Legacy)(uri ${KIPRJMOD}/kicad-stuff/SX1308.lib)(options "")(descr ""))
(lib (name ds2438)(type Legacy)(uri ${KIPRJMOD}/kicad-stuff/ds2438.lib)(options "")(descr ""))
(lib (name "LP38690DT-3.3")(type "Legacy")(uri "${KIPRJMOD}/kicad-stuff/LP38690DT-3.3.lib")(options "")(descr ""))
(lib (name "ESP32-DEVKITC-32D")(type "Legacy")(uri "${KIPRJMOD}/kicad-stuff/ESP32/ESP32-DEVKITC-32D.lib")(options "")(descr ""))
(lib (name "DW01")(type "Legacy")(uri "${KIPRJMOD}/kicad-stuff/DW01.lib")(options "")(descr ""))
(lib (name "SX1308")(type "Legacy")(uri "${KIPRJMOD}/kicad-stuff/SX1308.lib")(options "")(descr ""))
(lib (name "ds2438")(type "Legacy")(uri "${KIPRJMOD}/kicad-stuff/ds2438.lib")(options "")(descr ""))
(lib (name "PlantCtrlESP32-rescue")(type "Legacy")(uri "${KIPRJMOD}/PlantCtrlESP32-rescue.lib")(options "")(descr ""))
)

1
esp32/.gitignore vendored
View File

@@ -7,3 +7,4 @@
doc/
custom_platformio.ini
cppcheck-build-dir
host/settings.json

View File

@@ -1,7 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

3
esp32/CMakeLists.txt Normal file
View File

@@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 3.16.0)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(esp32)

View File

@@ -18,7 +18,14 @@
"string": "cpp",
"typeinfo": "cpp",
"cmath": "cpp",
"iterator": "cpp"
"iterator": "cpp",
"array": "cpp",
"tuple": "cpp",
"utility": "cpp",
"fstream": "cpp",
"ostream": "cpp",
"sstream": "cpp"
"system_error": "cpp"
}
}
}

View File

@@ -1,7 +1,17 @@
# PlantControl
## Hardware
Uses ESP32MiniKit
Main processor
* ESP32 with 16MB Flash
One-Wire
* Temperatur Sensor (DS18B20)
* Lipo-Monitoring (DS2438)
Lipo Protection
* Open drain 3.3V detector (CN61CN33 @ jlcpcb parts)
### Used Pins:
* See '''include/ControllerConfiguration.h'''
@@ -16,9 +26,9 @@ Uses ESP32MiniKit
* 7 Pumps
* Sensors
* Solar powered (voltage)
* Lipo-Powered (voltage)
* Lipo-Powered (DS2438 for monitoring)
* Temperature
* Distance sensor [JSN-SR04T-2.0] (for waterlevel)
* Laser distance sensor [VL53L0X]
* Custom GPIO
## Documentation of Power-Modes
@@ -42,35 +52,18 @@ DS18B20 one wire temp sensor
## Empires Wunschliste
* Pflanze
* Pumpe
* Zeitspann (wann laufen darf)
* Helligkeitstrigger (Um den Morgen zum pumpen zu erkennen)
* Maximal Dauer zum Pumpen (als Zeit oder Milliliter)
* Zeitspanne zwischen zwei Pumpvorgängen
* [x] Zeitspann (wann laufen darf)
* [x] Helligkeitstrigger (Um den Morgen zum pumpen zu erkennen)
* [-] Maximal Dauer zum Pumpen (als Zeit oder Milliliter)
* [x] Zeitspanne zwischen zwei Pumpvorgängen
* Moister sensor
* Oberen
* Unteren Wert
* [x] Schwellwert für Pumpe
* Tank
* Füllstand Anzeige (in Liter)
* Minimum Wasserstand (in cm damit Pumpen nicht leer laufen; enspricht 0 nutzbaren Liter)
* Trigger-Erinnerungen um Wasser nachzufüllen
* Maximaler Wasserstand des Tanks (in cm & Liter)
* System
* Tiefentladungsschutz vom LIPO (fest im Controller die Spannung festlegen)
* 3.5V unterschritten, dann nur noch Deepsleep
* MQTT Topic, wenn Spannung unterschritten wurde
* Lipo innerhalb 24h nicht geladen -> MQTT Topic
* Deep-Sleep
* Mode1:
* Nur Sensor werte einsameln
* Wird verlassen bei Aktionen
* Pumpe schalten
* MQTT Nachrichten
* nach x Minuten nur in Mode1
* Mode2:
* WLAN aktivieren und Werte über MQTT raus hauen
* aktuelle Werte raushauen
* MQTT lesen
* Mode3:
* Deepsleep verboten (MQTT topic, retained)
* alle Pumpen & Sensoren deaktiviert
* [x] Maximaler Wasserstand des Tanks (in cm & Liter)
## Masterplan 2.0
* Partitionslayout

View File

@@ -1,17 +1,41 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:esp32doit-devkit-v1]
platform = espressif32
platform = espressif32@6.3.2
board = esp32doit-devkit-v1
framework = arduino
build_flags = -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
-DPLANT0_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DPLANT1_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DPLANT2_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DPLANT3_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DPLANT4_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DPLANT5_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DPLANT6_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DTIMED_LIGHT_PIN=CUSTOM1_PIN5
-DFLOWMETER_PIN=CUSTOM1_PIN1
-DANALOG_WATER=GPIO_NUM_34
board_build.partitions = defaultWithSmallerSpiffs.csv
extra_configs = custom_platformio.ini
;#https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html
; the latest development brankitchen-lightch (convention V3.0.x)
lib_deps = ArduinoJson@6.16.1
https://github.com/homieiot/homie-esp8266.git#v3.0
OneWire
DallasTemperature
lib_deps = bblanchon/ArduinoJson@^6.20.1
paulstoffregen/OneWire@^2.3.6
milesburton/DallasTemperature@^3.11.0
pololu/VL53L0X@^1.3.1
https://github.com/homieiot/homie-esp8266.git#develop
; add additional parameter, like the upload port
upload_port=/dev/ttyUSB1
[platformio]
extra_configs = custom_platformio.ini

View File

@@ -1,6 +1,7 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x150000,
app1, app, ota_1, 0x160000,0x150000,
spiffs, data, spiffs, 0x300000,0x17000,
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xD000, 0x2000
phy_init, data, phy, 0xF000, 0x1000
ota_0, app, ota_0, 0x10000, 0x1E0000
ota_1, app, ota_1, 0x1F0000, 0x1E0000
spiffs, data, spiffs, 0x3D0000, 0x30000
1 # Name # Name, Type, SubType, Offset, Size, Flags Type SubType Offset Size Flags
2 nvs nvs, data, nvs, 0x9000, 0x4000 data nvs 0x9000 0x5000
3 otadata otadata, data, ota, 0xD000, 0x2000 data ota 0xe000 0x2000
4 app0 phy_init, data, phy, 0xF000, 0x1000 app ota_0 0x10000 0x150000
5 app1 ota_0, app, ota_0, 0x10000, 0x1E0000 app ota_1 0x160000 0x150000
6 spiffs ota_1, app, ota_1, 0x1F0000, 0x1E0000 data spiffs 0x300000 0x17000
7 spiffs, data, spiffs, 0x3D0000, 0x30000

View File

@@ -1,49 +0,0 @@
{
"name": "PlantControl",
"device_id": "PlantCtrl1",
"device_stats_interval": 60,
"wifi": {
"ssid": "SSID",
"bssid" : "BSSID",
"password": "mysecretPassword",
"channel": 1
},
"mqtt": {
"host": "[0-255].[0-255].[0-255].[0-255]",
"port": 1883,
"base_topic": "mqtt/topic/",
"auth": false
},
"ota": {
"enabled": true
},
"settings": {
"deepsleep" : 60000,
"nightsleep" : 60000,
"pumpdeepsleep": 1000,
"watermaxlevel": 50,
"watermin" : 5,
"plants" : 3,
"moist0" : 2000,
"moist1" : 2000,
"moist2" : 2000,
"moist3" : 2000,
"moist4" : 2000,
"moist5" : 2000,
"moist6" : 2000,
"plant0MaxPumpTime": 1000,
"plant1MaxPumpTime": 1000,
"plant2MaxPumpTime": 1000,
"plant3MaxPumpTime": 1000,
"plant4MaxPumpTime": 1000,
"plant5MaxPumpTime": 1000,
"plant6MaxPumpTime": 1000,
"plant0MinPumpIdle": 10000,
"plant1MinPumpIdle": 10000,
"plant2MinPumpIdle": 10000,
"plant3MinPumpIdle": 10000,
"plant4MinPumpIdle": 10000,
"plant5MinPumpIdle": 10000,
"plant6MinPumpIdle": 10000
}
}

View File

@@ -0,0 +1,49 @@
{
"settings": {
"sleep":600,
"nightsleep": 1200,
"pumpsleep": 5,
"tankmax": 1000,
"tankmin": 100,
"tankwarn": 200,
"tankVolume": 100,
"lipoDSAddr": "abcdefghijklmnop",
"tankDSAddr": "abcdefghijklmnop",
"ntpServer":"pool.ntp.org",
"dry0":50,
"hourstart0":6,
"hourend0":20,
"lowLight0": false,
"delay0": 30,
"dry1":-1,
"hourstart1":6,
"hourend1":20,
"lowLight1": false,
"delay1": 30,
"dry2":-1,
"hourstart2":6,
"hourend2":20,
"lowLight2": false,
"delay2": 30,
"dry3":-1,
"hourstart3":6,
"hourend3":20,
"lowLight3": false,
"delay3": 30,
"dry4":-1,
"hourstart4":6,
"hourend4":20,
"lowLight4": false,
"delay4": 30,
"dry5":-1,
"hourstart5":6,
"hourend5":20,
"lowLight5": false,
"delay5": 30,
"dry6":-1,
"hourstart6":6,
"hourend6":20,
"lowLight6": false,
"delay6": 30
}
}

41
esp32/host/upload-settings.sh Executable file
View File

@@ -0,0 +1,41 @@
#!//bin/bash
if [ $# -ne 3 ]; then
echo "Homie prefex and device index must be specified:"
echo "$0 <mqtt host> <prefix> <device index>"
echo "e.g."
echo "$0 192.168.0.2 test/ MyDeviceId"
exit 1
fi
mqttHost=$1
mqttPrefix=$2
homieId=$3
maxSteps=6
settingsFile=settings.json
if [ ! -f $settingsFile ]; then
echo "$settingsFile missing"
echo "check $settingsFile.example"
exit 1
fi
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "1" -r
echo "(1 / $maxSteps) Waiting ..."
mosquitto_sub -h $mqttHost -t "${mqttPrefix}${homieId}/#" -R -C 1
set -e
echo "(2 / $maxSteps) Waiting 30 seconds ..."
sleep 30
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/\$implementation/config/set" -f $settingsFile
echo "(3 / $maxSteps) Waiting for reboot ..."
sleep 1
mosquitto_sub -h $mqttHost -t "${mqttPrefix}${homieId}/#" -R -C 1
echo "(4 / $maxSteps) Alive"
sleep 20
echo "(5 / $maxSteps) Create Backup ..."
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/config/backup/set" -m "true" -r
sleep 5
echo "(6 / $maxSteps) Shutdown ..."
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "0" -r
exit 0

View File

@@ -17,11 +17,14 @@ if [ ! -f $firmwareFile ]; then
echo "the script $0 must be started in host/ sub directory"
exit 2
fi
echo "Firmware changed:"
ls -l $firmwareFile
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "1" -r
echo "Waiting ..."
mosquitto_sub -h $mqttHost -t "${mqttPrefix}${homieId}/#" -R -C 1
python ota_updater.py -l $mqttHost -t "$mqttPrefix" -i "$homieId" $firmwareFile
set -e
python3 ota_updater.py -l $mqttHost -t "$mqttPrefix" -i "$homieId" $firmwareFile
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "0" -r
exit 0

View File

@@ -43,66 +43,139 @@
*/
#ifndef CONTROLLER_CONFIG_H
#define CONTROLLER_CONFIG_H
/** \addtogroup GPIO Settings
* @{
*/
#define SENSOR_PLANT0 GPIO_NUM_32 /**< GPIO 32 (ADC1) */
#define SENSOR_PLANT1 GPIO_NUM_33 /**< GPIO 33 (ADC1) */
#define SENSOR_PLANT2 GPIO_NUM_25 /**< GPIO 25 (ADC2) */
#define SENSOR_PLANT3 GPIO_NUM_26 /**< GPIO 26 (ADC2) */
#define SENSOR_PLANT4 GPIO_NUM_27 /**< GPIO 27 (ADC2) */
#define SENSOR_PLANT5 GPIO_NUM_39 /**< SENSOR_VIN */
#define SENSOR_PLANT6 GPIO_NUM_36 /**< SENSOR_VP */
#ifdef HWREVISION07
#define OUTPUT_PUMP0 GPIO_NUM_17 /**< GPIO 17 */
#define OUTPUT_PUMP1 GPIO_NUM_5 /**< GPIO 5 */
#define OUTPUT_PUMP2 GPIO_NUM_18 /**< GPIO 18 */
#define OUTPUT_PUMP3 GPIO_NUM_19 /**< GPIO 19 */
#define OUTPUT_PUMP4 GPIO_NUM_21 /**< GPIO 21 */
#define OUTPUT_PUMP5 GPIO_NUM_22 /**< GPIO 22 */
#define OUTPUT_PUMP6 GPIO_NUM_23 /**< GPIO 23 */
#else
#define OUTPUT_PUMP0 GPIO_NUM_15 /**< GPIO 15 */
#define OUTPUT_PUMP1 GPIO_NUM_5 /**< GPIO 5 */
#define OUTPUT_PUMP2 GPIO_NUM_18 /**< GPIO 18 */
#define OUTPUT_PUMP3 GPIO_NUM_19 /**< GPIO 19 */
#define OUTPUT_PUMP4 GPIO_NUM_21 /**< GPIO 21 */
#define OUTPUT_PUMP5 GPIO_NUM_22 /**< GPIO 22 */
#define OUTPUT_PUMP6 GPIO_NUM_23 /**< GPIO 23 */
#endif
#define OUTPUT_ENABLE_PUMP GPIO_NUM_13 /**< GPIO 13 - Enable Pumps */
#ifdef HWREVISION07
#define OUTPUT_ENABLE_SENSOR GPIO_NUM_16 /**< GPIO 16 - Enable Sensors */
#define SENSOR_ONEWIRE GPIO_NUM_2 /** GPIO 02 - Temperatur sensor, Battery and other cool onewire stuff */
#else
#define OUTPUT_ENABLE_SENSOR GPIO_NUM_14 /**< GPIO 14 - Enable Sensors */
#define SENSOR_ONEWIRE GPIO_NUM_4 /**< GPIO 12 - Temperatur sensor, Battery and other cool onewire stuff */
#endif
#ifdef ANALOG_WATER
#define SENSOR_TANK_ANALOG ANALOG_WATER /**< GPIO 34 - analog water sensor (GPIO_NUM_34) */
#else
#ifdef HWREVISION07
#else
#define SENSOR_TANK_SDA GPIO_NUM_17 /**< GPIO 17 - water sensor SDA */
#define SENSOR_TANK_SCL GPIO_NUM_16 /**< GPIO 16 - water sensor SCL */
#endif
#endif
#define BUTTON GPIO_NUM_0 /**< GPIO 0 - Fix button of NodeMCU */
#define CUSTOM1_PIN1 GPIO_NUM_34 /** direct gpio */
#define CUSTOM1_PIN3 GPIO_NUM_35 /** direct gpio */
#ifdef HWREVISION07
#define CUSTOM1_PIN5 GPIO_NUM_4 /** mosfet controlled */
#else
#define CUSTOM1_PIN5 GPIO_NUM_2 /** mosfet controlled */
#endif
#define CUSTOM1_PIN7 GPIO_NUM_12 /** mosfet controlled */
/* @} */
/** \addtogroup Configuration
* @{
*/
#define FIRMWARE_VERSION "1.1.0"
#define ADC_TO_VOLT(adc) ((adc) * 3.3 ) / 4095)
#define ADC_TO_VOLT_WITH_MULTI(adc, multi) (((adc)*3.3 * (multi)) / 4095)
#define MOIST_SENSOR_MAX_ADC (85 * 4095 / 100)
#define MOIST_SENSOR_MIN_ADC (25 * 4095 / 100)
#ifdef FLOWMETER_PIN
#define FLOWMETER_PULSES_PER_ML 2.2
#define FIRMWARE_FEATURE1 "Flow"
#else
#ifdef ANALOG_WATER
#define FIRMWARE_FEATURE1 "Water"
#else
#define FIRMWARE_FEATURE1 ""
#endif
#endif
#define SOLAR_VOLT_FACTOR 2
#ifdef TIMED_LIGHT_PIN
#define FIRMWARE_FEATURE2 "Light"
#else
#define FIRMWARE_FEATURE2 ""
#endif
#define FIRMWARE_BASENAME "PlantControl"
#define FIRMWARE_NAME FIRMWARE_BASENAME FIRMWARE_FEATURE1 FIRMWARE_FEATURE2
#define FIRMWARE_VERSIONNMUMBER "3.021"
#ifdef HWREVISION07
#define FIRMWARE_VERSION FIRMWARE_VERSIONNMUMBER " HW0.7"
#else
#define FIRMWARE_VERSION FIRMWARE_VERSIONNMUMBER " HW0.10b"
#endif
#define MOIST_SENSOR_MAX_FRQ 5200 // 60kHz (500Hz margin)
#define MOIST_SENSOR_MIN_FRQ 500 // 0.5kHz (500Hz margin)
#define ANALOG_SENSOR_MAX_MV 1300 //successive approximation of good range
#define ANALOG_SENSOR_MIN_MV 100 //successive approximation of good range
#ifdef HWREVISION07
#define SOLAR_VOLT_FACTOR (4.0306f) /**< 100k and 33k voltage dividor */
#else
#define SOLAR_VOLT_FACTOR (11.0f) /**< Configuratiion before dd3888ba52f51338788820a933c0a6f4bee78ed5 */
#endif
#define BATTSENSOR_INDEX_SOLAR 0
#define BATTSENSOR_INDEX_BATTERY 1
#define MS_TO_S 1000
#define SENSOR_PLANT0 32 /**< GPIO 32 (ADC1) */
#define SENSOR_PLANT1 33 /**< GPIO 33 (ADC1) */
#define SENSOR_PLANT2 25 /**< GPIO 25 (ADC2) */
#define SENSOR_PLANT3 26 /**< GPIO 26 (ADC2) */
#define SENSOR_PLANT4 27 /**< GPIO 27 (ADC2) */
#define SENSOR_PLANT5 39 /**< SENSOR_VIN */
#define SENSOR_PLANT6 36 /**< SENSOR_VP */
#define MQTT_TIMEOUT (1000 * 60) /**< After 10 seconds, MQTT is expected to be connected */
#define ESP_STALE_TIMEOUT (MQTT_TIMEOUT+(700*1000))
#define ESP_ADC_MAX 4095
#define OUTPUT_PUMP0 17 /**< GPIO 17 */
#define OUTPUT_PUMP1 5 /**< GPIO 5 */
#define OUTPUT_PUMP2 18 /**< GPIO 18 */
#define OUTPUT_PUMP3 19 /**< GPIO 19 */
#define OUTPUT_PUMP4 21 /**< GPIO 21 */
#define OUTPUT_PUMP5 22 /**< GPIO 22 */
#define OUTPUT_PUMP6 23 /**< GPIO 23 */
#define OUTPUT_SENSOR 16 /**< GPIO 16 - Enable Sensors */
#define OUTPUT_PUMP 13 /**< GPIO 13 - Enable Pumps */
#define SENSOR_DS18B20 2 /**< GPIO 2 - Temperatur sensor */
#define BUTTON 0 /**< GPIO 0 - Fix button of NodeMCU */
#define MIN_TIME_RUNNING 5UL /**< Amount of seconds the controller must stay awoken */
#define MAX_PLANTS 7
#define MINIMUM_LIPO_VOLT 3.2f /**< Minimum voltage of the Lipo, that must be present */
#define NO_LIPO_VOLT 2.0f /**< No Lipo connected */
#define MINIMUM_SOLAR_VOLT 4.0f /**< Minimum voltage of the sun, to detect daylight */
#define SOLAR_CHARGE_MIN_VOLTAGE 7 /**< Sun is rising (morning detected) */
#define SOLAR_CHARGE_MAX_VOLTAGE 9 /**< Sun is shining (noon) */
#define SOLAR_CHARGE_MIN_VOLTAGE 7 /**< Sun is rising (morning detected) */
#define SOLAR_CHARGE_MAX_VOLTAGE 9 /**< Sun is shining (noon) */
#define SOLAR_MAX_VOLTAGE_POSSIBLE 100 /**< higher values are treated as not connected sensor */
#define VOLT_MAX_BATT 4.2f
#define VOLT_SENSORS_BATT 3.6f /**< Minimum battery voltage for sensor (and pump) usage */
#define VOLT_MIN_BATT 3.4f /**< Minimum battery voltage for normal operation */
#define LOWVOLT_SLEEP_FACTOR 6 /**< Factor for nightsleep delay, if the battery drops below minimum (@see VOLT_MIN_BATT) */
#define LOWVOLT_SLEEP_MINIMUM 7200 /**< At low voltage sleep at least for 120 minutes (two hours) */
#define MAX_CONFIG_SETTING_ITEMS 50 /**< Parameter, that can be configured in Homie */
#define WATER_LEVEL_MINIMUM 500 /**< Minimum Analog value (1023 is the maximum)*/
#define PANIK_MODE_DEEPSLEEP (60 * 60 * 5U) /**< 5 hours in usecond */
#define PANIK_MODE_DEEPSLEEP_US (PANIK_MODE_DEEPSLEEP * 1000 * 1000)
#define LIPO_MAX_TEMPERATUR 85
#define LIPO_MAX_TEMPERATUR_DIFF 10
#define MAX_CONFIG_SETTING_ITEMS 100 /**< Parameter, that can be configured in Homie */
#define MAX_JSON_CONFIG_FILE_SIZE_CUSTOM 2500
#define TEMPERATURE_DELTA_TRIGGER_IN_C 1.0f
#define MOIST_DELTA_TRIGGER_ADC 10
#define SOLAR_DELTA_VOLT_ADC 3
#define LIPO_DELTA_VOLT_ADC 0.2 /**< trigger for lipo voltage */
#define TEMPERATUR_TIMEOUT 5000 /**< 5 Seconds timeout for the temperatures sensors */
#define WATERSENSOR_TIMEOUT 1000 /**< 1 Seconds timeout for the water distance sensor */
#define WATERSENSOR_CYCLE 10 /**< 10 sensor measurement are performed */
#define DS18B20_RESOLUTION 9 /**< 9bit temperature resolution -> 0.5°C steps */
#define TEMPERATUR_TIMEOUT 3000 /**< 3 Seconds timeout for the temperatur sensors */
#define TEMP_SENSOR_MEASURE_SERIES 5
#define UTC_OFFSET_DE 3600 /* UTC offset in seconds for Germany */
#define UTF_OFFSET_DE_DST 3600 /* offset in seconds if daylight saving time is active */
/* @} */
#endif
#endif

View File

@@ -1,18 +1,6 @@
/*
* DS2438.h
/**
* @file DS2438.h
*
* by Joe Bechter
*
* (C) 2012, bechter.com
*
* All files, software, schematics and designs are provided as-is with no warranty.
* All files, software, schematics and designs are for experimental/hobby use.
* Under no circumstances should any part be used for critical systems where safety,
* life or property depends upon it. You are responsible for all use.
* You are free to use, modify, derive or otherwise extend for your own non-commercial purposes provided
* 1. No part of this software or design may be used to cause injury or death to humans or animals.
* 2. Use is non-commercial.
* 3. Credit is given to the author (i.e. portions © bechter.com), and provide a link to the original source.
*
*/
@@ -21,6 +9,7 @@
#include <Arduino.h>
#include <OneWire.h>
#include "RunningMedian.h"
#define DS2438_TEMPERATURE_CONVERSION_COMMAND 0x44
#define DS2438_VOLTAGE_CONVERSION_COMMAND 0xb4
@@ -42,6 +31,9 @@
#define DS2438_TEMPERATURE_DELAY 10
#define DS2438_VOLTAGE_CONVERSION_DELAY 8
#define DS2438_MEDIAN_COUNT 5
#define DS2438_MEDIAN_DELAY 50
#define DEFAULT_PAGE0(var) uint8_t var[8] { \
0b00001011 /* X, ADB=0, NVB=0, TB=0, AD=1, EE=0, CA=1, IAD=1 */, \
0, /* Temperatur */ \
@@ -50,7 +42,7 @@
0, /* Voltage */ \
0, /* Current */ \
0, /* Current */ \
0 /* Threashold */ \
0b10000000 /* Threshold to 4LSB */ \
}
typedef struct PageOne {
@@ -79,11 +71,10 @@ typedef uint8_t DeviceAddress[8];
class DS2438 {
public:
DS2438(OneWire *ow, float currentShunt);
DS2438(OneWire *ow, uint8_t *address);
DS2438(OneWire *ow, float currentShunt, int retryOnCRCError);
void begin();
void update();
void updateMultiple();
double getTemperature();
float getVoltage(int channel=DS2438_CHA);
float getCurrent();
@@ -96,16 +87,17 @@ class DS2438 {
private:
bool validAddress(const uint8_t*);
bool validFamily(const uint8_t* deviceAddress);
void update(bool firstIteration);
bool deviceFound = false;
OneWire *_ow;
DeviceAddress _address;
uint8_t _mode;
double _temperature;
float _voltageA;
float _voltageB;
float _current;
RunningMedian _temperature = RunningMedian(DS2438_MEDIAN_COUNT*2);
RunningMedian _voltageA = RunningMedian(DS2438_MEDIAN_COUNT);
RunningMedian _voltageB = RunningMedian(DS2438_MEDIAN_COUNT);
RunningMedian _current = RunningMedian(DS2438_MEDIAN_COUNT);
float _currentShunt;
int _retryOnCRCError;
long _CCA;
long _DCA;
long _ICA;

View File

@@ -0,0 +1,9 @@
#ifndef FILEUTILS_H
#define FILEUTILS_H
bool doesFileExist(const char *source);
bool copyFile(const char *source, const char *target);
bool deleteFile(const char *source);
void printFile(const char *source);
#endif

View File

@@ -19,56 +19,78 @@
#define MAX_PLANTS 7
/**
* @name Attributes
* @name Homie Attributes
* generated Information
* @{
**/
#define NUMBER_TYPE "number"
#define TEMPERATUR_SENSOR_LIPO "lipo"
#define TEMPERATUR_SENSOR_WATER "water"
#define TEMPERATUR_SENSOR_OUTSIDE "temp"
#define TEMPERATUR_SENSOR_CHIP "chip"
#define NUMBER_TYPE "Float" /**< numberic information, published or read in Homie */
/**
* @}
*
* @name Temperatur Node
* @{
**/
#define TEMPERATURE_NAME "Temperature"
#define TEMPERATURE_UNIT "°C"
#define TEMPERATUR_SENSOR_LIPO "lipo" /**< Homie node: temperatur, setting: lipo temperatur (or close to it) */
#define TEMPERATUR_SENSOR_CHIP "chip" /**< Homie node: temperatur, setting: battery chip */
#define TEMPERATUR_SENSOR_WATER "water" /**< Homie node: temperatur, setting: water temperatur */
/** @}
*
* @name Plant Nodes
* @{
*/
HomieNode plant0("plant0", "Plant 0", "Plant"); /**< dynamic Homie information for first plant */
HomieNode plant1("plant1", "Plant 1", "Plant"); /**< dynamic Homie information for second plant */
HomieNode plant2("plant2", "Plant 2", "Plant"); /**< dynamic Homie information for first plant */
HomieNode plant3("plant3", "Plant 3", "Plant"); /**< dynamic Homie information for first plant */
HomieNode plant4("plant4", "Plant 4", "Plant"); /**< dynamic Homie information for first plant */
HomieNode plant5("plant5", "Plant 5", "Plant"); /**< dynamic Homie information for first plant */
HomieNode plant6("plant6", "Plant 6", "Plant"); /**< dynamic Homie information for first plant */
HomieNode plant2("plant2", "Plant 2", "Plant"); /**< dynamic Homie information for third plant */
HomieNode plant3("plant3", "Plant 3", "Plant"); /**< dynamic Homie information for fourth plant */
HomieNode plant4("plant4", "Plant 4", "Plant"); /**< dynamic Homie information for fivth plant */
HomieNode plant5("plant5", "Plant 5", "Plant"); /**< dynamic Homie information for sixth plant */
HomieNode plant6("plant6", "Plant 6", "Plant"); /**< dynamic Homie information for seventh plant */
#if defined(TIMED_LIGHT_PIN)
HomieNode timedLightNode("timedLight", "TimedLight", "Status");
#endif // TIMED_LIGHT_PIN
HomieNode sensorLipo("lipo", "Battery Status", "Lipo");
HomieNode sensorSolar("solar", "Solar Status", "Solarpanel");
HomieNode sensorWater("water", "WaterSensor", "Water");
HomieNode sensorTemp("temperature", "Temperature", "temperature");
HomieNode startupReason("startupReason", "startupReason", "startupReason");
HomieNode stayAlive("stay", "alive", "alive"); /**< Necessary for Mqtt Active Command */
/* @} */
/**
* @}
*/
/**
* @name Settings
* General settings for the controller
* @{
*/
HomieSetting<long> maxTimeBetweenMQTTUpdates("mqttSleep", "time in seconds to start into mode2");
HomieSetting<long> deepSleepTime("deepsleep", "time in seconds to sleep (0 deactivats it)");
HomieSetting<long> deepSleepTime("sleep", "time in seconds to sleep");
HomieSetting<long> deepSleepNightTime("nightsleep", "time in seconds to sleep (0 uses same setting: deepsleep at night, too)");
HomieSetting<long> wateringDeepSleep("pumpdeepsleep", "time seconds to sleep, while a pump is running");
HomieSetting<long> waterLevelMax("watermaxlevel", "distance (mm) at maximum water level");
HomieSetting<long> waterLevelMin("waterminlevel", "distance (mm) at minimum water level (pumps still covered)");
HomieSetting<long> waterLevelWarn("waterlevelwarn", "warn (mm) if below this water level %");
HomieSetting<long> waterLevelVol("waterVolume", "(ml) between minimum and maximum");
HomieSetting<long> lipoSensorIndex("lipoTempIndex", "index onwire bus for lipo temperature sensor");
HomieSetting<long> waterSensorIndex("waterTempIndex", "index onwire bus for water temperature sensor");
HomieSetting<long> pumpIneffectiveWarning("pumpConsecutiveWarn", "if the pump was triggered this amount directly after each cooldown, without resolving dryness, warn");
HomieSetting<long> waterLevelVol("tankVolume", "(ml) between minimum and maximum");
HomieSetting<const char *> lipoSensorAddr("lipoDSAddr", "1wire address for lipo temperature sensor");
HomieSetting<const char *> waterSensorAddr("tankDSAddr", "1wire address for water temperature sensor");
HomieSetting<const char *> ntpServer("ntpServer", "NTP server (pool.ntp.org as default)");
#if defined(TIMED_LIGHT_PIN)
HomieSetting<double> timedLightVoltageCutoff("LightVoltageCutoff", "voltage at wich to disable light");
HomieSetting<long> timedLightStart("LightStart", "hour to start light");
HomieSetting<long> timedLightEnd("LightEnd", "hour to end light");
HomieSetting<bool> timedLightOnlyWhenDark("LightOnlyDark", "only enable light, if solar is low");
HomieSetting<long> timedLightPowerLevel("LightPowerLevel", "0-255 power level");
#endif // TIMED_LIGHT_PIN
/**
*@}
* @}
*/
/**
@@ -78,12 +100,15 @@ HomieSetting<const char *> ntpServer("ntpServer", "NTP server (pool.ntp.org as d
**/
#define GENERATE_PLANT(plant, strplant) \
HomieSetting<long> mSensorDry##plant = HomieSetting<long>("moistdry" strplant, "Plant " strplant "- Moist sensor dry threshold"); \
HomieSetting<long> mPumpAllowedHourRangeStart##plant = HomieSetting<long>("rangehourstart" strplant, "Plant" strplant " - Range pump allowed hour start (0-23)"); \
HomieSetting<long> mPumpAllowedHourRangeEnd##plant = HomieSetting<long>("rangehourend" strplant, "Plant" strplant " - Range pump allowed hour end (0-23)"); \
HomieSetting<bool> mPumpOnlyWhenLowLight##plant = HomieSetting<bool>("onlyWhenLowLightZ" strplant, "Plant" strplant " - Enable the Pump only, when there is light but not enought to charge battery"); \
HomieSetting<long> mPumpCooldownInHours##plant = HomieSetting<long>("cooldownpump" strplant, "Plant" strplant " - How long to wait until the pump is activated again (minutes)"); \
PlantSettings_t mSetting##plant = {&mSensorDry##plant, &mPumpAllowedHourRangeStart##plant, &mPumpAllowedHourRangeEnd##plant, &mPumpOnlyWhenLowLight##plant, &mPumpCooldownInHours##plant}; \
HomieSetting<double> mSensorDry##plant = HomieSetting<double>("dry" strplant, "Plant" strplant " - Moist sensor dry %"); \
HomieSetting<long> mPumpAllowedHourRangeStart##plant = HomieSetting<long>("hourstart" strplant, "Plant" strplant " - Range pump allowed hour start (0-23)"); \
HomieSetting<long> mPumpAllowedHourRangeEnd##plant = HomieSetting<long>("hourend" strplant, "Plant" strplant " - Range pump allowed hour end (0-23)"); \
HomieSetting<bool> mPumpOnlyWhenLowLight##plant = HomieSetting<bool>("lowLight" strplant, "Plant" strplant " - Enable the Pump only, when there is no sunlight"); \
HomieSetting<long> mPumpCooldownInSeconds##plant = HomieSetting<long>("delay" strplant, "Plant" strplant " - How long to wait until the pump is activated again (sec)"); \
HomieSetting<long> pPumpDuration##plant = HomieSetting<long>("pumpDuration" strplant, "Plant" strplant " - time seconds to water when pump is active"); \
HomieSetting<long> pPumpMl##plant = HomieSetting<long>("pumpAmount" strplant, "Plant" strplant " - ml (if using flowmeter) to water when pump is active"); \
HomieSetting<long> pPowerLevel##plant = HomieSetting<long>("powerLevel" strplant, "Plant" strplant " - pwm duty cycle in percent"); \
PlantSettings_t mSetting##plant = {&mSensorDry##plant, &mPumpAllowedHourRangeStart##plant, &mPumpAllowedHourRangeEnd##plant, &mPumpOnlyWhenLowLight##plant, &mPumpCooldownInSeconds##plant, &pPumpDuration##plant, &pPowerLevel##plant, &pPumpMl##plant}; \
/**< Generate all settings for one plant \
* \
* Feature to start pumping only at morning: @link{SOLAR_CHARGE_MIN_VOLTAGE} and @link{SOLAR_CHARGE_MAX_VOLTAGE} \
@@ -101,4 +126,7 @@ GENERATE_PLANT(4, "4"); /**< Homie settings for fifth plant */
GENERATE_PLANT(5, "5"); /**< Homie settings for sixth plant */
GENERATE_PLANT(6, "6"); /**< Homie settings for seventh plant */
#endif /* HOMIE_PLANT_CONFIG_H @} */
#endif /* HOMIE_PLANT_CONFIG_H @} */

View File

@@ -13,16 +13,83 @@
#include <Homie.h>
#define DEACTIVATED_PLANT 5000
#define MISSING_SENSOR 5001
/**
* @name Sensor types
* possible sensors:
* @{
**/
#define FOREACH_SENSOR(SENSOR) \
SENSOR(NONE) \
SENSOR(FREQUENCY_MOD_RESISTANCE_PROBE) \
SENSOR(ANALOG_RESISTANCE_PROBE)
/**
* @}
*/
#define GENERATE_ENUM(ENUM) ENUM,
#define GENERATE_STRING(STRING) #STRING,
enum SENSOR_MODE {
FOREACH_SENSOR(GENERATE_ENUM)
};
static const char *SENSOR_STRING[] = {
FOREACH_SENSOR(GENERATE_STRING)
};
//plant pump is deactivated, but sensor values are still recorded and published
#define DEACTIVATED_PLANT -1
//special value to indicate a missing sensor when the plant is not deactivated but no valid sensor value was read
#define MISSING_SENSOR -2
//plant uses only cooldown and duration, moisture is measured but ignored, allowedHours is ignored (eg. make a 30min on 30min off cycle)
#define HYDROPONIC_MODE -3
//plant uses cooldown and duration and workhours, moisture is measured but ignored
#define TIMER_ONLY -4
//special value to indicate a shorted sensor when the plant is not deactivated but the sensor reads short circuit value
#define SHORT_CIRCUIT_MODE -5
/**
* @brief State of plants
*
*/
#define PLANTSTATE_NUM_DEACTIVATED -1
#define PLANTSTATE_NUM_NO_SENSOR -2
#define PLANTSTATE_NUM_WET 0x00
#define PLANTSTATE_NUM_SUNNY_ALARM 0x11
#define PLANTSTATE_NUM_ACTIVE_ALARM 0x41
#define PLANTSTATE_NUM_ACTIVE_SUPESSED -3
#define PLANTSTATE_NUM_ACTIVE 0x40
#define PLANTSTATE_NUM_SUNNY 0x10
#define PLANTSTATE_NUM_COOLDOWN_ALARM 0x21
#define PLANTSTATE_NUM_COOLDOWN 0x20
#define PLANTSTATE_NUM_AFTERWORK_ALARM 0x31
#define PLANTSTATE_NUM_AFTERWORK 0x30
#define PLANTSTATE_STR_DEACTIVATED "deactivated"
#define PLANTSTATE_STR_NO_SENSOR "nosensor"
#define PLANTSTATE_STR_WET "wet"
#define PLANTSTATE_STR_SUNNY_ALARM "sunny+alarm"
#define PLANTSTATE_STR_ACTIVE_ALARM "active+alarm"
#define PLANTSTATE_STR_ACTIVE_SUPESSED "active+supressed"
#define PLANTSTATE_STR_ACTIVE "active"
#define PLANTSTATE_STR_SUNNY "sunny"
#define PLANTSTATE_STR_COOLDOWN_ALARM "cooldown+alarm"
#define PLANTSTATE_STR_COOLDOWN "cooldown"
#define PLANTSTATE_STR_AFTERWORK_ALARM "after-work+alarm"
#define PLANTSTATE_STR_AFTERWORK "after-work"
typedef struct PlantSettings_t
{
HomieSetting<long> *pSensorDry;
HomieSetting<double> *pSensorDry;
HomieSetting<long> *pPumpAllowedHourRangeStart;
HomieSetting<long> *pPumpAllowedHourRangeEnd;
HomieSetting<bool> *pPumpOnlyWhenLowLight;
HomieSetting<long> *pPumpCooldownInHours;
HomieSetting<long> *pPumpCooldownInSeconds;
HomieSetting<long> *pPumpDuration;
HomieSetting<long> *pPumpPowerLevel;
HomieSetting<long> *pPumpMl;
} PlantSettings_t;
#endif

View File

@@ -0,0 +1,56 @@
#ifndef LOG_DEFINES_H
#define LOG_DEFINES_H
#define LOG_LEVEL_ERROR 0
#define LOG_LEVEL_WARN 1
#define LOG_LEVEL_INFO 2
#define LOG_LEVEL_DEBUG 3
#define LOG_TANKSENSOR_FAIL_DETECT "Failed to detect and initialize distance sensor!"
#define LOG_TANKSENSOR_FAIL_DETECT_CODE -1
#define LOG_BACKUP_SUCCESSFUL "Backup sucessful"
#define LOG_BACKUP_SUCCESSFUL_CODE 1
#define LOG_BACKUP_FAILED "Backup error"
#define LOG_BACKUP_FAILED_CODE -2
#define LOG_PUMP_BUTNOTANK_MESSAGE "Want to pump but no water"
#define LOG_PUMP_BUTNOTANK_CODE -3
#define LOG_HARDWARECOUNTER_ERROR_MESSAGE "PCNR returned error"
#define LOG_HARDWARECOUNTER_ERROR_CODE -4
#define LOG_SENSORMODE_UNKNOWN "Unknown sensor mode requested"
#define LOG_SENSORMODE_UNKNOWN_CODE -5
#define LOG_SENSOR_MISSING_ERROR_MESSAGE "1Wire: sensors found"
#define LOG_SENSOR_MISSING_ERROR_CODE -6
#define LOG_PUMP_AND_DOWNLOADMODE "Download mode, ignoring pump request"
#define LOG_PUMP_AND_DOWNLOADMODE_CODE 2
#define LOG_VERY_COLD_WATER "Water potentially frozen, ignoring pump request"
#define LOG_VERY_COLD_WATER_CODE -7
#define LOG_PUMP_FULLTANK_MESSAGE "Water Sensor distance unrealistic"
#define LOG_PUMP_FULLTANK_CODE 3
//msg is dynamic defined
#define LOG_PUMP_INEFFECTIVE -4
#define LOG_PUMP_STARTED_CODE 10
#define LOG_DEBUG_CODE 1001
#define LOG_SLEEP_NIGHT 100
#define LOG_SLEEP_DAY 101
#define LOG_SLEEP_LOWVOLTAGE 502
#define LOG_SLEEP_CYCLE 102
#define LOG_MISSING_PUMP -4
#define LOG_BOOT_ERROR_DETECTION 10000
#define LOG_BOOT_ERROR_IMG_UNDEFINED (LOG_BOOT_ERROR_DETECTION + 1)
#define LOG_BOOT_ERROR_IMG_NEW (LOG_BOOT_ERROR_DETECTION + 2)
#define LOG_BOOT_ERROR_IMG_INVALID (LOG_BOOT_ERROR_DETECTION + 3)
#define LOG_BOOT_ERROR_IMG_VALID (LOG_BOOT_ERROR_DETECTION + 4)
#define LOG_BOOT_ERROR_IMG_PENDING_VERIFY (LOG_BOOT_ERROR_DETECTION + 5)
#define LOG_SOLAR_CHARGER_MISSING 300
#endif

28
esp32/include/MQTTUtils.h Normal file
View File

@@ -0,0 +1,28 @@
#ifndef MQTTUtils_h
#define MQTTUtils_h
#include <Homie.h>
#define LOG_TOPIC "log\0"
#define TEST_TOPIC "roundtrip\0"
#define BACKUP_TOPIC "$implementation/config/backup/set\0"
#define CONFIG_FILE "/homie/config.json"
#define CONFIG_FILE_BACKUP "/homie/config.json.bak"
#define getTopic(test, topic) \
char *topic = new char[strlen(Homie.getConfiguration().mqtt.baseTopic) + strlen(Homie.getConfiguration().deviceId) + 1 + strlen(test) + 1]; \
strcpy(topic, Homie.getConfiguration().mqtt.baseTopic); \
strcat(topic, Homie.getConfiguration().deviceId); \
strcat(topic, "/"); \
strcat(topic, test);
bool aliveWasRead();
bool mqttReady();
void startMQTTRoundtripTest();
void log(int level, String message, int code);
void mqttWrite(HomieNode* target,const char* key, String value);
void mqttWrite(HomieNode* target,String key, String value);
#endif

View File

@@ -0,0 +1,8 @@
#ifndef MATHUTILS_H
#define MATHUTILS_H
bool equalish(double x, double y);
double mapf(double x, double in_min, double in_max, double out_min, double out_max);
#endif

View File

@@ -4,83 +4,119 @@
* @brief Abstraction to handle the Sensors
* @version 0.1
* @date 2020-05-27
*
*
* @copyright Copyright (c) 2020
*
*
*/
#ifndef PLANT_CTRL_H
#define PLANT_CTRL_H
#include "HomieTypes.h"
#include <HomieNode.hpp>
#include "ControllerConfiguration.h"
#include "RunningMedian.h"
#include "MathUtils.h"
#include "MQTTUtils.h"
#include "LogDefines.h"
#define ANALOG_REREADS 5
#define MOISTURE_MEASUREMENT_DURATION 400 /** ms */
#define PWM_FREQ 50000
#define PWM_BITS 8
class Plant
{
private:
RunningMedian moistureRaw = RunningMedian(5);
HomieNode *mPlant = NULL;
HomieInternals::PropertyInterface mPump;
RunningMedian mMoisture_raw = RunningMedian(ANALOG_REREADS);
RunningMedian mTemperature_degree = RunningMedian(ANALOG_REREADS);
int mPinSensor = 0; /**< Pin of the moist sensor */
int mPinPump = 0; /**< Pin of the pump */
bool mConnected = false;
int mPlantId = -1;
SENSOR_MODE mSensorMode;
public:
PlantSettings_t *mSetting;
/**
* @brief Construct a new Plant object
*
*
* @param pinSensor Pin of the Sensor to use to measure moist
* @param pinPump Pin of the Pump to use
*/
Plant(int pinSensor, int pinPump,
int plantId,
HomieNode *plant,
PlantSettings_t *setting);
PlantSettings_t *setting, SENSOR_MODE mode);
void postMQTTconnection(void);
void advertise(void);
/**
* @brief Measure a new analog moister value
*
*/
void addSenseValue(void);
// for sensor that might take any time
void blockingMoistureMeasurement(void);
// for sensor that need a start and a end in defined timing
void startMoistureMeasurement(void);
void stopMoistureMeasurement(void);
void deactivatePump(void);
void activatePump(void);
String getSensorModeString()
{
SENSOR_MODE mode = getSensorMode();
return SENSOR_STRING[mode];
}
bool isTimerOnly()
{
long current = this->mSetting->pSensorDry->get();
return equalish(current, TIMER_ONLY);
}
bool isHydroponic()
{
long current = this->mSetting->pSensorDry->get();
return equalish(current, HYDROPONIC_MODE);
}
SENSOR_MODE getSensorMode()
{
return mSensorMode;
}
/**
* @brief Check if a plant is too dry and needs some water.
*
* @return true
* @return false
*
* @return true
* @return false
*/
bool isPumpRequired()
{
bool isDry = getCurrentMoisture() > getSettingsMoisture();
if (isHydroponic() || isTimerOnly())
{
// hydroponic only uses timer based controll
return true;
}
bool isDry = getCurrentMoisturePCT() < getTargetMoisturePCT();
bool isActive = isPumpTriggerActive();
return isDry && isActive;
}
bool isPumpTriggerActive()
{
return this->mSetting->pSensorDry->get() != DEACTIVATED_PLANT;
long current = this->mSetting->pSensorDry->get();
return !equalish(current, DEACTIVATED_PLANT);
}
float getCurrentMoisture()
{
if(moistureRaw.getCount()==0){
return MISSING_SENSOR;
}
return this->moistureRaw.getMedian();
}
long getSettingsMoisture()
float getTargetMoisturePCT()
{
if (this->mSetting->pSensorDry != NULL)
if (isPumpTriggerActive())
{
return this->mSetting->pSensorDry->get();
}
@@ -90,37 +126,95 @@ public:
}
}
float getCurrentMoisturePCT()
{
switch (getSensorMode())
{
case NONE:
return DEACTIVATED_PLANT;
case FREQUENCY_MOD_RESISTANCE_PROBE:
return mapf(mMoisture_raw.getMedian(), MOIST_SENSOR_MIN_FRQ, MOIST_SENSOR_MAX_FRQ, 0, 100);
case ANALOG_RESISTANCE_PROBE:
return mapf(mMoisture_raw.getMedian(), ANALOG_SENSOR_MAX_MV, ANALOG_SENSOR_MIN_MV, 0, 100);
}
return MISSING_SENSOR;
}
float getCurrentMoistureRaw()
{
if (getSensorMode() == FREQUENCY_MOD_RESISTANCE_PROBE)
{
if (mMoisture_raw.getMedian() < MOIST_SENSOR_MIN_FRQ)
{
return MISSING_SENSOR;
}
else if (mMoisture_raw.getMedian() > MOIST_SENSOR_MAX_FRQ)
{
return SHORT_CIRCUIT_MODE;
}
}
return mMoisture_raw.getMedian();
}
HomieInternals::SendingPromise &setProperty(const String &property) const
{
return mPlant->setProperty(property);
}
bool switchHandler(const HomieRange &range, const String &value);
void init(void);
void initSensors(void);
/** @fn bool isInCooldown(long sinceLastActivation)
* @brief determine, if the plant was recently casted
* @param sinceLastActivation timestamp of last time
*/
bool isInCooldown(long sinceLastActivation)
long getCooldownInSeconds()
{
/* if the time difference is greater than one month, we know these are initial values */
if (sinceLastActivation > (60 * 60 * 24 * 30))
{
return false;
}
return (getCooldownInSeconds() > sinceLastActivation);
return this->mSetting->pPumpCooldownInSeconds->get();
}
long getCooldownInSeconds(){
return this->mSetting->pPumpCooldownInHours->get()*60*60;
/**
* @brief Get the Hours when pumping should start
*
* @return hour
*/
int getHoursStart()
{
return this->mSetting->pPumpAllowedHourRangeStart->get();
}
/**
* @brief Get the Hours when pumping should end
*
* @return hour
*/
int getHoursEnd()
{
return this->mSetting->pPumpAllowedHourRangeEnd->get();
}
bool isAllowedOnlyAtLowLight(void)
{
if (this->isHydroponic())
{
return false;
}
return this->mSetting->pPumpOnlyWhenLowLight->get();
}
void publishState(int stateNumber, String stateString);
bool switchHandler(const HomieRange &range, const String &value);
void setSwitchHandler(HomieInternals::PropertyInputHandler f);
long getPumpDuration()
{
return this->mSetting->pPumpDuration->get();
}
long getPumpMl()
{
return this->mSetting->pPumpMl->get();
}
};
#endif

View File

@@ -0,0 +1,4 @@
#pragma once
long getCurrentTime(void);
int getCurrentHour(void);

177
esp32/include/ulp-pwm.h Normal file
View File

@@ -0,0 +1,177 @@
#ifndef ULP_PWM_h
#define ILP_PWM_h
#include <Arduino.h>
#include "driver/rtc_io.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/rtc.h"
#include "esp32/ulp.h"
#include "ControllerConfiguration.h"
#define LBL_START 1
#define LBL_DELAY_ON 2
#define LBL_DELAY_OFF 3
#define LBL_SKIP_ON 4
#define LBL_SKIP_OFF 5
#define REGISTER_DELAY_LOOP_COUNTER R0
#define REGISTER_TICKS_ON R1
#define REGISTER_TICKS_OFF R2
#define TOTAL_TICKS_DELAY 255
#define PIN TIMED_LIGHT_PIN
//support 20 vars
const size_t ulp_var_offset = CONFIG_ULP_COPROC_RESERVE_MEM - 20;
//use the first for dimming
const size_t ulp_dimm_offset = ulp_var_offset + 1;
const size_t ulp_alive_offset = ulp_var_offset + 2;
//see https://github.com/perseus086/ESP32-notes
const uint32_t rtc_bit[40] = {
25, //gpio0
0, //gpio1
26, //gpio2
0, //gpio3
24, //gpio4
0, //gpio5
0, //gpio6
0, //gpio7
0, //gpio8
0, //gpio9
0, //gpio10
0, //gpio11
29, //gpio12
28, //gpio13
30, //gpio14
27, //gpio15
0, //gpio16
31, //gpio17
0, //gpio18
0, //gpio19
0, //gpio20
0, //gpio21
0, //gpio22
0, //gpio23
0, //gpio24
20, //gpio25
21, //gpio26
0, //gpio27
0, //gpio28
0, //gpio29
0, //gpio30
0, //gpio31
23, //gpio32
22, //gpio33
18, //gpio34
19, //gpio35
14, //gpio36
15, //gpio37
16, //gpio38
17 //gpio39
};
static inline void ulp_internal_data_write(size_t offset, uint16_t value)
{
if (offset >= CONFIG_ULP_COPROC_RESERVE_MEM || offset <= ulp_var_offset)
{
Serial.print("Invalid ULP offset detected, refusing write!");
Serial.print(offset);
Serial.print("-");
Serial.print(ulp_var_offset);
Serial.print("-");
Serial.println(CONFIG_ULP_COPROC_RESERVE_MEM);
return;
}
else
{
RTC_SLOW_MEM[offset] = value;
}
}
static inline uint16_t ulp_internal_data_read(size_t offset)
{
if (offset >= CONFIG_ULP_COPROC_RESERVE_MEM || offset <= ulp_var_offset)
{
Serial.print("Invalid ULP offset detected");
Serial.print(offset);
Serial.print("-");
Serial.print(ulp_var_offset);
Serial.print("-");
Serial.println(CONFIG_ULP_COPROC_RESERVE_MEM);
}
return RTC_SLOW_MEM[offset] & 0xffff;
}
void ulp_internal_start(void)
{
rtc_gpio_init(PIN);
rtc_gpio_set_direction(PIN, RTC_GPIO_MODE_OUTPUT_ONLY);
rtc_gpio_set_level(PIN, 0);
const uint32_t rtc_gpio = rtc_io_number_get(PIN);
// Define ULP program
const ulp_insn_t ulp_prog[] = {
M_LABEL(LBL_START),
I_MOVI(REGISTER_DELAY_LOOP_COUNTER, 1),
I_MOVI(REGISTER_TICKS_ON, 0),
I_ST(REGISTER_DELAY_LOOP_COUNTER, REGISTER_TICKS_ON, ulp_alive_offset), //store 1 with 0 offset into alive
I_LD(REGISTER_TICKS_ON, REGISTER_TICKS_ON, ulp_dimm_offset), //REGISTER_TICKS_ON = RTC_DATA[0+ulp_dimm_offset]
//in total there is always 255 delay loop iterations, but in different duty cycle
I_MOVI(REGISTER_TICKS_OFF, TOTAL_TICKS_DELAY),
I_SUBR(REGISTER_TICKS_OFF, REGISTER_TICKS_OFF, REGISTER_TICKS_ON),
//on phase
I_MOVR(REGISTER_DELAY_LOOP_COUNTER, REGISTER_TICKS_ON),
M_BL(LBL_SKIP_ON, 1), //if never on, skip on phase
I_WR_REG(RTC_GPIO_OUT_REG, rtc_gpio, rtc_gpio, HIGH), // on
M_LABEL(LBL_DELAY_ON),
I_DELAY(1), //wait 1 clock
I_SUBI(REGISTER_DELAY_LOOP_COUNTER, REGISTER_DELAY_LOOP_COUNTER, 1), // REGISTER_DELAY_LOOP_COUNTER--
M_BGE(LBL_DELAY_ON, 1), //if time left, goto start of on loop
M_LABEL(LBL_SKIP_ON),
//off phase
I_MOVR(REGISTER_DELAY_LOOP_COUNTER, REGISTER_TICKS_OFF),
M_BL(LBL_SKIP_OFF, 1), //if never off, skip on phase
I_WR_REG(RTC_GPIO_OUT_REG, rtc_gpio, rtc_gpio, LOW), // on
M_LABEL(3),
I_DELAY(1), //wait 1 clock
I_SUBI(REGISTER_DELAY_LOOP_COUNTER, REGISTER_DELAY_LOOP_COUNTER, 1), // REGISTER_DELAY_LOOP_COUNTER--
M_BGE(3, 1), //if time left, goto start of on loop
M_LABEL(LBL_SKIP_OFF),
M_BX(LBL_START),
};
// Run ULP program
size_t size = sizeof(ulp_prog) / sizeof(ulp_insn_t);
assert(size < ulp_var_offset && "ULP_DATA_OFFSET needs to be greater or equal to the program size");
esp_err_t error = ulp_process_macros_and_load(0, ulp_prog, &size);
Serial.print("ULP bootstrap status ");
Serial.println(error);
//allow glitchless start
ulp_internal_data_write(ulp_alive_offset, 0);
error = ulp_run(0);
Serial.print("ULP start status ");
Serial.println(error);
}
static inline void ulp_pwm_set_level(uint8_t level)
{
ulp_internal_data_write(ulp_dimm_offset, level);
}
static inline void ulp_pwm_init()
{
ulp_internal_data_write(ulp_alive_offset, 0);
delay(10);
if (ulp_internal_data_read(ulp_alive_offset) == 0)
{
ulp_internal_start();
}
}
#endif

View File

@@ -9,18 +9,35 @@
; https://docs.platformio.org/page/projectconf.html
[env:esp32doit-devkit-v1]
platform = espressif32
platform = espressif32@6.3.2
board = esp32doit-devkit-v1
framework = arduino
build_flags = -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
-DPLANT0_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DPLANT1_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DPLANT2_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DPLANT3_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DPLANT4_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DPLANT5_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DPLANT6_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DTIMED_LIGHT_PIN=CUSTOM1_PIN5
-DFLOWMETER_PIN=CUSTOM1_PIN1
-DANALOG_WATER=GPIO_NUM_34
; Optional: Compatibilitymode for hardware revision 0.7
;-DHWREVISION07=1
board_build.partitions = defaultWithSmallerSpiffs.csv
;#https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html
; the latest development brankitchen-lightch (convention V3.0.x)
lib_deps = ArduinoJson@6.16.1
https://github.com/homieiot/homie-esp8266.git#v3.0
OneWire
DallasTemperature
lib_deps = bblanchon/ArduinoJson@^6.20.1
paulstoffregen/OneWire@^2.3.6
milesburton/DallasTemperature@^3.11.0
pololu/VL53L0X@^1.3.1
https://github.com/homieiot/homie-esp8266.git#develop
[platformio]
extra_configs = custom_platformio.ini
extra_configs = custom_platformio.ini

File diff suppressed because it is too large Load Diff

6
esp32/src/CMakeLists.txt Normal file
View File

@@ -0,0 +1,6 @@
# This file was automatically generated for projects
# without default 'CMakeLists.txt' file.
FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/src/*.*)
idf_component_register(SRCS ${app_sources})

View File

@@ -24,9 +24,10 @@
#define DS2438MODEL 0x26
DS2438::DS2438(OneWire *ow, float currentShunt = 1.0f) {
DS2438::DS2438(OneWire *ow, float currentShunt, int retryOnCRCError) {
_ow = ow;
_currentShunt = currentShunt;
_retryOnCRCError = retryOnCRCError;
};
void DS2438::begin(){
@@ -34,9 +35,9 @@ void DS2438::begin(){
_ow->reset_search();
memset(searchDeviceAddress,0, 8);
_temperature = 0;
_voltageA = 0.0;
_voltageB = 0.0;
_temperature.clear();
_voltageA.clear();
_voltageB.clear();
_error = true;
_mode = (DS2438_MODE_CHA | DS2438_MODE_CHB | DS2438_MODE_TEMPERATURE);
@@ -71,10 +72,20 @@ bool DS2438::validFamily(const uint8_t* deviceAddress) {
}
}
void DS2438::update() {
uint8_t data[9];
void DS2438::updateMultiple(){
for(int i = 0;i< DS2438_MEDIAN_COUNT; i++){
update(i==0);
if(_error){
return;
}
delay(DS2438_MEDIAN_DELAY);
}
}
void DS2438::update(bool firstIteration) {
uint8_t data[9];
_error = true;
if(!isFound()){
return;
}
@@ -92,10 +103,10 @@ void DS2438::update() {
}
if (doTemperature) {
_temperature = (double)(((((int16_t)data[2]) << 8) | (data[1] & 0x0ff)) >> 3) * 0.03125;
_temperature.add((double)(((((int16_t)data[2]) << 8) | (data[1] & 0x0ff)) >> 3) * 0.03125);
}
if (_mode & DS2438_MODE_CHA) {
_voltageA = (((data[4] << 8) & 0x00300) | (data[3] & 0x0ff)) / 100.0;
_voltageA.add((((data[4] << 8) & 0x00300) | (data[3] & 0x0ff)) / 100.0);
}
}
if (_mode & DS2438_MODE_CHB) {
@@ -112,33 +123,35 @@ void DS2438::update() {
int16_t upperByte = ((int16_t)data[2]) << 8;
int16_t lowerByte = data[1] >> 3;
int16_t fullByte = (upperByte | lowerByte);
_temperature = ((double)fullByte) * 0.03125;
_temperature.add(((double)fullByte) * 0.03125);
}
_voltageB = (((data[4] << 8) & 0x00300) | (data[3] & 0x0ff)) / 100.0;
_voltageB.add((((data[4] << 8) & 0x00300) | (data[3] & 0x0ff)) / 100.0);
}
int16_t upperByte = ((int16_t)data[6]) << 8;
int16_t lowerByte = data[5];
int16_t fullByte = (int16_t)(upperByte | lowerByte);
float fullByteb = fullByte;
_current = (fullByteb) / ((4096.0f * _currentShunt));
_current.add((fullByteb) / ((4096.0f * _currentShunt)));
if(firstIteration){
if (readPage(1, data)){
PageOne_t *pOne = (PageOne_t *) data;
_ICA = pOne->ICA;
}
if (readPage(7, data)){
PageSeven_t *pSeven = (PageSeven_t *) data;
_CCA = pSeven->CCA0 | ((int16_t) pSeven->CCA1) << 8;
_DCA = pSeven->DCA0 | ((int16_t) pSeven->DCA1) << 8;
}
}
_error = false;
if (readPage(1, data)){
PageOne_t *pOne = (PageOne_t *) data;
_ICA = pOne->ICA;
}
if (readPage(7, data)){
PageSeven_t *pSeven = (PageSeven_t *) data;
_CCA = pSeven->CCA0 | ((int16_t) pSeven->CCA1) << 8;
_DCA = pSeven->DCA0 | ((int16_t) pSeven->DCA1) << 8;
}
}
double DS2438::getTemperature() {
return _temperature;
return _temperature.getMedian();
}
float DS2438::getAh(){
@@ -160,16 +173,16 @@ long DS2438::getCCA(){
float DS2438::getVoltage(int channel) {
if (channel == DS2438_CHA) {
return _voltageA;
return _voltageA.getMedian();
} else if (channel == DS2438_CHB) {
return _voltageB;
return _voltageB.getMedian();
} else {
return 0.0;
}
}
float DS2438::getCurrent() {
return _current;
return _current.getMedian();
}
boolean DS2438::isError() {
@@ -234,22 +247,26 @@ void DS2438::writePage(int page, uint8_t *data) {
}
boolean DS2438::readPage(int page, uint8_t *data) {
//TODO if all data is 0 0 is a valid crc, but most likly not as intended
_ow->reset();
_ow->select(_address);
_ow->write(DS2438_RECALL_MEMORY_COMMAND, 0);
if ((page >= PAGE_MIN) && (page <= PAGE_MAX)) {
bool valid = false;
for(int retry = 0;retry < this->_retryOnCRCError && !valid; retry ++){
//TODO if all data is 0 0 is a valid crc, but most likly not as intended
_ow->reset();
_ow->select(_address);
_ow->write(DS2438_RECALL_MEMORY_COMMAND, 0);
if ((page >= PAGE_MIN) && (page <= PAGE_MAX)) {
_ow->write(page, 0);
} else {
return false;
}
_ow->reset();
_ow->select(_address);
_ow->write(DS2438_READ_SCRATCHPAD_COMMAND, 0);
_ow->write(page, 0);
} else {
return false;
for (int i = 0; i < 9; i++){
data[i] = _ow->read();
}
valid = _ow->crc8(data, 8) == data[8];
}
_ow->reset();
_ow->select(_address);
_ow->write(DS2438_READ_SCRATCHPAD_COMMAND, 0);
_ow->write(page, 0);
for (int i = 0; i < 9; i++){
data[i] = _ow->read();
}
return _ow->crc8(data, 8) == data[8];
return valid;
}

81
esp32/src/FileUtils.cpp Normal file
View File

@@ -0,0 +1,81 @@
#include <Homie.h>
#include "FileUtils.h"
bool deleteFile(const char *source)
{
Serial << "deleting file " << source << endl;
if (!SPIFFS.begin())
{
return false;
}
bool deleted = SPIFFS.remove(source);
if (deleted)
{
Serial << "Deleted " << source << endl;
}
else
{
Serial << "Could not delete " << source << endl;
}
return deleted;
}
void printFile(const char *source)
{
Serial << "printing file " << source << endl;
if (!SPIFFS.begin())
{
Serial << "could not start spiffs " << source << endl;
return;
}
File file = SPIFFS.open(source, FILE_READ);
if (!file)
{
Serial << "could not start open " << source << endl;
return;
}
Serial << file.readString() << endl;
Serial << "Finished printing file " << source << endl;
file.close();
}
bool doesFileExist(const char *source)
{
Serial << "checking if file exist " << source << endl;
if (!SPIFFS.begin())
{
return false;
}
bool exists = SPIFFS.exists(source);
Serial << "File " << source << (exists ? "" : " not") << " found " << endl;
return exists;
}
bool copyFile(const char *source, const char *target)
{
Serial << "copy started " << source << " -> " << target << endl;
if (!SPIFFS.begin())
{
return false;
}
File file = SPIFFS.open(source, FILE_READ);
File file2 = SPIFFS.open(target, FILE_WRITE);
Serial.flush();
if (!file)
{
Serial << "There was an error opening " << source << " for reading" << endl;
return false;
}
if (!file2)
{
Serial << "There was an error opening " << target << " for reading" << endl;
file.close();
return false;
}
file2.println(file.readString());
Serial << "copy finished " << source << " -> " << target << endl;
file.close();
file2.close();
return true;
}

98
esp32/src/MQTTUtils.cpp Normal file
View File

@@ -0,0 +1,98 @@
#include "MQTTUtils.h"
#include "FileUtils.h"
#include "LogDefines.h"
bool volatile mAliveWasRead = false;
void log(int level, String message, int statusCode)
{
String buffer;
StaticJsonDocument<200> doc;
// Read the current time
time_t now; // this is the epoch
tm tm; // the structure tm holds time information in a more convient way
doc["level"] = level;
doc["message"] = message;
doc["statusCode"] = statusCode;
time(&now);
localtime_r(&now, &tm);
if (tm.tm_year > (2021 - 1970)) { /* Only add the time, if we have at least 2021 */
doc["time"] = String(String(1900 + tm.tm_year) + "-" + String(tm.tm_mon + 1) + "-" + String(tm.tm_mday) +
" " + String(tm.tm_hour) + ":" + String(tm.tm_min) + ":" + String(tm.tm_sec));
}
serializeJson(doc, buffer);
if (mAliveWasRead)
{
getTopic(LOG_TOPIC, logTopic)
Homie.getMqttClient()
.subscribe(logTopic, 2);
Homie.getMqttClient().publish(logTopic, 2, false, buffer.c_str());
delete logTopic;
}
Serial << statusCode << "@" << level << " : " << message << endl;
Serial.flush();
}
void mqttWrite(HomieNode* target,String key, String value){
if(mAliveWasRead){
target->setProperty(key).send(value);
}
}
void mqttWrite(HomieNode* target,const char* key, String value){
if(aliveWasRead()){
target->setProperty(key).send(value);
}
}
void onMQTTMessage(char *incoming, char *payload, AsyncMqttClientMessageProperties properties, size_t len, size_t index, size_t total)
{
getTopic(TEST_TOPIC, testTopic);
if (strcmp(incoming, testTopic) == 0)
{
mAliveWasRead = true;
}
delete testTopic;
getTopic(BACKUP_TOPIC, backupTopic);
if (strcmp(incoming, backupTopic) == 0)
{
if (strcmp(payload, "true") == 0)
{
bool backupSucessful = copyFile(CONFIG_FILE, CONFIG_FILE_BACKUP);
printFile(CONFIG_FILE_BACKUP);
if (backupSucessful)
{
log(LOG_LEVEL_INFO, LOG_BACKUP_SUCCESSFUL, LOG_BACKUP_SUCCESSFUL_CODE);
}
else
{
log(LOG_LEVEL_INFO, LOG_BACKUP_FAILED, LOG_BACKUP_FAILED_CODE);
}
Homie.getMqttClient().publish(backupTopic, 2, true, "false");
}
}
delete backupTopic;
}
bool aliveWasRead(){
return mAliveWasRead;
}
void startMQTTRoundtripTest(){
{
getTopic(TEST_TOPIC, testopic)
Homie.getMqttClient()
.subscribe(testopic, 2);
Homie.getMqttClient().publish(testopic, 2, false, "ping");
Homie.getMqttClient().onMessage(onMQTTMessage);
getTopic(BACKUP_TOPIC, backupTopic)
Homie.getMqttClient()
.subscribe(backupTopic, 2);
}
}

12
esp32/src/MathUtil.cpp Normal file
View File

@@ -0,0 +1,12 @@
#include "MathUtils.h"
#include <Arduino.h>
bool equalish(double x, double y)
{
return (abs(x - y) < 0.5);
}
double mapf(double x, double in_min, double in_max, double out_min, double out_max)
{
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}

View File

@@ -1,62 +1,173 @@
/**
* @file PlantCtrl.cpp
* @author your name (you@domain.com)
* @brief
* @brief
* @version 0.1
* @date 2020-05-27
*
*
* @copyright Copyright (c) 2020
*
*
*/
#include "PlantCtrl.h"
#include "ControllerConfiguration.h"
#include "TimeUtils.h"
#include "driver/pcnt.h"
#include "MQTTUtils.h"
Plant::Plant(int pinSensor, int pinPump, int plantId, HomieNode *plant, PlantSettings_t *setting)
Plant::Plant(int pinSensor, int pinPump, int plantId, HomieNode *plant, PlantSettings_t *setting, SENSOR_MODE mode)
{
this->mPinSensor = pinSensor;
this->mPinPump = pinPump;
this->mPlant = plant;
this->mSetting = setting;
this->mPlantId = plantId;
this->mSensorMode = mode;
}
void Plant::init(void)
{
/* Initialize Home Settings validator */
this->mSetting->pSensorDry->setDefaultValue(DEACTIVATED_PLANT);
this->mSetting->pSensorDry->setValidator([](long candidate) {
return (((candidate >= 0) && (candidate <= 4095)) || candidate == DEACTIVATED_PLANT);
});
this->mSetting->pPumpAllowedHourRangeStart->setDefaultValue(8); // start at 8:00
this->mSetting->pPumpAllowedHourRangeStart->setValidator([](long candidate) {
return ((candidate >= 0) && (candidate <= 23));
});
this->mSetting->pPumpAllowedHourRangeEnd->setDefaultValue(20); // stop pumps at 20:00
this->mSetting->pPumpAllowedHourRangeEnd->setValidator([](long candidate) {
return ((candidate >= 0) && (candidate <= 23));
});
this->mSetting->pPumpOnlyWhenLowLight->setDefaultValue(true);
this->mSetting->pPumpCooldownInHours->setDefaultValue(20); // minutes
this->mSetting->pPumpCooldownInHours->setValidator([](long candidate) {
return ((candidate >= 0) && (candidate <= 1024));
});
this->mSetting->pSensorDry->setValidator([](long candidate)
{ return (((candidate >= 0.0) && (candidate <= 100.0)) || equalish(candidate, DEACTIVATED_PLANT) || equalish(candidate, HYDROPONIC_MODE) || equalish(candidate, TIMER_ONLY)); });
this->mSetting->pPumpAllowedHourRangeStart->setDefaultValue(5); // start at 5:00 UTC or 7:00 ECST
this->mSetting->pPumpAllowedHourRangeStart->setValidator([](long candidate)
{ return ((candidate >= 0) && (candidate <= 23)); });
this->mSetting->pPumpAllowedHourRangeEnd->setDefaultValue(18); // stop pumps at 18 UTC or 20:00 ECST
this->mSetting->pPumpAllowedHourRangeEnd->setValidator([](long candidate)
{ return ((candidate >= 0) && (candidate <= 23)); });
this->mSetting->pPumpOnlyWhenLowLight->setDefaultValue(false);
this->mSetting->pPumpCooldownInSeconds->setDefaultValue(60 * 60); // 1 hour
this->mSetting->pPumpCooldownInSeconds->setValidator([](long candidate)
{ return (candidate >= 0); });
this->mSetting->pPumpDuration->setDefaultValue(30);
this->mSetting->pPumpDuration->setValidator([](long candidate)
{ return ((candidate >= 0) && (candidate <= 1000)); });
this->mSetting->pPumpMl->setDefaultValue(1000);
this->mSetting->pPumpMl->setValidator([](long candidate)
{ return ((candidate >= 0) && (candidate <= 5000)); });
this->mSetting->pPumpPowerLevel->setDefaultValue(100);
this->mSetting->pPumpPowerLevel->setValidator([](long candidate)
{ return ((candidate >= 0) && (candidate <= 100)); });
/* Initialize Hardware */
pinMode(this->mPinPump, OUTPUT);
pinMode(this->mPinSensor, ANALOG);
digitalWrite(this->mPinPump, LOW);
ledcSetup(this->mPlantId, PWM_FREQ, PWM_BITS);
ledcAttachPin(this->mPinPump, this->mPlantId);
ledcWrite(this->mPlantId, 0);
pinMode(this->mPinSensor, INPUT);
}
void Plant::addSenseValue(void)
{
int raw = analogRead(this->mPinSensor);
if(raw < MOIST_SENSOR_MAX_ADC && raw > MOIST_SENSOR_MIN_ADC){
this->moistureRaw.add(raw);
} else {
int plantId = this->mPlantId;
Serial << "ignoring sensor " << plantId << " value due to being strange " << raw << endl;
void Plant::initSensors(void)
{
switch (getSensorMode())
{
case FREQUENCY_MOD_RESISTANCE_PROBE:
{
pcnt_unit_t unit = (pcnt_unit_t)(PCNT_UNIT_0 + this->mPlantId);
pcnt_config_t pcnt_config = {}; // Instancia PCNT config
pcnt_config.pulse_gpio_num = this->mPinSensor; // Configura GPIO para entrada dos pulsos
pcnt_config.ctrl_gpio_num = PCNT_PIN_NOT_USED; // Configura GPIO para controle da contagem
pcnt_config.unit = unit; // Unidade de contagem PCNT - 0
pcnt_config.channel = PCNT_CHANNEL_0; // Canal de contagem PCNT - 0
pcnt_config.counter_h_lim = INT16_MAX; // Limite maximo de contagem - 20000
pcnt_config.pos_mode = PCNT_COUNT_INC; // Incrementa contagem na subida do pulso
pcnt_config.neg_mode = PCNT_COUNT_DIS; // Incrementa contagem na descida do pulso
pcnt_config.lctrl_mode = PCNT_MODE_KEEP; // PCNT - modo lctrl desabilitado
pcnt_config.hctrl_mode = PCNT_MODE_KEEP; // PCNT - modo hctrl - se HIGH conta incrementando
pcnt_unit_config(&pcnt_config); // Configura o contador PCNT
pcnt_counter_pause(unit); // Pausa o contador PCNT
pcnt_counter_clear(unit); // Zera o contador PCNT
break;
}
case ANALOG_RESISTANCE_PROBE:
{
adcAttachPin(this->mPinSensor);
break;
}
case NONE:
{
// do nothing
break;
}
}
}
void Plant::blockingMoistureMeasurement(void)
{
switch (getSensorMode())
{
case ANALOG_RESISTANCE_PROBE:
{
for (int i = 0; i < ANALOG_REREADS; i++)
{
this->mMoisture_raw.add(analogReadMilliVolts(this->mPinSensor));
delay(5);
}
break;
}
case FREQUENCY_MOD_RESISTANCE_PROBE:
case NONE:
{
// nothing to do here
break;
}
}
}
void Plant::startMoistureMeasurement(void)
{
switch (getSensorMode())
{
case FREQUENCY_MOD_RESISTANCE_PROBE:
{
pcnt_unit_t unit = (pcnt_unit_t)(PCNT_UNIT_0 + this->mPlantId);
pcnt_counter_resume(unit);
break;
}
case ANALOG_RESISTANCE_PROBE:
case NONE:
{
// do nothing here
}
}
}
void Plant::stopMoistureMeasurement(void)
{
switch (getSensorMode())
{
case FREQUENCY_MOD_RESISTANCE_PROBE:
{
int16_t pulses;
pcnt_unit_t unit = (pcnt_unit_t)(PCNT_UNIT_0 + this->mPlantId);
pcnt_counter_pause(unit);
esp_err_t result = pcnt_get_counter_value(unit, &pulses);
pcnt_counter_clear(unit);
if (result != ESP_OK)
{
log(LOG_LEVEL_ERROR, LOG_HARDWARECOUNTER_ERROR_MESSAGE, LOG_HARDWARECOUNTER_ERROR_CODE);
this->mMoisture_raw.clear();
this->mMoisture_raw.add(-1);
}
else
{
this->mMoisture_raw.add(pulses * (1000 / MOISTURE_MEASUREMENT_DURATION));
}
break;
}
case ANALOG_RESISTANCE_PROBE:
case NONE:
{
break;
}
}
}
@@ -65,11 +176,33 @@ void Plant::postMQTTconnection(void)
const String OFF = String("OFF");
this->mConnected = true;
this->mPlant->setProperty("switch").send(OFF);
float pct = getCurrentMoisturePCT();
float raw = getCurrentMoistureRaw();
if (equalish(raw, MISSING_SENSOR))
{
pct = 0;
}
if (pct < 0)
{
pct = 0;
}
if (pct > 100)
{
pct = 100;
}
this->mPlant->setProperty("moist").send(String(pct));
this->mPlant->setProperty("sensormode").send(getSensorModeString());
this->mPlant->setProperty("moistraw").send(String(raw));
this->mPlant->setProperty("moisttrigger").send(String(getTargetMoisturePCT()));
}
void Plant::deactivatePump(void)
{
digitalWrite(this->mPinPump, LOW);
int plantId = this->mPlantId;
Serial << "deactivating pump " << plantId << endl;
ledcWrite(this->mPlantId, 0);
if (this->mConnected)
{
const String OFF = String("OFF");
@@ -77,39 +210,69 @@ void Plant::deactivatePump(void)
}
}
void Plant::activatePump(void)
void Plant::publishState(int stateNumber, String stateString)
{
digitalWrite(this->mPinPump, HIGH);
String buffer;
StaticJsonDocument<200> doc;
if (this->mConnected)
{
const String OFF = String("ON");
this->mPlant->setProperty("switch").send(OFF);
doc["number"] = stateNumber;
doc["message"] = stateString;
serializeJson(doc, buffer);
this->mPlant->setProperty("state").send(buffer.c_str());
}
}
void Plant::activatePump(void)
{
int plantId = this->mPlantId;
Serial << "activating pump " << plantId << endl;
long desiredPowerLevelPercent = this->mSetting->pPumpPowerLevel->get();
ledcWrite(this->mPlantId, desiredPowerLevelPercent * PWM_BITS);
if (this->mConnected)
{
const String ON = String("ON");
this->mPlant->setProperty("switch").send(ON);
this->mPlant->setProperty("lastPump").send(String(getCurrentTime()));
}
}
bool Plant::switchHandler(const HomieRange &range, const String &value)
{
if (range.isRange)
{
return false; // only one switch is present
}
if ((value.equals("ON")) || (value.equals("On")) || (value.equals("on")) || (value.equals("true")))
{
this->activatePump();
return true;
}
else if ((value.equals("OFF")) || (value.equals("Off")) || (value.equals("off")) || (value.equals("false")))
{
this->deactivatePump();
return true;
}
else
{
return false;
}
}
void Plant::setSwitchHandler(HomieInternals::PropertyInputHandler f)
{
this->mPump.settable(f);
}
void Plant::advertise(void)
{
// Advertise topics
this->mPlant->advertise("switch").setName("Pump 1").setDatatype("boolean");
//FIXME add .settable(this->switchHandler)
this->mPlant->advertise("moist").setName("Percent").setDatatype("number").setUnit("%");
this->mPlant->advertise("moistraw").setName("adc").setDatatype("number").setUnit("3.3/4096V");
mPump = this->mPlant->advertise("switch").setName("Pump").setDatatype("Boolean");
this->mPlant->advertise("lastPump").setName("lastPump").setDatatype("Integer").setUnit("unixtime").setRetained(true);
this->mPlant->advertise("moist").setName("Percent").setDatatype("Float").setUnit("%").setRetained(true);
this->mPlant->advertise("moistraw").setName("frequency").setDatatype("Float").setUnit("hz").setRetained(true);
this->mPlant->advertise("state").setName("state").setDatatype("String").setRetained(true);
}
/* FIXME
bool Plant::switchHandler(const HomieRange& range, const String& value) {
if (range.isRange) return false; // only one switch is present
if ((value.equals("ON")) || (value.equals("On")) || (value.equals("on")) || (value.equals("true"))) {
this->activatePump();
return true;
} else if ((value.equals("OFF")) || (value.equals("Off")) || (value.equals("off")) || (value.equals("false")) ) {
this->deactivatePump();
return true;
} else {
return false;
}
}
}
*/

18
esp32/src/TimeUtils.cpp Normal file
View File

@@ -0,0 +1,18 @@
#include "TimeUtils.h"
#include <Homie.h>
long getCurrentTime()
{
struct timeval tv_now;
gettimeofday(&tv_now, NULL);
return tv_now.tv_sec;
}
int getCurrentHour()
{
struct tm info;
time_t now;
time(&now);
localtime_r(&now, &info);
return info.tm_hour;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

View File

@@ -15,7 +15,14 @@
"functional": "cpp",
"string": "cpp",
"typeinfo": "cpp",
"cmath": "cpp"
"cmath": "cpp",
"array": "cpp",
"deque": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"initializer_list": "cpp",
"regex": "cpp"
}
}
}

View File

@@ -1,112 +0,0 @@
/*
* DS2438.h
*
* by Joe Bechter
*
* (C) 2012, bechter.com
*
* All files, software, schematics and designs are provided as-is with no warranty.
* All files, software, schematics and designs are for experimental/hobby use.
* Under no circumstances should any part be used for critical systems where safety,
* life or property depends upon it. You are responsible for all use.
* You are free to use, modify, derive or otherwise extend for your own non-commercial purposes provided
* 1. No part of this software or design may be used to cause injury or death to humans or animals.
* 2. Use is non-commercial.
* 3. Credit is given to the author (i.e. portions © bechter.com), and provide a link to the original source.
*
*/
#ifndef DS2438_h
#define DS2438_h
#include <Arduino.h>
#include <OneWire.h>
#define DS2438_TEMPERATURE_CONVERSION_COMMAND 0x44
#define DS2438_VOLTAGE_CONVERSION_COMMAND 0xb4
#define DS2438_WRITE_SCRATCHPAD_COMMAND 0x4e
#define DS2438_COPY_SCRATCHPAD_COMMAND 0x48
#define DS2438_READ_SCRATCHPAD_COMMAND 0xbe
#define DS2438_RECALL_MEMORY_COMMAND 0xb8
#define PAGE_MIN 0
#define PAGE_MAX 7
#define DS2438_CHA 0
#define DS2438_CHB 1
#define DS2438_MODE_CHA 0x01
#define DS2438_MODE_CHB 0x02
#define DS2438_MODE_TEMPERATURE 0x04
#define DS2438_TEMPERATURE_DELAY 10
#define DS2438_VOLTAGE_CONVERSION_DELAY 8
#define DEFAULT_PAGE0(var) uint8_t var[8] { \
0b00001011 /* X, ADB=0, NVB=0, TB=0, AD=1, EE=0, CA=1, IAD=1 */, \
0, /* Temperatur */ \
0, /* Temperatur */ \
0, /* Voltage */ \
0, /* Voltage */ \
0, /* Current */ \
0, /* Current */ \
0 /* Threashold */ \
}
typedef struct PageOne {
uint8_t eleapsedTimerByte0; /**< LSB of timestamp */
uint8_t eleapsedTimerByte1;
uint8_t eleapsedTimerByte2;
uint8_t eleapsedTimerByte3; /**< MSB of timestamp */
uint8_t ICA; /**< Integrated Current Accumulator (current flowing into and out of the battery) */
uint8_t offsetRegisterByte0; /**< Offset for ADC calibdation */
uint8_t offsetRegisterByte1; /**< Offset for ADC calibdation */
uint8_t reserved;
} PageOne_t;
typedef struct PageSeven {
uint8_t userByte0;
uint8_t userByte1;
uint8_t userByte2;
uint8_t userByte3;
uint8_t CCA0; /**< Charging Current Accumulator (CCA) */
uint8_t CCA1; /**< Charging Current Accumulator (CCA) */
uint8_t DCA0; /**< Discharge Current Accumulator (DCA) */
uint8_t DCA1; /**< Discharge Current Accumulator (DCA) */
} PageSeven_t;
typedef uint8_t DeviceAddress[8];
class DS2438 {
public:
DS2438(OneWire *ow, float currentShunt);
DS2438(OneWire *ow, uint8_t *address);
void begin();
void update();
double getTemperature();
float getVoltage(int channel=DS2438_CHA);
float getCurrent();
boolean isError();
boolean isFound();
private:
bool validAddress(const uint8_t*);
bool validFamily(const uint8_t* deviceAddress);
bool deviceFound = false;
OneWire *_ow;
DeviceAddress _address;
uint8_t _mode;
double _temperature;
float _voltageA;
float _voltageB;
float _current;
float _currentShunt;
boolean _error;
boolean startConversion(int channel, boolean doTemperature);
boolean selectChannel(int channel);
void writePage(int page, uint8_t *data);
boolean readPage(int page, uint8_t *data);
};
#endif

View File

@@ -0,0 +1,187 @@
#ifndef ULP_PWM_h
#define ILP_PWM_h
#include <Arduino.h>
#include "driver/rtc_io.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/rtc.h"
#include "esp32/ulp.h"
#define LBL_START 1
#define LBL_DELAY_ON 2
#define LBL_DELAY_OFF 3
#define LBL_SKIP_ON 4
#define LBL_SKIP_OFF 5
#define REGISTER_DELAY_LOOP_COUNTER R0
#define REGISTER_TICKS_ON R1
#define REGISTER_TICKS_OFF R2
#define TOTAL_TICKS_DELAY 255
#define PIN GPIO_NUM_12
//support 20 vars
const size_t ulp_var_offset = CONFIG_ULP_COPROC_RESERVE_MEM - 20;
//use the first for dimming
const size_t ulp_dimm_offset = ulp_var_offset + 1;
const size_t ulp_alive_offset = ulp_var_offset + 2;
//see https://github.com/perseus086/ESP32-notes
const uint32_t rtc_bit[40] = {
25, //gpio0
0, //gpio1
26, //gpio2
0, //gpio3
24, //gpio4
0, //gpio5
0, //gpio6
0, //gpio7
0, //gpio8
0, //gpio9
0, //gpio10
0, //gpio11
29, //gpio12
28, //gpio13
30, //gpio14
27, //gpio15
0, //gpio16
31, //gpio17
0, //gpio18
0, //gpio19
0, //gpio20
0, //gpio21
0, //gpio22
0, //gpio23
0, //gpio24
20, //gpio25
21, //gpio26
0, //gpio27
0, //gpio28
0, //gpio29
0, //gpio30
0, //gpio31
23, //gpio32
22, //gpio33
18, //gpio34
19, //gpio35
14, //gpio36
15, //gpio37
16, //gpio38
17 //gpio39
};
static inline void ulp_data_write(size_t offset, uint16_t value)
{
if (offset >= CONFIG_ULP_COPROC_RESERVE_MEM || offset <= ulp_var_offset)
{
Serial.print("Invalid ULP offset detected, refusing write!");
Serial.print(offset);
Serial.print("-");
Serial.print(ulp_var_offset);
Serial.print("-");
Serial.println(CONFIG_ULP_COPROC_RESERVE_MEM);
return;
}
else
{
RTC_SLOW_MEM[offset] = value;
}
}
static inline uint16_t ulp_data_read(size_t offset)
{
if (offset >= CONFIG_ULP_COPROC_RESERVE_MEM || offset <= ulp_var_offset)
{
Serial.print("Invalid ULP offset detected");
Serial.print(offset);
Serial.print("-");
Serial.print(ulp_var_offset);
Serial.print("-");
Serial.println(CONFIG_ULP_COPROC_RESERVE_MEM);
}
return RTC_SLOW_MEM[offset] & 0xffff;
}
static inline uint32_t rtc_io_number_get(gpio_num_t gpio_num)
{
assert(rtc_gpio_is_valid_gpio(gpio_num) && "Invalid GPIO for RTC");
uint32_t bit = rtc_bit[gpio_num];
Serial.print("Resolved GPIO ");
Serial.print(gpio_num);
Serial.print(" to rtc bit ");
Serial.println(bit);
return bit;
}
void ulp_pwm_start(void)
{
rtc_gpio_init(PIN);
rtc_gpio_set_direction(PIN, RTC_GPIO_MODE_OUTPUT_ONLY);
rtc_gpio_set_level(PIN, 0);
const uint32_t rtc_gpio = rtc_io_number_get(PIN);
// Define ULP program
const ulp_insn_t ulp_prog[] = {
M_LABEL(LBL_START),
I_MOVI(REGISTER_DELAY_LOOP_COUNTER, 1),
I_MOVI(REGISTER_TICKS_ON, 0),
I_ST(REGISTER_DELAY_LOOP_COUNTER, REGISTER_TICKS_ON, ulp_alive_offset), //store 1 with 0 offset into alive
I_LD(REGISTER_TICKS_ON, REGISTER_TICKS_ON, ulp_dimm_offset), //REGISTER_TICKS_ON = RTC_DATA[0+ulp_dimm_offset]
//in total there is always 255 delay loop iterations, but in different duty cycle
I_MOVI(REGISTER_TICKS_OFF, TOTAL_TICKS_DELAY),
I_SUBR(REGISTER_TICKS_OFF, REGISTER_TICKS_OFF, REGISTER_TICKS_ON),
//on phase
I_MOVR(REGISTER_DELAY_LOOP_COUNTER, REGISTER_TICKS_ON),
M_BL(LBL_SKIP_ON, 1), //if never on, skip on phase
I_WR_REG(RTC_GPIO_OUT_REG, rtc_gpio, rtc_gpio, HIGH), // on
M_LABEL(LBL_DELAY_ON),
I_DELAY(1), //wait 1 clock
I_SUBI(REGISTER_DELAY_LOOP_COUNTER, REGISTER_DELAY_LOOP_COUNTER, 1), // REGISTER_DELAY_LOOP_COUNTER--
M_BGE(LBL_DELAY_ON, 1), //if time left, goto start of on loop
M_LABEL(LBL_SKIP_ON),
//off phase
I_MOVR(REGISTER_DELAY_LOOP_COUNTER, REGISTER_TICKS_OFF),
M_BL(LBL_SKIP_OFF, 1), //if never off, skip on phase
I_WR_REG(RTC_GPIO_OUT_REG, rtc_gpio, rtc_gpio, LOW), // on
M_LABEL(3),
I_DELAY(1), //wait 1 clock
I_SUBI(REGISTER_DELAY_LOOP_COUNTER, REGISTER_DELAY_LOOP_COUNTER, 1), // REGISTER_DELAY_LOOP_COUNTER--
M_BGE(3, 1), //if time left, goto start of on loop
M_LABEL(LBL_SKIP_OFF),
M_BX(LBL_START),
};
// Run ULP program
size_t size = sizeof(ulp_prog) / sizeof(ulp_insn_t);
assert(size < ulp_var_offset && "ULP_DATA_OFFSET needs to be greater or equal to the program size");
esp_err_t error = ulp_process_macros_and_load(0, ulp_prog, &size);
Serial.print("ULP bootstrap status ");
Serial.println(error);
//allow glitchless start
ulp_data_write(ulp_alive_offset, 0);
error = ulp_run(0);
Serial.print("ULP start status ");
Serial.println(error);
}
static inline void ulp_pwm_set_level(uint8_t level)
{
ulp_data_write(ulp_dimm_offset, level);
}
static inline void ulp_pwm_init()
{
ulp_data_write(ulp_alive_offset, 0);
delay(10);
if (ulp_data_read(ulp_alive_offset) == 0)
{
ulp_pwm_start();
}
}
#endif

View File

@@ -12,6 +12,5 @@
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
build_flags = -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
lib_deps = OneWire
DallasTemperature
lib_deps = pololu/VL53L0X@^1.3.1
build_flags = -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY -DBOOTLOADER_LOG_LEVEL_VERBOSE -DLOG_DEFAULT_LEVEL_VERBOSE -DCORE_DEBUG_LEVEL=5

View File

@@ -1,286 +0,0 @@
/*
* DS2438.cpp
*
* by Joe Bechter
*
* (C) 2012, bechter.com
*
* All files, software, schematics and designs are provided as-is with no warranty.
* All files, software, schematics and designs are for experimental/hobby use.
* Under no circumstances should any part be used for critical systems where safety,
* life or property depends upon it. You are responsible for all use.
* You are free to use, modify, derive or otherwise extend for your own non-commercial purposes provided
* 1. No part of this software or design may be used to cause injury or death to humans or animals.
* 2. Use is non-commercial.
* 3. Credit is given to the author (i.e. portions © bechter.com), and provide a link to the original source.
*
*/
#include "DS2438.h"
// DSROM FIELDS
#define DSROM_FAMILY 0
#define DSROM_CRC 7
#define DS2438MODEL 0x26
DS2438::DS2438(OneWire *ow, float currentShunt = 1.0f) {
_ow = ow;
_currentShunt = currentShunt;
};
void DS2438::begin(){
DeviceAddress searchDeviceAddress;
_ow->reset_search();
memset(searchDeviceAddress,0, 8);
_temperature = 0;
_voltageA = 0.0;
_voltageB = 0.0;
_error = true;
_mode = (DS2438_MODE_CHA | DS2438_MODE_CHB | DS2438_MODE_TEMPERATURE);
deviceFound = false; // Reset the number of devices when we enumerate wire devices
while (_ow->search(searchDeviceAddress)) {
if (validAddress(searchDeviceAddress)) {
if (validFamily(searchDeviceAddress)) {
memcpy(_address,searchDeviceAddress,8);
DEFAULT_PAGE0(defaultConfig);
writePage(0, defaultConfig);
deviceFound = true;
}
}
}
}
bool DS2438::isFound(){
return deviceFound;
}
bool DS2438::validAddress(const uint8_t* deviceAddress) {
return (_ow->crc8(deviceAddress, 7) == deviceAddress[DSROM_CRC]);
}
bool DS2438::validFamily(const uint8_t* deviceAddress) {
switch (deviceAddress[DSROM_FAMILY]) {
case DS2438MODEL:
return true;
default:
return false;
}
}
void DS2438::update() {
uint8_t data[9];
_error = true;
if(!isFound()){
return;
}
if (_mode & DS2438_MODE_CHA || _mode == DS2438_MODE_TEMPERATURE) {
boolean doTemperature = _mode & DS2438_MODE_TEMPERATURE;
if (!startConversion(DS2438_CHA, doTemperature)) {
Serial.println("Error starting temp conversion ds2438 channel a");
return;
}
if (!readPage(0, data)){
Serial.println("Error reading zero page ds2438 channel a");
return;
}
Serial.print(data[0],16);
Serial.print(" ");
Serial.print(data[1],16);
Serial.print(" ");
Serial.print(data[2],16);
Serial.print(" ");
Serial.print(data[3],16);
Serial.print(" ");
Serial.print(data[4],16);
Serial.print(" ");
Serial.print(data[5],16);
Serial.print(" ");
Serial.print(data[6],16);
Serial.print(" ");
Serial.println(data[7],16);
if (doTemperature) {
_temperature = (double)(((((int16_t)data[2]) << 8) | (data[1] & 0x0ff)) >> 3) * 0.03125;
}
if (_mode & DS2438_MODE_CHA) {
_voltageA = (((data[4] << 8) & 0x00300) | (data[3] & 0x0ff)) / 100.0;
}
}
if (_mode & DS2438_MODE_CHB) {
boolean doTemperature = _mode & DS2438_MODE_TEMPERATURE && !(_mode & DS2438_MODE_CHA);
if (!startConversion(DS2438_CHB, doTemperature)) {
Serial.println("Error starting temp conversion channel b ds2438");
return;
}
if (!readPage(0, data)){
Serial.println("Error reading zero page ds2438 channel b");
return;
}
if (doTemperature) {
int16_t upperByte = ((int16_t)data[2]) << 8;
int16_t lowerByte = data[1] >> 3;
int16_t fullByte = (upperByte | lowerByte);
_temperature = ((double)fullByte) * 0.03125;
}
_voltageB = (((data[4] << 8) & 0x00300) | (data[3] & 0x0ff)) / 100.0;
}
int16_t upperByte = ((int16_t)data[6]) << 8;
int16_t lowerByte = data[5];
int16_t fullByte = (int16_t)(upperByte | lowerByte);
float fullByteb = fullByte;
_current = (fullByteb) / ((4096.0f * _currentShunt));
_error = false;
Serial.print(data[0],16);
Serial.print(" ");
Serial.print(data[1],16);
Serial.print(" ");
Serial.print(data[2],16);
Serial.print(" ");
Serial.print(data[3],16);
Serial.print(" ");
Serial.print(data[4],16);
Serial.print(" ");
Serial.print(data[5],16);
Serial.print(" ");
Serial.print(data[6],16);
Serial.print(" ");
Serial.println(data[7],16);
Serial.println("-");
uint16_t ICA = 0;
if (readPage(1, data)){
PageOne_t *pOne = (PageOne_t *) data;
Serial.println(pOne->ICA);
float Ah = pOne->ICA / (2048.0f * _currentShunt);
Serial.print("Ah=");
Serial.println(Ah);
ICA = pOne->ICA;
}
if (readPage(7, data)){
PageSeven_t *pSeven = (PageSeven_t *) data;
int16_t CCA = pSeven->CCA0 | ((int16_t) pSeven->CCA1) << 8;
int16_t DCA = pSeven->DCA0 | ((int16_t) pSeven->DCA1) << 8;
Serial.println("ICA, DCA, CCA");
Serial.print(ICA);
Serial.print(", ");
Serial.print(DCA);
Serial.print(", ");
Serial.println(CCA);
}
}
double DS2438::getTemperature() {
return _temperature;
}
float DS2438::getVoltage(int channel) {
if (channel == DS2438_CHA) {
return _voltageA;
} else if (channel == DS2438_CHB) {
return _voltageB;
} else {
return 0.0;
}
}
float DS2438::getCurrent() {
return _current;
}
boolean DS2438::isError() {
return _error;
}
boolean DS2438::startConversion(int channel, boolean doTemperature) {
if(!isFound()){
return false;
}
if (!selectChannel(channel)){
return false;
}
_ow->reset();
_ow->select(_address);
if (doTemperature) {
_ow->write(DS2438_TEMPERATURE_CONVERSION_COMMAND, 0);
delay(DS2438_TEMPERATURE_DELAY);
_ow->reset();
_ow->select(_address);
}
_ow->write(DS2438_VOLTAGE_CONVERSION_COMMAND, 0);
delay(DS2438_VOLTAGE_CONVERSION_DELAY);
return true;
}
boolean DS2438::selectChannel(int channel) {
if(!isFound()){
return false;
}
uint8_t data[9];
if (readPage(0, data)) {
if (channel == DS2438_CHB){
data[0] = data[0] | 0x08;
}
else {
data[0] = data[0] & 0xf7;
}
writePage(0, data);
return true;
}
Serial.println("Could not read page zero data");
return false;
}
void DS2438::writePage(int page, uint8_t *data) {
_ow->reset();
_ow->select(_address);
_ow->write(DS2438_WRITE_SCRATCHPAD_COMMAND, 0);
if ((page >= PAGE_MIN) && (page <= PAGE_MAX)) {
_ow->write(page, 0);
} else {
return;
}
for (int i = 0; i < 8; i++){
_ow->write(data[i], 0);
}
_ow->reset();
_ow->select(_address);
_ow->write(DS2438_COPY_SCRATCHPAD_COMMAND, 0);
_ow->write(page, 0);
}
boolean DS2438::readPage(int page, uint8_t *data) {
//TODO if all data is 0 0 is a valid crc, but most likly not as intended
_ow->reset();
_ow->select(_address);
_ow->write(DS2438_RECALL_MEMORY_COMMAND, 0);
if ((page >= PAGE_MIN) && (page <= PAGE_MAX)) {
_ow->write(page, 0);
} else {
return false;
}
_ow->reset();
_ow->select(_address);
_ow->write(DS2438_READ_SCRATCHPAD_COMMAND, 0);
_ow->write(page, 0);
for (int i = 0; i < 9; i++){
data[i] = _ow->read();
}
return _ow->crc8(data, 8) == data[8];
}

View File

@@ -1,141 +1,83 @@
#include <Arduino.h>
#include "esp_sleep.h"
#include "DallasTemperature.h"
#include "DS2438.h"
#include "driver/pcnt.h"
#include <VL53L0X.h>
#define uS_TO_S_FACTOR 1000000 /* Conversion factor for micro seconds to seconds */
#define TIME_TO_SLEEP 5 /* Time ESP32 will go to sleep (in seconds) */
#define SENSOR_DS18B20 2 /**< GPIO 2 */
#define SENSOR_TANK_SDA GPIO_NUM_16 /**< GPIO 16 - echo feedback of water sensor */
#define SENSOR_TANK_SCL GPIO_NUM_17 /**< GPIO 17 - trigger for water sensor */
#define OUTPUT_PUMP0 17 /**< GPIO 23 */
#define OUTPUT_PUMP1 05 /**< GPIO 22 */
#define OUTPUT_PUMP2 18 /**< GPIO 21 */
#define OUTPUT_PUMP3 19 /**< GPIO 19 */
#define OUTPUT_PUMP4 21 /**< GPIO 18 */
#define OUTPUT_PUMP5 22 /**< GPIO 5 */
#define OUTPUT_PUMP6 23 /**< GPIO 15 */
#define OUTPUT_SENSOR 14
#define SENSOR_PLANT 17
#define OUTPUT_SENSOR 16 /**< GPIO 16 - Enable Sensors */
#define OUTPUT_PUMP 13 /**< GPIO 13 - Enable Pumps */
VL53L0X tankSensor;
bool distanceReady = false;
#define SENSOR_PLANT0 32 /**< GPIO 32 (ADC1) */
void initializeTanksensor() {
Wire.begin(SENSOR_TANK_SDA, SENSOR_TANK_SCL, 100000UL /* 100kHz */);
tankSensor.setBus(&Wire);
delay(100);
tankSensor.setTimeout(500);
long start = millis();
while (start + 500 > millis())
{
if (tankSensor.init())
{
distanceReady = true;
break;
}
else
{
delay(20);
}
}
#define ADC_TO_VOLT(adc) ((adc) * 3.3 ) / 4095)
#define ADC_TO_VOLT_WITH_MULTI(adc, multi) (((adc) * 3.3 * (multi)) / 4095)
#define SOLAR_VOLT(adc) ADC_TO_VOLT_WITH_MULTI(adc, 4.0306) /**< 100k and 33k voltage dividor */
#define ADC_5V_TO_3V3(adc) ADC_TO_VOLT_WITH_MULTI(adc, 1.7) /**< 33k and 47k8 voltage dividor */
RTC_DATA_ATTR int bootCount = 0;
RTC_DATA_ATTR int pumpActive = 0;
int secondBootCount = 0;
OneWire oneWire(SENSOR_DS18B20);
DallasTemperature temp(&oneWire);
DS2438 battery(&oneWire,0.1f);
void print_wakeup_reason(){
esp_sleep_wakeup_cause_t wakeup_reason;
wakeup_reason = esp_sleep_get_wakeup_cause();
switch(wakeup_reason){
case ESP_SLEEP_WAKEUP_EXT0 : Serial.println("Wakeup caused by external signal using RTC_IO"); break;
case ESP_SLEEP_WAKEUP_EXT1 : Serial.println("Wakeup caused by external signal using RTC_CNTL"); break;
case ESP_SLEEP_WAKEUP_TIMER : Serial.println("Wakeup caused by timer"); break;
case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println("Wakeup caused by touchpad"); break;
case ESP_SLEEP_WAKEUP_ULP : Serial.println("Wakeup caused by ULP program"); break;
default : Serial.printf("Wakeup was not caused by deep sleep: %d\n",wakeup_reason); break;
if ((distanceReady) && (!tankSensor.timeoutOccurred()))
{
Serial.println("Sensor init done");
tankSensor.setSignalRateLimit(0.1);
// increase laser pulse periods (defaults are 14 and 10 PCLKs)
tankSensor.setVcselPulsePeriod(VL53L0X::VcselPeriodPreRange, 18);
tankSensor.setVcselPulsePeriod(VL53L0X::VcselPeriodFinalRange, 14);
tankSensor.setMeasurementTimingBudget(200000);
tankSensor.startContinuous();
} else {
Serial.println("Sensor init failed");
}
}
bool whatever = true;
void setAll2Off() {
digitalWrite(OUTPUT_PUMP0, LOW);
digitalWrite(OUTPUT_PUMP1, LOW);
digitalWrite(OUTPUT_PUMP2, LOW);
digitalWrite(OUTPUT_PUMP3, LOW);
digitalWrite(OUTPUT_PUMP4, LOW);
digitalWrite(OUTPUT_PUMP5, LOW);
digitalWrite(OUTPUT_PUMP6, LOW);
digitalWrite(OUTPUT_SENSOR, LOW);
digitalWrite(OUTPUT_PUMP, LOW);
}
void setup() {
pinMode(OUTPUT_PUMP0, OUTPUT);
pinMode(OUTPUT_PUMP1, OUTPUT);
pinMode(OUTPUT_PUMP2, OUTPUT);
pinMode(OUTPUT_PUMP3, OUTPUT);
pinMode(OUTPUT_PUMP4, OUTPUT);
pinMode(OUTPUT_PUMP5, OUTPUT);
pinMode(OUTPUT_PUMP6, OUTPUT);
void setup()
{
Serial.begin(115200);
pinMode(OUTPUT_SENSOR, OUTPUT);
pinMode(OUTPUT_PUMP, OUTPUT);
pinMode(SENSOR_PLANT0, ANALOG);
setAll2Off();
Serial.begin(9600);
//Increment boot number and print it every reboot
++bootCount;
++secondBootCount;
Serial.println("Boot number: " + String(bootCount) + " " + String(secondBootCount));
//Print the wakeup reason for ESP32
print_wakeup_reason();
/* activate power pump and pump 0 */
digitalWrite(OUTPUT_SENSOR, HIGH);
Serial.println("Nodemcu ESP32 Start done");
delay(1);
temp.begin();
battery.begin();
Serial.print("Battery");
Serial.print("\t");
Serial.print("Solar");
Serial.print("\t");
Serial.print("Bat I");
Serial.print("\t");
Serial.println("Temp/10");
initializeTanksensor();
}
void loop() {
whatever = !whatever;
digitalWrite(OUTPUT_PUMP, HIGH);
delay(500);
digitalWrite(OUTPUT_PUMP6, HIGH);
for(int j=0; j < 5 && temp.getDeviceCount() == 0; j++) {
delay(10);
// Serial.println("Reset 1wire temp");
temp.begin();
if ((distanceReady) && (!tankSensor.timeoutOccurred()))
{
uint16_t distance = tankSensor.readRangeSingleMillimeters();
if (distance > 8000) {
Serial.println("Reset due invalid distance: 8 meter");
Wire.end();
delay(1000);
initializeTanksensor();
} else {
Serial.print("Distance");
Serial.println(distance);
}
} else {
Serial.println("Timeout");
tankSensor.stopContinuous();
Wire.end();
delay(100);
initializeTanksensor();
}
for(int j=0; j < 5 && (0 == battery.isFound()); j++) {
delay(10);
Serial.println("Reset 1wire bat");
battery.begin();
battery.update();
}
battery.update();
Serial.print(battery.getVoltage(0)); //use define here, solar
Serial.print("\t");
Serial.print(battery.getVoltage(1)); //use define here, battery
Serial.print("\t");
Serial.print(battery.getCurrent());
Serial.print("\t");
Serial.println(battery.getTemperature()/10);
}
}

BIN
hardware/sensor_mod.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More