Monitor Equipment Temps with the Dallas Temp Sensors, ESPHome, Home Assistant and Grafana

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today we're going to take two of these dallas sensors these temperature sensors and one of these esp8266 boards we're going to tie them together and we're going to monitor my heatsink for my power supply and my 2a radio that is sitting in the attic so let's build up this contraption and show you how it works [Music] okay so we're going to put this together i've already taken the wires and and tied them together and i'm going to show you the whole soldering setup and how i connected to the esp8266 board here in just a second when i talk about doing this by the way i'm talking about doing this uh for my heatsink on my radios and my power supply and the reason i do this is because where they're sitting in the attic it gets super hot and i want to make sure that i'm monitoring the temperature especially of the radio heatsink i have it tied to a system that has the potential to transmit for long periods of time and i want to make sure i'm not doing damage to the radio in addition i can add a power switch like one of my tasmota switches to the power supply and if it gets to be where it's too hot or or i'm out of town or something and i can't get up there and physically deal with it i can shut the power off so it's got a good use case i can also set automation to do that if it gets to be above a certain temperature for too long you can also use these things in a refrigerator freezer combo anywhere that you anywhere you can use the temperature sensors and the reason i chose the dallas temperature sensors over some others that will do the same thing is because of this right here it measures temperature from -55 degrees celsius to 125 degrees celsius or minus 67 fahrenheit to 257 degrees fahrenheit that will work in your freezer and it'll work in the attic and anywhere in between it's just a very wide range of temperature sensing ability and it won't die in the freezer where some of my other thermostats just can't work there the other cool thing is you can take one esp board and you can tie it into the sensors for both of these things in the freezer refrigerator so that's why i chose these they have a very wide temperature sensor and a very uh the ability to have a very wide tolerance so i can put them in the freezer frozenest or coldest places as well as the hottest places such as my attic so what we're going to do now is we're going to go ahead and get started with the soldering part of this i'll show you how i put it together on the board how i solder to the board which pins i'm using and then after that we'll talk about how we get it programmed into the esp8266 so let's run over to the soldering bench and get started okay so i've saved you the the heartache of watching me try to attach these wires together short of the soldering part so we're going to do some soldering here in just a minute so what you can see here i hope it's kind of blurry for some reason my camera won't focus on this very well but what you have here is you have uh the data wires and i've got two sensors together of course i'm running both of these sensors at the same time on the same input so i've got two of the dallas sensors and i'm tying them together onto one esp board and so you have right here focus you have uh the data wires tied together and then you have the uh the voltage plus voltage or positive voltage uh then in this case it's going to be three volts tied together and there's a four point uh six k ohm resistor between the data lead and the uh and the power that's the drop resistor and that's just a requirement to make this work since we're just feeding it with one data sensor or one data line and then we have our ground wires here are tied together and the way we're going to do this is we're going to just solder all this together we're going to cut this back to where it will solder onto the board the esp board and then we're going to go ahead and put some some shrink wrap or some uh yeah some shrink wrap on here so it's a little bit a little bit more protected so let's do some soldering real quick and if you don't want to watch me solder you can fast forward this part but we're going to throw a little solder on it oh look it actually focuses when i solder how nice so throw a little solder just to make sure everything stays together okay there's a little there a little solder on this one okay that's nice and then we'll solder this one together as well and you don't want a lot of solder on this you just want enough to get it together because it's going to have to go through the little holes on the board all right so we'll give it a second to cool down and that's going to be all soldered together or that's all soldered together now we're going to do is put a little bit of street uh shrink wrap on this so that we can shrink it up whenever we get onto the board and then we'll put a little bit on these two leads as well and leave a little bit of space here on both of these so that we can we can get them into the esp board okay so the length of the of the heat shrink doesn't have to be that long we're just going to kind of cover up this section so for this i'm just going to cut enough heat shrink um you may need another size here let me need to go to the bigger size let me grab a bigger size for that one all right so we're going to use this heat shrink here and we're going to cut it just back enough to make it fit on there and we'll just slide it back on here actually we'll use this piece and that'll be enough to cover that up we want to put it on here before we actually put the um the solder it on and you won't be able to get it past that we're gonna do the same thing for these other two just cut a little bit of p cut a little piece for each one of those so we can shield it and of course there's probably better ways to do this but this is the way i'm going to do it let me just make sure that's it's still a little bit too long so cut it back a little bit more and we'll slide it on there and the same thing goes for this other side we'll cut a little piece on there and slide it on we'll just slide it over here now these may not stay on until i actually start doing something with the board so we'll just show you where they're going to go and then they may not stay on there until we're ready to put them on this one definitely will stay so let's go ahead and pull these wires off of here and we're going to do is we're going to use this board this esp board and the the points we're going to use or the terminals or whatever we're going to use the the three volt here and i'm trying to get it to focus but just doesn't want to focus there we go there's a three volt line here that's where our power is going to come from and then down here on this side is our ground and then right next to it is or over here on d2 which is gpio4 that's what we're going to use we're going to use gpio4 and then 3 volts and ground and those are the three three leads that we have here so i'm going to start with the easiest one i'm going to start with ground and we don't need this super long uh cable here so let's just cut it back a little bit and of course you can once you get it through the board you can go ahead and trim it a little bit more make sure our heat sink stays on when we do this so this is where you have to have five hands and it's gonna go through this ground hole right here and you're just gonna put a little bit of solder on it to hold it in place now i'm going to flip it over so i can solder from the back side because i want to make sure i'm not soldering from the top and we'll do our best not to smash anything here and it's also labeled on the back side here if i can get it to focus which of course i can't ground is now over here let me make sure that's right here's our ground here's our d2 and then over here is our three volts so we're going to put it in from the other side but solder on this side here so let's go ahead and do that now this is again where you have to have three or four hands so i'm going to put it through and i've pre-tend these wires so it may make it a little bit easier to get them to work but you can see it's coming through there now and again multiple hands here let's see if i can just get four or five hands to work at once helping hands are going to be a must for this oops i pulled it completely out didn't i and we may need to use our other helping hand over there let me give a little bit of a bend there and that'll just stay in there for by itself once you have one of these on here you can kind of help hold the rest by doing this way all right so i'm going to put a little bit of solder not too much you don't want to burn the board or burn the pans the pads off just until it solders the pad there we go so that's all you need to do there and now you can see if i can get it to focus here that i have a little bit of solder on there holding that ground on there and it looks like yep sure enough i put it in the wrong spot so i stuck that in the d4 spot so let's pull it back out and put it in the right spot without destroying the board hopefully all right so that's out now fortunately i didn't destroy anything doing that this time we're going to put it in the right spot the ground that's where we want it we want it in the ground and then we'll go do the same thing give it a little bit of solder a little bit of heat and it's all we need there just a tap just a touch well i wish that would focus better apologize for not focusing i'm just not sure why my camera is not focusing on it today all right so we have our heatsink on here and we'll we'll deal with that in a minute we're also going to cut these leads back a little bit so they're not um so long and now we want to do is we want to take and do the same thing for our five volt or our three volt and also our um our data line so this is our voltage line we're going to go ahead and put the resistor through here that's going to provide our data i mean our uh our voltage but first let's make sure we put the heat sink on or the heat heat shrink heat wrap stick that through there i'm gonna leave it a little bit long because i want this piece to reach over to the other side of the board over here to be able to get to the data line i don't want it too short where i won't reach so i'm going to make it super short and then we'll do the same thing we did before give it just a little bit of a bump with the solder okay that's all it needs right there and of course we'll cut these leads back and then finally one more piece of heat shrink goes on there we'll bring this across the top of the board let me just take it out of the thing here to show you we're going to bring this across the top of the board here and we're going to put it over in a d2 here which is our gpio4 line and this one i'm going to put as close as i can to it and just kind of bend it back stick it back in our helping hand here and now we'll solder this one with just a touch of solder all right that's all we need to do okay now we've got that solder i'm going to go ahead and cut the leads don't shoot yourself on the eye doing this all right and one more we have our ground and then we have our voltage over here and we have our data line over here and if you look at the board here we don't have any kind of electrical contact between these leads and any other metal on the board we're going to further that up by putting a little bit of heat shrink on that this is the part where we get to play with fire i'm going to use a little uh one of these little flame deals just gonna heat it up a little bit not too much just enough to get it done all right so now that one on the ground is pretty much melted on shrunk the way it needs to be and we'll just double check to make sure that this is in the right spot and we'll do the same thing here without getting too much heat on the resistor so let's just shrink this up a little bit hopefully it's small enough to shrink just just touching it barely touching it all right that's good and i'll do one more on the other side for the data line this one's a little more tricky let's go underneath here you may not see this on the camera very well let me go underneath this one just heat it up a little bit without melting any components or the resistor just tapping it all right so now we have our ground and our data line and our voltage and we have this this little resistor here drop resistor between the data line and the voltage so this should be enough to get us uh connected with these two sensors and the next step is now to install the firmware on this esp8266 and get it set up so that it can read the values from the two sensors so we'll get started on that next now that we've got everything soldered up i've gone ahead and connected my esp8266 board to my raspberry pi usb port you can also do this directly from your pc on a usb port as well so the first thing to do is let's go over to our raspberry pi and over here behind me you'll see the plus sign here i'm going to click on that i'm going to give this device a name i'm going to call it attic radio monitor uh esp so i know it's what it is and then i'm gonna put in my wi-fi ssid and my wi-fi password and that way it'll when it configures it it'll connect to wi-fi click on next and choose the correct device you can do this on an esp-32 as well as an esp8266 pretty much the way you solder it or where you solder it's the same you just have to make sure you set the right configuration up all right but we're going to use esp8266 next now it's created the configuration i'm going to go in here and i'm going to install this just straight up the way it is now without any kind of configuration for anything else so it's plugged into the computer running the dashboard that's my computer or my raspberry pi uh usb 0 and now it's going to go through the whole process of flashing this with the esp home software now i've made a whole video on esp home stuff so you can watch those it tells you how to do this via the usb port on your computer and also this method that i'm using here with vesp serial port or directly from the serial port connection over usb on the raspberry pi so give this a second here to finish up and then we will come back and we'll start working on some more of the configuration once you see this screen here it's ready to go so we can stop the logging here and we're going to go in and we're going to do some editing of the configuration file so that we can actually utilize those dallas sensors okay so in order for this to work we need to go in here and we need to make sure that we enable a couple of things now all of this information is on the esp home website which i'll link in the description below the dallas temperature sensor has a hub a component hub and the reason why is you can add more than one sensor to the same input line which is what i've done uh in that when i showed you the how i soldered that everything goes to the same input line you're going to be able to tell the difference using the address of the sensor which we'll talk about in a few minutes but this dallas component allows you to use your one wire temperature sensor and so you have to define the hub and the hub is going to be where that actually is installed so we installed that on gpio gpio2 or4 and if you look at this page here it was d2 which corresponds to gpio4 so we're going to go in here and we're going to set our hub up as gpio4 and once we do that we're going to see a listing of these sensors come across and we'll be able to tell which what the addresses are for the sensor so let's start there let's start by adding the dallas hub configuration in here i'll just stick it up here at the top and i'm going to change the pin to gpio4 because that's the pin that we're going to run this on i'm going to go ahead and save it and then and i'm going to install it now and the reason i'm doing that's because i need to get the the addresses of these particular sensors that are on there and i can't do that until i actually view the log file so once we save it and we do an install and again i'm doing this directly connected to the serial usb serial port it'll show us the sensors that it finds on there so you now see it's setting up a dallas component it's starting up the wi-fi and it should detect both of those sensors and here we are right here so here are two sensors right here we have these two values for addresses i'm going to go ahead and copy these before this scrolls off the screen so let me just ctrl c that and i'm going to put it on a little notepad so i can keep up with it so i have both of my sensors and that's going to be important so i'm going to stop this now that i have my two sensor values and looking back in here at our settings i'm going to create two different sensors because i have two of those dallas devices attached to the esp board so you need a platform an address and you need to give it a name so you you can reference it in your setup later on so we're going to take and just copy this and i'll change the appropriate values we're going to go back in here we're going to edit this esp board and under this section i'll just stick it here we're going to have a sensor here under the platform dallas which we defined above here and my address is going to be the first address that i got for my first temperature sensor and i'm going to call this one power supply i'll just say power supply for short and i'm going to paste another block exactly the same way oops let me go back and copy this right here copy it and i'm going to put it down here under the same block i'm going to copy the other address for the other sensor into this block as well paste it and i'm going to give this an address or a name of radio heatsink i'm going to get rid of this space just for housekeeping now we're going to save this and i'm going to verify it this time to make sure that it looks the way it's supposed to or validate it it'll come through here and everything looks good and i'm going to install it again via the usb serial connection and it'll go through the same process and install it on there and once it installs it and those sensors start sending data then we should actually see the data values come across because we've given them addresses for the esp board to understand that that's something they should it should be looking at it also takes a lot less time to compile it and write it this time because it's already done all the work to build it and already you can see here that we have power supply sending state this value and radial heat sending state with one decimal of accuracy now the already the temperature sensors are working the way it's supposed to and that's all you have to do to get it up and running on the esp board now what we've done is we've created this in the esp home dashboard here so now that this part is done we need to add the integration to home assistant so that it can see the values the entities that it's going to be getting the data from so you can either go into configuration and integrations here or typically you'll get a notification that it sees these values and it says new devices discovered i'm going to click on check it out and it now sees this attic radio esp8266 which i can then click on configure it asks me if i want to add this one to home assistant the answer is yes submit and now it's found it you can give it an area let's call it attic for me okay and so m finish and now you should actually see uh this device with two entities so one device two entities and then our two entities are sensor power supply and sensor radio heatsink those are the two devices that we created and now finally if you go to developer tools or you could have clicked from where we were just a minute ago but go to developer tools and then search for heatsink you'll see that i have sensor radio heatsink with a value of 72 degrees because it's down here on the floor it's not actually in the attic yet and the other was power supply and now you have sensor power supply so you have both of these devices reporting into home assistant now i'm running home assistant uh on my production odroid as well as this right here so i will actually see these show up as discovered entities or discover devices on my production home assistant and for that let me go over there now and it will show me the same discovery devices here under notifications so it's discovered in a new device check it out now that i've added that like i did like i showed you on the other one we can go in here to developer tools and we can look at those same entities so i'll look for heatsink here it is right here the reason i bring it over into this one is now what we can do is we can go into grafana under my environment or whatever dashboard you want to create or use i'll just say environment for this and i will add a new visualization empty panel it's going to be time series over here and my measurement should be fahrenheit if i go to the very bottom here and my entity id should be the heatsink so here's my radio heatsink i can plot that and i can add an additional query for the same thing so fahrenheit and my entity id is going to be what is this called power supply there we go power supply and so now i have two different items here let me name them power supply and this will have an alias of radio heatsink let's give it a title of um radio system tips that'll be my title of my panel over here what else we want to change i want to go ahead and make these lines i want to set the connect always values and i can set some thresholds later once i baseline this i'll apply it now and go ahead and save the dashboard and we'll just kind of zoom in a little bit here not a lot of data points yet because it was just turned on and added to home assistant but you'll start seeing these data points here and then you can start looking at the values coming in and being able to determine what kind of course action you want to do with it when you start seeing the values change i'm going to be plotting this stuff on here so i can kind of see what happens as the transmitter is transmitting and get an indication when there might be too high of a temperature on that transmitter so let's go ahead and put them on the heatsinks where they're going to rest and kind of start plotting some real temperatures and then over time we'll be able to see what happens here so that's uh it in a nutshell you go from taking those dallas temperature sensors uh wiring them together using the resistor getting them soldered to the esp8266 board getting the firmware updated to include the dallas hub and then define the sensors and then start putting it into use if you have any questions drop those down in the comments down below if you're not a channel member please consider joining the channel and thank you to those that have already joined and support the channel here helps me buy these little devices and things that i can use to showcase on the channel here hit me up in discord if you have any other questions and we'll see on the next video [Music] you
Info
Channel: mostlychris
Views: 3,856
Rating: undefined out of 5
Keywords: Smart Home, Home Assistant
Id: wNhZLdVmqjE
Channel Id: undefined
Length: 25min 28sec (1528 seconds)
Published: Sun Oct 31 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.