Arduino code LDP0301A: LED Thermostat for sensor DS18B20 with 2 outputs (heating + cooling) - FreeHex

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

Nano
Uno
Mega

- 7 Segment TM1637 display: (link) 1--2--3
- DS18B20 temp. sensor: (link) 1--2--3
- Push Button: (link) 1--2--3
- RelayModule 2way: (link) 1--2--3
- PS9V/1A Power supply unit: (links) 1--2--3
misc: Wires: (link) 1--2--3 -- Resistors: (link) 1--2--3
 
Arduinos
connections (click to enlarge)
- Need additional accessories:

LDP0301A: LED Thermostat for sensor DS18B20 with 2 outputs (heating + cooling) - FreeHex
The offered code enables: Temperature control with hysteresis at 2 outputs
Required accessories: - see above
For Arduino boards: NANO or UNO or MEGA
Arduino pins are used:
uc ATmega328p (NANO, UNO, ...): (see connections)
uc AtMega2560 (MEGA,.............): (see connections)
 
Electrical and practical notes:
Uses 9V/1A external power supply (VIN/GND) on DC plug (or external 5V/1A on 5V/GND pin).
If you want to use a longer length of the sensor connection cable, use a resistor of smaller value R1 = 3,3K
Display of the measured value is in the form of one decimal digit.
Use specified type of 7 segments display with decimal points only (not clock dots).
Each output can also drive other type of loads (instead relay module as show on connections) up to 5V/20mA (small or medium power SSR or similar)
 
Download the FreeHEX codes below, unpack and upload to the proper Arduino board (Use a free net tool for example XLoader)
1. uc ATmega328-16MHz-5V (NANO,UNO...): LDP0301A-M328
2. uc AtMega2560 (Mega(ATMEGA2560).....): LDP0301A-M2560
Fully functional code but in hex format only! Test and use it free! If You want ArduinoIDE source code - see below.
 
ArduinoIDE source code (avaliable): Do some donation (HOME) and copy bottom line in Your Email to us (CONTACT). After successful donation You will receive ProjCode on your email soon as possible.
Need of project code: ProjCode-LDP0301A (ArduinoIDE source code)
 

User guide manual:
Default settings: Switch off power supply (or press Arduino RESET button), press the both buttons (PB1(+) and PB2(-)), apply power (or release RESET) and after 5 seconds release both buttons (Recomended to do this before first use - after updating the hex code in the Arduino)
Default values: P10=5 P12=1
SETtings (during normal operating - all changes stay memorized):
SET Temperature (SV1): Press the PB1(+) button (until the display goes off then release). The set temperature that can be changed on the buttons (PB1/PB2=+/-) is displayed. After 2 seconds of inactivity, the value on the display is stored.
SET Hysteresis (SV2): Press the PB2(-) button (until the display goes off (5 sec.) then release). The set hysteresis that can be changed on the buttons (+/-) is displayed. After 2 seconds of inactivity, the value is stored.
Status of outputs:
Out1: If the measuring temperature is equal or higher than the set value (SV1) then: Out1=0(0V=off). When the temperature drops below the set temperature for the set hysteresis value (SV2) then: Out1=1(5V=on) - (on exasmple: heating function).
Out2: Inverse of Out1 (on example: cooling function).
PRESET values settings: Switch off the power supply (or press Arsuino RESET button), press the button PB1(+), switch on power (or release Arduino RESET button) and after 5 seconds release the button PB1(+). Then shows preset values which you can modifite on buttons (all changes stay memorized until next change):
P10: Display brightness intensity (0-7)
P12: Select Celsius or Fahrenheit (1=CEL 2=FAH)
Additional preset values (P14-P20) has no function in this project!