# Project Implementation for Tzu Chi Shinergy
*If you are new to IoT or microcontroller system, you can follow this walkthrough: https://hackmd.io/@pramho05/basic_iot*
## Project requirement and Deliverables
**Basic control requirements:**
* Adjustable blower speed from web
* On/Off cut-off
**Basic sensor requirements:**
* High temperature Sensor for Solar Collector
* Robust Temp & Humidity Sensor
* Environment Sensor
**Advance System:**
* [Solar irradiance sensor](https://www.aliexpress.com/item/1005004417770153.html) : https://www.aliexpress.com/i/1005005475357667.html
* PV Voltage sensor
* Battery system power sensor
* Automatic Temperature Regulator
* Drying Preset
## System Architecture
### a) Components:
1. Control: [PWM Blower](https://www.ruten.com.tw/item/show?22221205336299), Logic Level Converter {This project blower need 5V logic PWM with 500 Hz PWM frequency; Resolution Does not matter, but greater resolution means smoother control, 12 bits is tested}
2. Inner Temp, Humidity Sensor: **I2C** [SHT30](https://www.icshop.com.tw/products/368031600045) or **I2C** [SHT41](https://www.icshop.com.tw/products/368030501782)
3. Solar Collector Temp Sensor: **OneWire** [DS18B20](https://www.icshop.com.tw/products/368030200435) (Max 125°C, 3-5V), **SPI** [Thermocouple](https://www.taiwansensor.com.tw/product/max6675-%E5%B7%A5%E6%A5%AD%E5%9E%8B-k%E5%9E%8B%E7%86%B1%E9%9B%BB%E5%81%B6-%E6%BA%AB%E5%BA%A6%E6%84%9F%E6%B8%AC%E5%99%A8-%E9%AB%98%E6%BA%AB%E9%87%8F%E6%B8%AC%E5%8F%AF%E9%81%94-1024%E5%BA%A6-c/) (1300 C)
4. Outside Temp, Humidity, Barometric Sensor: **I2C** Weather Proof [SHT-30](https://shopee.tw/%E3%80%90UCI%E9%9B%BB%E5%AD%90%E3%80%91(13-8)-PE%E6%BA%AB%E6%BF%95%E5%BA%A6%E6%84%9F%E6%B8%AC%E5%99%A8-%E9%98%B2%E6%B0%B4%E6%BA%AB%E6%BF%95%E5%BA%A6%E6%84%9F%E6%B8%AC%E5%99%A8%E6%8E%A2%E9%A0%AD-%E6%95%B8%E4%BD%8D%E6%BA%AB%E6%BF%95%E5%BA%A6%E6%84%9F%E6%B8%AC%E5%99%A8%E6%A8%A1%E7%B5%84-SHT30-i.2305548.2688853573?publish_id=&sp_atk=9c327e43-ea64-421b-9d37-0f480bfb26f0&xptdk=9c327e43-ea64-421b-9d37-0f480bfb26f0)
5. Board: [ESP32 + Display](https://www.icshop.com.tw/products/368030501661), or [ESP32 Outdoor](https://www.icshop.com.tw/products/368030501773) and [Antenna](https://www.icshop.com.tw/products/368030300067),
6. Peripherals: I2C Crystal Display, Buzzer
7. Power Supply: [DC-DC Regulator](https://www.icshop.com.tw/products/368030500650), [Power Splitter](https://www.icshop.com.tw/products/368030501267), [Battery Shield](https://www.icshop.com.tw/products/368090500234)
8. Aux: Box, Fan, [Power Supply](https://shopee.tw/%E3%80%90%E5%8E%9F%E5%BB%A0%E8%B2%A8%E9%99%84%E7%99%BC%E7%A5%A8%E3%80%91LRS-50-12-12V-4.2A-50W-%E6%98%8E%E7%B7%AF-MW-%E9%9B%BB%E6%BA%90%E4%BE%9B%E6%87%89%E5%99%A8-%E6%9B%BF%E4%BB%A3NES-50-12~%E5%85%A8%E6%96%B9%E4%BD%8D%E9%9B%BB%E6%96%99-i.61466000.2014316597), 6P6C, 50W is adequate
9. Datalink: MAX485 TTL
[Sensor Supplier](https://shopee.tw/%E3%80%90%E6%BB%BF299%E7%99%BC%E8%B2%A8%E3%80%91SHT30%E6%BA%AB%E6%BF%95%E5%BA%A6%E5%82%B3%E6%84%9F%E5%99%A8RS485-MODBUS-RTU-%E9%98%B2%E5%A1%B5%E9%98%B2%E6%B0%B4%E9%87%87%E9%9B%86%E6%A8%A1%E5%A1%8A%E8%AE%8A%E9%80%81%E5%99%A8%E6%8E%A2%E9%A0%AD-m740324-i.4384412.23936385248?publish_id=&sp_atk=467081fc-575b-4a0a-b95f-9dd9d234e98b&xptdk=467081fc-575b-4a0a-b95f-9dd9d234e98b)
Sensor knowledge:
* https://www.kandrsmith.org/RJS/Misc/hygrometers.html
* https://wiki.liutyi.info/display/ARDUINO/Sensors
**SHT20:**
* https://github.com/DFRobot/DFRobot_SHT20
* https://wiki.dfrobot.com/SHT20_I2C_Temperature_%26_Humidity_Sensor__Waterproof_Probe__SKU__SEN0227
傳感器接口:
* 紅色 VCC ( 2.1 / 3.6V ( 注意請勿用 5V 會燒毀IC )
* 黑色 GND
* 綠色 SDA
* 黃色 SCL
**規格**
* 工作電壓:2.1 / 3.6V ( 注意請勿用 5V 會燒毀IC )
* 通訊接口:I2C
* 防護等級:防水防凝露
* RH響應時間:8秒(tau63%)
* 精度:±3%RH /±0.3℃
* 測量範圍:0-100%RH / -40-125℃
* 出線長度: 50CM
### b) Practical Considerations:
* Please consider if user wants to use only the electric, so the system box can be powered stand alone and can be moved to the drying box.
* User want online and offline interaction
### c) Hardware Architecture
## Program Flow
https://github.com/PramCreative05/shinergy/tree/main
### 1. Connection Handler
impose dummy SSID and password for fallback protection
### 2. Setup and Data Fetch
2.a. Online
2.b. Offline
## Installation
### Test Peripheral

### Test Information Flow
## Data Acquisition Strategy
## Operation Procedure
**Machine Diagram**
Operating Steps for the Machine - Power On
The machine operates on battery power, so the white USB cable is for charging the machine.
* Connect the battery to the power supply: connect the negative terminal first (-) and then the positive terminal (+). (Red is +, black is -, and the black wire tied with a yellow band is +)
* The solar power cable is connected in the same way as the sensor cables. (Red is +, black is -, and the black wire tied with a yellow band is +)
* Since the network cable will be connected with the sensor and the solar thermal pipe, it needs to be reconnected each time. Make sure to connect it properly!
* After completing step 3, insert the network cable. Remember to open the box and gently hold it before connecting the cable.
The above steps are for pre-assembly. The following steps are for powering on the machine.
5. Open the box first, then turn on the switch.
6. Check if the IP (192.168.4.1) appears. This indicates that it is connected to the network solar logo.
7. If everything is as described above, open it Main Power switch.
8. Finally, connect to the machine's network. It is the WiFi without a password. Enter 192.168.4.1 in Safari or Google.
**The data will be uploaded every 3 minutes, so wait for 3 minutes to check.**
## Maintenance and Development



https://telegra.ph/Crisis-630-06-30