| The offered code enables: Two separate thermostats (TS1-TS2). 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: |
| Two separate thermostats (TS1-TS2): |
| TS1 Out1 code: If PV01(Temp.1) is equal to or over SV02(SetTemp1) then Out1=OFF. If PV01(Temp.1) is under SV01(SetTemp1-SetHys1) then Out1=ON (eg. heating) |
| TS1 Out2 code: Inverted of Out1 (eg. cooling) |
| TS2 Out3 code: If PV04(Temp.2) is equal to or over SV04(SetTemp2) then Out3=OFF. If PV04(Temp.2) is under SV03(SetTemp2-SetHys2) then Out3=ON (eg. heating) |
| TS2 Out4 code: Inverted of Out3 (eg. cooling) |
| 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 2 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..): PCTP102x2-m328 |
| 2. uc AtMega2560 (Mega(ATMEGA2560)......): PCTP102x2-M2560 |
| |
| 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=Temperature1(C)) (in one decimal digit form) PV02=Out1-state PV03=Out2-state (1=ON) |
| --------------------------------------(PV04=Temperature2(C)) (in one decimal digit form) PV05=Out3-state PV06=Out4-state (1=ON) |
| SV? - Return set values SVxx (SV01-SV04 see below) |
| Set-Preset commands: Some or all commands use internal uC EEPROM for memorization when power loss! |
| SV01=x - x=Set Temperature1 (SetTemp1: one decimal digit form - range: -50.0 to 120.0C (example: SV01=-12.3) |
| SV02=x - x=Set Hysteresis1 (SetHys1: one decimal digit form)- range: 0 to 120.0C (example: SV02=0.6) |
| SV03=x - x=Set Temperature2 (SetTemp2: one decimal digit form - range: -50.0 to 120.0C (example: SV03=99.3) |
| SV04=x - x=Set Hysterersys2 (SeHys2: one decimal digit form)- range: 0 to 120.0C (example: SV04=0) |
| DRESET - Default Reset ( SV01-SV04= 22.1/0.5/33.3/0.6) - BE SURE TO DO THIS AFTER UPDATING THE CODE! |
| |