The offered code enables: Control of outputs state depends on settings and measured values... |
For Arduino boards: NANO - UNO - MEGA |
Arduino pins are used: see connections (used Sensor(s)=DS18B20 - Lnk1 - Lnk2 ) |
|
Electrical and practical notes: |
It can be powered only from PC USB but it is recommended to use an external voltage source 9V/1A (on dc plug or on VIN pin). |
Sensor pin is connected to 5V via resistors 3K3-4K7 (if the sensor does not have a built-in resistor) |
On outputs can connect some other type of 5V Loads up to 20 mA (for each output) like SSR's: Link1--Link2 |
On outputs can use Relay Modules but as far as possible from Arduino board! |
When finishing uploading code, be sure to do a Default Reset (see below) |
|
User guide and explanations: |
Out1 operation code (temperature): If PV01(temp.) is under SV01(Lo) then Out1=ON. If PV01(temp.) is over SV02(Hi) then Out1=OFF (eg. heating) |
Out2 operation code: inverted code function of Out1 (eg. cooling) |
Out3 operation code (humidity): If PV04(hum.) is under SV03(Lo) then Out3=ON. If PV4(hum.) is over SV04(Hi) then Out3=OFF (eg. moistening) |
Out4 operation code: inverted code function of Out3 (eg. drying ) |
The set values remain stored (EEPROM) even after a power failure! |
The code in the board does independently from PC according to the last settings values! Measuring and regulation are on 1 sec. |
|
Download the HEX codes below, unpack and upload to the proper Arduino board (Use a free net tool for example XLoader) |
1. uc ATmega328-16MHz (MINI,NANO,UNO..): PCHP101try-m328 - Time-Limited trial version (12 hours) then need restart! |
2. uc AtMega2560 (Mega(ATMEGA2560)......): PCHP101try-M2560 - Time-Limited trial version (12 hours) then need restart! |
|
Description of HexCode commands ( You can test the uploaded code using some free serial communication software such as Termite (select: Append CR)): |
AT command (ASCII characters + ENTER) - Baud 9600,8 Data bits, None Parity,1 Stop Bit |
AT - attention command (returns OK) |
I? - software code info (return ucAppName) |
PV? = Return proces values PVxx (PV01=Temperature(C)) (in one decimal digit form) PV02=Out1-state PV03=Out2-state (1=ON) |
SV? - Return set values SVxx (SV01-04 see below) |
Set-Preset commands: Some or all commands use internal Uc EEPROM for memorization when power loss! |
SV01=x - x=Set Lower threshold1 (TempLo) (one decimal digit form - range: -40.0 to 80.0C (example: SV01=-12.3) |
SV02=x - x=Set Upper threshold1 (TempHi) (one decimal digit form)- range: -40.0 to 80.0C (example: SV02=45.6) |
SV03=x - x=Set Lower threshold2 (HumLo) (one decimal digit form - range: 0 to 100.0 (example: SV03=61.2) |
SV04=x - x=Set Upper threshold2 (HumHi) (one decimal digit form - range: 0 to 100.0 (example: SV04=80.9) |
DRESET - Default Reset ( SV01-04=DEF.) - BE SURE TO DO THIS AFTER UPDATING THE CODE! |
|