BotronikS - Final code for all types of Arduino and PC users: -- HOME -- Email:


- DS18B20: 1 - 2 - 3
- Relay module: 1 - 2 - 3
misc: Wires: (link) 1--2--3
connections (click to enlarge)
- Need additional accessories:

Free Hex & Exe code! Arduino source code available on email request only (copy and send next text): PCTP101x2-ARDSC: Price=10 Euro

PCTP101x2: 2x Programmable thermostat (2x sensor DS18B20) with two temperature thresholds (Hi & Lo) and 4 outputs
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 under SV01(SetLo1) then Out1=ON. If PV01(Temp.1) is over SV02(SetHi1) then Out1=OFF (eg. heating)
TS1 Out2 code: Inverted of Out1 (eg. cooling)
TS2 Out3 code: If PV04(Temp.2) is under SV03(SetLo2) then Out3=ON. If PV04(Temp.2) is over SV04(SetHi2) then Out3=OFF (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..): PCTP101x2-m328
2. uc AtMega2560 (Mega(ATMEGA2560)......): PCTP101x2-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 Lower1 threshold (SetLo1) (one decimal digit form - range: -50.0 to 120.0C (example: SV01=-12.3)
SV02=x - x=Set Upper1 threshold (SetHi1) (one decimal digit form)- range: -50.0 to 120.0C (example: SV02=45.6)
SV03=x - x=Set Lower2 threshold (SetLo2) (one decimal digit form - range: -50.0 to 120.0C (example: SV03=-22.3)
SV04=x - x=Set Upper2 threshold (SetHi2) (one decimal digit form)- range: -50.0 to 120.0C (example: SV04=55.6)
DRESET - Default Reset ( SV01-04=22.1/33.2/22.3/33.4) - BE SURE TO DO THIS AFTER UPDATING THE CODE!

PC Application(s) for offered Hex code (for WINDOWS):
In order for the offered PC applications to work, it is necessary to download and install (one time only) VB6RunTimePlus2.2
Download the PC application, unpack, and start (allow windows to start applications - see HOW) enter the COM port number where the Arduino is connected and test it...

Download: PcApp1
Some features:
- PcApp makes a PcApp1Log folder (in application path) with stored measured values.
- Log files named in format (yy mm dd - Year Month Day).
- This data later can be analyzed from some other software to create graphs (eg Excel)
- Log File format - comma delimited