#222 "Smart" Workshop Heater Control - ESP32 Wireless Solution?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
and welcome back now this week we're going to be looking at esp32s as a potential solution for my workshop heater problem what's that you're not aware of my workshop here's a problem well it precedes even my current workshop in which i have the aforesaid heater um the problem is this i have a heater it's a two kilowatt-ish standard convector heater so there's no fan in or anything it's just just blows when it doesn't blow it just lets hot air rise through it and it's on an independent circuit from the consumer unit aka the fuse box and uh yeah it works great well i say it works great it's got a bi-metallic temperature switch inside which is as we all know it's sort of a bit you know rough and ready isn't it the hysteresis between the on and off is probably a bit large but you know that all aside it does work well it heats up my workshop no trouble at all except of course when i leave my workshop and i hit my kill switch by the door i usually forget to turn off the heater what happens yes it's on all night wasting power more importantly wasting money and of course there's the risk then that something bad could happen with it so we need a solution that will enable me to turn off my heater at the appropriate time but also we want a few bells and whistles after all this is an arduino channel isn't it we just don't want an on off switch which of course is the most simplest solution yet let's let's think about a few things i want to do a shout out for jlcpcb no stop stop don't go away look what they're doing two dollars for aluminium circuit boards this is absolutely incredible if you've ever wanted to try an aluminium pcb now is the time to do it now remember aluminium pcbs are single sided normally with the aluminium on the bottom then you have a dielectric layer that transfers the heat up to the top copper layer now aluminium is very very strong and it will suck the heat away out of your components without the need for extra heatsinks for example go and have a look at their website and check them out and there's more jlcpcb now allow you to create your own parts library because there's nothing more disappointing than creating a pcb and then finding you can't get the parts or there's a big long delay now you can create your own custom parts library to ensure you get the components you need and of course the associated footprints so you know they're going to fit on the pcb itself to get to this page that describes everything you ever need to know about creating your parts library simply go to their home page and then click on the link at the top very very simple and a really really useful feature go and check out jlc pcb now let's let's think about a few things so the absolute simplest solution would be to add another switch underneath the kill switch that you can see there on the wall that big switch there with the red button on it that is my kill switch and turns off all the power in my workshop apart from the essentials like my computer which runs 24 7 and a couple of other bits like the wi-fi but most other things like soldering irons hot air guns and everything else is all switched off they're the sockets that you can occasionally see in these videos that are above my workbench but the heater circuit is on a separate one and i could easily run a wire from the existing heater socket metal clad socket up here and i have another one of these switches underneath it identical in every shape and form so when i leave the workshop i could switch both off job done finished well that was a quick video wasn't it what's that where's the bells and whistles then oh you wanna yes exactly arduino channel well i say arduino all things microcontroller we want a more sophisticated solution don't we than that okay then we've decided upon a more sophisticated solution which involves some sort of microcontroller usage but let's have a look at what my actual heater looks like without anything doing to it whatsoever right so there's a picture and that's it i mean it's a it's a resistive element in a metal case with a bimetallic switch which as i say works well enough i've absolutely no idea how accurate it is in fact the way you set the temperature rather than looking at the dial which doesn't really tell you the temperature you think yes it's warm enough or i'm a bit cold i'll turn it up a bit i mean that's how it works okay so this should be pretty easy to control shouldn't it by some sort of microcontroller let's have a think about potential solutions then before we look at actual hardware okay let's uh have a think about what we're talking about and there's the hills heater on the screen there as we've just seen that's great now if we bypass the metallic strip inside it would look like that the neutral coming in on one side and the live on the other or it might be the other way around doesn't really matter does it when i say bypass that switch what we can actually do is just turn the switch up to near maximum so it's always on and that'll have the same effect let's think now about the actual micro controller unit yes now what do we want this to do well one if it's going to do anything intelligent it's got to do do it wirelessly hasn't it got to be able to communicate with it somehow so that's the first thing it's got to have a wireless element to it obviously it's got to have a temperature sensor realize how will it know when to switch the heater on okay um yes we do need an override button i think so that if i'm sitting here and i just want to say on or off for whatever reason i can do it but more importantly i can do that remotely via the wireless system as well so i can just go on we'll see about adding a little bit of intelligence into that sort of mechanism later on uh real-time clock i've said here um yeah i said built in as well in brackets underneath it would be nice to know and it could be essential to know what time of day is so real time clock would enable me to say i can have a schedule i can say come on at seven o'clock every morning ready for me to turn up about half past seven and it'll be warm and switch off at night say six pm regardless yeah even if the temperature gets cold but more importantly if it gets cold overnight and it drops down to say 10 degrees it goes i don't care that it's two o'clock in the morning i'm switching the heating on for a bit yeah so all that sort of stuff can be done intelligently if we know what time of day is great uh yeah obviously we'd like to know the status so some sort of indicator on whatever it is i've got this built into oh yeah and finally of course we do need a power relay and by power relay i mean something that's going to be reliable and swift being able to switch i think it's up to eight amps so eight amps is what that heater is on maximum power it's got two settings low and high which i'm not i'm not probably not going to try and control each of those settings can you just have it on or off i think on the high setting um but it's got to be this has got to be reliable we don't want any fused contacts i'll probably put some kind of snubber across those contacts as well just to stop the arcing that over time will kill it so basically that's what i'm looking at um how does this help me then if i leave the workshop turn off the kill power so my workshop goes dead most of it and but i forget the heater well not forget it i deliberately leave the heater how does this know that it's time to switch off the power well this is when we come on to this bit over here the wireless heartbeat not since i've said sensor censor that it's really a transmitter so somewhere in this workshop there'll be a little tiny unit plugged in to the kill switch power and every so often and it doesn't matter how often yeah every it could be every second yeah it could be every minute it doesn't matter it just sends out a signal to this one here wirelessly and says i'm still here and this is that's great because i'm just going to continue doing what i'm doing the minute that doesn't happen so this communication is lost and this is now convinced that there is no more signal this says you've left the workshop you turned off the kill switch i'm going to turn off the heater simple as that so this could be quite simple in the sense that it doesn't have to be a you know a dual core processor or anything all it's doing is sending out one little thing to probably some kind of web interface on here that just sets a variable okay that's nice and then finally um it'd be nice although i've said yes we can have an override switch here manually i'd like to override that with something like a mobile phone so that as i'm getting ready in the morning and i think right i'm just making my breakfast and all that i want to go out soon i can fire up the application on my mobile phone and say time to switch on this goes oh okay i'm i'm on now it's sort of overridden here um i don't know is it is that right is that the right expression to override it's not really it's sort of a go command isn't it because yeah it's about right time of day and you're telling me to go so i'm going on it is so every time i get in here it's all nice and warm and lovely it would also be nice but it's not going to happen straight away is for my new variac controlled fan which is up there that one works beautifully with that variac by the way but there's a much longer story than the variac for that fan but that's for another video it'd be nice if i could also switch that fan on at the same time because what that does is blow the air around my workshop rather than having it concentrated over that side where the heater is we have to bear that in mind i think whilst we're designing this bit so that this can perhaps send out a signal to something else to say oy fan go okay so that's that's generally my thinking um micro controller then what we're gonna use now choice of micro controller then comes down to something that has wireless capability not something that we've got to add wireless capability onto so that discounts really the arduino and nano and all that even though to be more than capable of doing what we need to do to control a simple relay but i'm thinking okay which what processes have we got that would satisfy that you know without going off piste a little bit well there's two that spring to mind the esp8266 and the esp32 whilst they're from the same stable if you like they're quite different though now the esp8266 i might bring this little unit over here this is in fact the prototype unit from my mum's home alone project what is my home alone project you ask basically this pir here detects when there's movement in her flat in stuttgart some you know 800 miles away and logs the fact to the internet things speak actually there's two of these units then they're both talk to thingspeak which means i can have a little app on my phone that i didn't write it was a freebie and i can detect that there's movement and everything's okay because if if there were no movement for any length of time this sends out an email to me and my brother and his wife and all that to say um i think you better check out and yeah it's been very very useful and it's been running now for like three years solid something like that brilliant little device though i sat myself i'm not trying to brag here i'm just saying it it was well designed and works well so this is the esp8266 d1 mini well not that bit isn't that's an sd card that i'm using the actual device is in here well i would give you a closer look but i haven't got another one that is my only one that i've got left as far as i can tell but anyway as you can see from here and here all these little d1 compatible components plug into this base unit so from that point of view i i have experience with the esp8266 i'm happy with the performance it doesn't hang it just just works it's a good solution but even now if you can see look there's a triple in there that's that's triple bass and already it's starting to stack up and it's getting a little big isn't it bearing in mind that this white thing over here which is a standard uk double socket back box or patras it's got to fit in there and well i'm getting a feeling this is going to be all about the tight fit so i'm not quite so sure about that at the moment now the obvious alternative is an esp32 it's not something as large as this this is what runs in my esp32 web radio and it's got lots of memory on it and ps ram and stuff like that that is just ridiculously large and yes it would fit in there on a pcb but it's overkill we just don't need all the facilities this has and in fact it's even got as an sd card reader there reader writer so we don't really need that but i quite like this one now this one's a d1 mini no it's not it's a esp32 mini mini 32 you can just about see it they're not v 1.00 i'm always a little bit hesitant about v 1.0 stuff but this seems to work all right now you notice the led that i've stuffed into those two sockets on here yes i've soldered these headers on at some time in the past i must have been experimenting i guess with long headers on one side and short on the other because it's esp8266 d1 mini compatible in footprint and footprint only so i think you can use like that mini screen and all that i think you can plug those into something like this um yeah it's it's not for me this time but anyway it's the d1 mini i've got another one of these without all this all these sockets and things soldered on so they're quite low obviously would fit into here quite nicely because it's quite small however one of the things i hate doing and i'm sure you do too if you plug in the usb cable in here but to upload the code you've got to constantly press one button and then another one and then you release the first one and then that one then you've done it too soon and it goes oh i can't sync correctly yeah we've we've all been there we've all been there so i thought i'm not going to use this if i have to do that i just want to plug in the usb cable as i do with an arduino and it just uploads so if i can get the blink sketch on here without having to press any buttons i think we're on for a winner don't you oh and look at that blinking it's all its glory yes all i did was plug in the usb cable loaded up the blink sketch for the esp32 well i modified the existing one told it to output on d27 because that's the outside pin there and the ground is right next to it and look at that straight away no issues at all so that's that makes it a nice contender for what i need to do okay let's see how it all gonna how it's all gonna fit into this little unit here then so this is a standard uk back box for a double socket and on the front of this i'll simply put a blanking plate and into which i can drill holes and things for leds and as you can see there's lots of room this is a relay not the one i'm going to use because it's not high power enough this one says 7 amps at 240 ac well seven amps is not eight and i wouldn't be pushing it that hard anyway even if it said eight on there would i want to use it no it's at the end of its uh extreme uh power capabilities isn't it so no so i'm going to use a different relay but it's not going to be hugely different to that and then of course this unit here now the mains will be coming in down the bottom to be switched by the relay so that's it isn't it we can use the mains directly to power all this can't we so here's a nice little circuit look for a capacitive power supply which means we don't need any transformer or anything so over here we have the line input we have a zener voltage here 5.1 actually we don't want 5.1 we want 3.3 but there's a power ldo on that board so it'll drop it from 5 to 3.3 anyway so that's okay reservoir capacitor d2 to stop this discharging here's the the crux of it this is the capacitor now it says here 0.47 microfarads 250 volts um not in the uk that might be okay for the states we've only got 120 volts but this has got to be well above peak not just rms so we'd use something like 450 volts in the uk um even 600 quite frankly these are the capacitors you find in ceiling fans to slow them down and uh they they work very well that's that's the subject of another video and then we have a a dropping resistor here while i say dropping it's an inrush resistor here 470 amps half a watt and yeah it says here look it limits the inrush current and it doesn't dissipate that much heat actually at all so we get like the power for free don't we mains in power out what could possibly go wrong what what dangerous yeah okay this is dangerous in the extreme it works and believe me there are many many many commercial bits of equipment out there that do just this because they're sealed units not meant for prying fingers or arduinites to go in with their test probes and oscilloscopes to find out what's going wrong i can't think of anything worse this is very dangerous unless you really really know what you're doing and what you're thinking some cowboys develop this circuit yeah i know let's see who actually developed this shall we oh there is there oh it's microchip that told us to do that look at that now that's an interesting thing isn't it when i first read it uh in conjunction with how to control my workshop fan up there this popped up and i thought that's interesting for a future video perhaps i can use that so microchip is saying we can use that circuit to power up its chips and with a few caveats basically don't kill yourself know what you're doing and you can get away with not using a little tiny transformer a power supply an isolating transformer power supply interesting and yes it would work i'm sure and lots of products do exactly this i'm not going to so yeah come down off your soap boxes everybody was going to say don't do it because that is very dangerous to use that and it does tell you that it does tell you that in its write up and that's the warning that it has plaster of his thing basically a necklace electrocution hazard exists really do you think yeah no transformer for power line isolation oh really i didn't notice yeah an isolation transformer should be used when probing the following circuits absolutely now as it happens i'll show you what i use when i have to go into mains power supply because i don't want my oscilloscope to blow up and if you remember when i did the video about my fan controller with the variac i said i'm not going to put my oscilloscope on it and then i decided well actually i can put the live on it just the tip of the probe but not the earth because i don't want the earth shorting stuff out but what i could have done which would have been a better solution than what i normally do is to use one of these so this is a mains isolation transformer and its only job is to accept the incoming main supply here and send out another exact same equivalent voltage main supply out here but in the middle there's a warping great transformer and this is big and is heavy right and i keep thinking i should really bolt this down to a piece of wood and have sockets and things but i don't use it that often it just gets in the way and beings are heavy it's not something you just sling around the workshop now on this particular model it's got 215 volt outputs does it ever say no it doesn't say anywhere oh hang on here we are well so the secondaries are two what times one one five uh the input though is 200 but it says 230 because that's what the official voltage is in the uk at the moment it's actually 240 the reason why everywhere says 230 so that we could harmonize with the eu even though we've left now it's 230 plus or minus i think 10 percent so we went but well within that and the secondary as you can see it's only half an amp it's not a lot well less than half an amp you simply put these in series to get your 230 back out again great so that's what i would use were i to use that circuit from microchip and power that circuit up without any kind of isolating transformer but we're not going to do that when i repaired my workshop heater unit in that video there look um basically it the heater failed i can't remember exactly what the fault was now i think it i think it wouldn't go on anymore just went off all the time anyway um i took out the control board the printed circuit control board figured out how it worked and put in a strip board with an arduino on it a nano actually and ran it from that i was a little bit nervous using all that mains electricity around it but it works and still works and it's sitting under my workbench ready for the colder months of the year later this year that worked fine but to power the arduino itself the nano i thought i can either go the root of the original pcb and use that exact same circuit from microchip and power it directly from the mains or i use something like this now the one i used in that workshop heater repair was a slightly different version to this and there was a little bit discussion about whether that one was safe or not and i said well only one way to find out so i used it and it's working fine at the moment but this i think is a better version it's certainly got a lot more feedback and reviews and people are saying this actually does work very well so i'll be using this you have ac input over there so you get 240 volts or 120 because the input is you know quite wide range isn't it and the output is 5 volts at 5 watts so you get a whole amp out here well i don't need anything like an amp to run this i probably need two or three hundred milliamps tops for the esp8266 and when the relay switched on i probably need something like 60 to 100 milliamps to turn it on now i've been through my little box of relays here and none of them are suitable for what i need so i'll have to get something else however if i'm going to drive a relay from 5 volts which all these here do it means i'm going to have to take the 5 volt supply that is also supplying the esp32 i'm a little bit hesitant about that because the current required by that relay because the voltage is so low is quite high in fact i worked out that the the relay that i need has a coil resistance of 36 ohms which means it's going to require 138 milliamps to pull in which is okay the power supply that i'm going to get something like this would supply that no trouble at all but given that it's going to pull 138 milliamps from the supply that this is using i don't want any brown outs happening and i don't want to put in whopping great electrolytic capacitors to prevent it either now if i were to use a 12 volt relay instead which i haven't even got a 12 volt relay which would have a higher coil resistance in fact the one i'm looking at has a coil resistance of 200 ohms that means it'll only require 60 milliamps and of course the good thing is that the 12 volt supply from one of these is not directly connected to the 5 volt supply that's going to eventually connect up to one of these pins on here so that gives me a double bit of safety if you like one is that the power supply that i can use will be a dual power supply will give me five volts on one pin 12 volts and another a common ground and they're both regulated supplies the 12 volt supply on the power supply is lower than on the five but it's more than enough supply that's 60 milliamps for the relay and the 5 volts which we'll go into here is half an amp or something which is plenty now the size of it is uh still about this size so what with that in there that in there and that in there as you can see there's still plenty of room and if i get a simple pcb made up where all these things are on and we keep the mains incoming supply well away from everything else you know have proper spaced and soldered up tracks possibly with some kind of air gap in it exactly as i did really with the workshop heater repair i think we're going to be good to go frankly and it's going to be quite an easy little project well the hardware is going to be easy on the code is going to be somewhat more difficult yeah right if you like this video or you think you've learned something please do give it a thumbs up i'll be really interested in your comments down below you know suggestions and how you'd approach this and whether i'm on the right track because i'm about to order some of this stuff and don't forget if you're going to subscribe and i really hope you do don't forget to subscribe and tick the notification bell otherwise you'll never get told about new videos from me okay great stuff yeah i know youtuber nagging me to tell you that okay that's it thanks very much see you in the next video i hope you're finding these videos useful and interesting there are plenty more videos to choose and a couple are shown below and if you'd like to subscribe to this channel just click on my picture below and enjoy the rest of the videos thanks for watching
Info
Channel: Ralph S Bacon
Views: 8,443
Rating: undefined out of 5
Keywords: Arduino, Beginners, electronics, C++, microcontrollers, programming, gadgets, ardiuno
Id: xJ8Q3ysC8Q8
Channel Id: undefined
Length: 26min 33sec (1593 seconds)
Published: Fri Aug 13 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.