» Electronics » Arduino »Thermostat on arduino and DS1820

Thermostat on arduino and DS1820


Initially, the thermostat was made simply as a thermometer to control the temperature outside the window. Then, during frosts, the potatoes began to freeze underground and functionality was added to control the microclimate. Passport data of the switching relay - 250V and 10A (2.5kW). Since the heat in the underground is not needed, a ten per kilowatt is enough.

Necessary materials and tools:
shoe care box
-USB-charging for for the phone (any, at least 0.7A)
-Arduino-Pro-Mini
-2-line 8 character display (WH0802A-NGA-CT is more compact)
Encoder with a button (can be purchased in any radio mag, the button can be not built-in)
-schild with a 5V relay (I purchased a bunch of Chinese relays without optical isolation at one time, so I needed another Optocoupler PC817 and a 470 Ohm resistor. If you have optical isolation on the nameplate, you can connect the nameplate directly to the arduino port)
USB connector
-2 3-meter USB extension cable (one for the power cord, to the second we solder the DS1820)
- DS1820 (with any letter)
soldering iron
-glue gun
Nameplate FTDI232

Step 1: First of all, we need to flash the arduino, because I have a Pro Mini (it goes without a USB-RS232 converter), I need to solder a ruler with pins to the arduino. From the side where DTR, TXD, RXD, VCC, GND, GND are derived. Now we connect FTDI232 DTR to DTR, VCC to VCC, GND to GND, TXD to RXD, RXD to TXD. Run the arduino IDE, download the sketch and flash it (sketch at the end).
Thermostat on arduino and DS1820


Step 2: Now let's take care of the hull. We tear off the sponge at the “FUKS”, degrease everything well, the deep part of the box can be passed with an emery cloth (something would stick more firmly). Mark the hole for the encoder, USB-connector (mother) and the display itself. Glue the relay to the box cover. We must try to place the relay farther from the processor and arrange the components so that the lid closes later (there is plenty of space).

Step 3: Now we take the USB extension cable, cut off the connector socket (mother). We cut off the cut end, drill a hole for the cable in the body, insert it and glue the key with a gun. Plus, the cable has red, minus black (I just check it), plus the plus of the connector, minus the minus (I don’t give the pinout of the connector - it’s on the Internet). Between the plus of the connector and 2 medium (I have them connected), a 4.7kOhm resistor must be soldered.

Step 4: We take 2 USB extension cables, cut off the connector (mother), cut the cable. Just in case, we’ll check whether we all correctly soldered. We connect the power cable with USB charging and to the network, stick the cut cable into the USB connector, look at the tester + on red - on black. We pull out the cable and solder the DS1820: - to 1, + to 3 the remaining 2 wires to 2. I then coat the epoxy compound (for repair of tanks, radiators), leaving a little of the sensor housing outwards, so that there would be a faster reaction to temperature changes.Well, we do the installation according to the circuit diagram (we connect the power and ground of the relay plate with the common + and - circuits, respectively).


Step 5: All circuit components are connected. We connect our sensor (without it, the display will remain black), apply power. In the first line - the temperature, in 2 if “*” is on - the relay is on, no - off. Now let's try to set the relay switching limits. Press the encoder shaft (or your button) the limit value appears at which the relay will turn on by rotating the shaft - the value increases or decreases. By clicking on the shaft again - we get the upper limit (the relay will turn off), set the value and press again. The device will monitor the temperature, the value of the limits is maintained when the power is turned off. All.

8
4.5
5.5

Add a comment

    • smilesmilesxaxaokdontknowyahoonea
      bossscratchfoolyesyes-yesaggressivesecret
      sorrydancedance2dance3pardonhelpdrinks
      stopfriendsgoodgoodgoodwhistleswoontongue
      smokeclappingcraydeclarederisivedon-t_mentiondownload
      heatirefullaugh1mdameetingmoskingnegative
      not_ipopcornpunishreadscarescaressearch
      tauntthank_youthisto_clueumnikacuteagree
      badbeeeblack_eyeblum3blushboastboredom
      censoredpleasantrysecret2threatenvictoryyusun_bespectacled
      shokrespektlolprevedwelcomekrutoyya_za
      ya_dobryihelperne_huliganne_othodifludbanclose
5 comments
cheaper execution possible.
Of course, the W1209 costs about 130 rubles with delivery, add a 12 V power supply to it, a relay and a case - that's all. But here I set + for the fact that the author solved the problem by the means that he considered suitable, and decided quite successfully, if you do not take into account quite understandable minor flaws.
From the point of view of universality of the solution of the five problem. However, I think a cheaper version is possible.
It is necessary to add a limit on the settings to the program so that someone does not accidentally knock down the settings.I would set n_pr_min = 2, b_pr_max = 8, based on the storage of potatoes in the subfield.
The connector for connecting the temperature sensor is unsuccessful, a more suitable place is next to the input of the power cable, on the same wall. And it would be nice to enter on the display a sign that the current temperature is displayed, and not the setpoint.

We advise you to read:

Hand it for the smartphone ...