Home Automation Hangout 2021-05-02: Just chatting

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay [Music] [Music] ah that's funny i think it just took about you know that intro video that i just ran i think it took about two minutes to do the one minute countdown that is terrible and i've got no idea whether this is coming through okay or not so first though i acknowledge the traditional owners of this land i pay my respects to their elders past and present and to aboriginal elders and peoples from other communities who may be taking part in this live stream today now my uh i've got to find my cursor where is it the problem is if i oh there it is okay so that was not a good start good morning all my super friends uh dodgy i see you here michael amanda austin uh i was just trying to scroll in the chat window and i got the little spinning beach ball because it couldn't update fast enough uh bob bob p thanks for coming along johnny james all the way from millie walker aaron peter lots of lots of the regulars here today so uh i think it has settled down my before the live stream like 20 minutes or so ago i tried to open a terminal window and i sat there for a minute and it popped up it opened the window but it didn't actually bring up the uh the you know the command prompt nothing happened i was sitting there waiting and i was thinking this is not a good sign my computer was so laggy that just moving windows around was slow and i thought ah no worries i'll just reboot before the live stream and everything will be fine and i sat i rebooted and then logged in and sat there it took 10 minutes and it was still opening windows and churning and churning so oh james james maraca i just said watched a few episodes from california past few months today watching from sydney hotel quarantine so you're back in the country james it's so long since i've seen you when did i last see you i think it was probably at an lca maybe 10 years ago give or take something like that so long i hope you're doing well and you finally made it back from um back in through okay i don't know if i would really want to talk about this but the whole thing about preventing people coming back into australia from india that kind of pisses me off so if you come back into australia from india you can be thrown in jail and find i think it was like sixty thousand dollars but you come back into australia from the usa and it's no problem you just go through quarantine as usual ah okay let's stay away from that subject in any case james i'm glad you've made it back so uh now jordan said hd might be dying yeah i don't know this is a machine that's got very few hours of run time in fact uh i can probably find out the runtime but i won't it's a computer that was used in the ivt office quite you know some years ago and then when ivt was sold and the office was disbanded this computer came home and it's been sitting on the bench over there as like a second machine backup machine views very rarely so it's uh it's hardly it's a few years old like what what is this machine about this mac okay i clicked it i'm waiting for the window to open this is how long it's taking to open the about this mac window still waiting i'm still waiting it's opened it's a late 2015 imac with an i5 gig of ram and it has not done very much work at all but it but it seems to be struggling today so anyway what are we going to do today brain i thought that i would talk to you about that because all right my original plan had been that we would do a little bit more hacking on the ut61e multimeter and mess around with that uh how we offer hard drive space gavin asked heaps heaps it's not that's not a problem in fact i wonder if this is a fusion drive i don't even know i've just clicked the hard drive icon to find out and i'm waiting waiting i've got the spinning beach ball ah it's open 578 gig available out of one terabyte so i'm using like 40 of the disc or something not much anyway that's another subject so what i was going to say earlier was uh i have a feeling that people are kind of bored with the ut61e hacking so maybe we'll take a little break from that i'm uh i was intending to go back on uh yeah back to do back to doing the ut61e hacking i have to collect my thoughts now sorry about this but one thing i noticed is that live stream viewers have been down have been falling off basically fairly dramatically over the last couple of weeks in terms of numbers and to some extent okay two ways of looking at this one is it's my live stream i can do what i like i can talk about what i like and if you don't like it go away so that is to some extent that's the attitude that i take with doing videos for my channel because i'm not here to build a big audience or you know those sorts of things i'm here to work on fun things things that interest me and to talk about it and if it's not interesting me then why would i even be bothering so that's one thing is i could just keep doing it but the other way of looking at it is these live streams in particular this is kind of like a conversation it's me talking to a whole bunch of you all at the same time and if you're having a conversation with a friend like you're just sitting there chatting about stuff and the friend was talking about a subject that you weren't interested in you didn't want to you didn't care didn't want to keep talking about it it'd be pretty rude to keep pushing that subject so i don't want to keep doing things that people don't want to see or keep talking about things if you don't want to talk about them yeah okay scott said doug nabbit was hoping to see it finished this week um yes uh my expectations of how quickly it could be finished have been totally reset since the first week my idea was in the first week we would probably get it publishing to mqtt and then the second week we would be doing something like displaying the data on the screen but no three weeks and all we've got is to the point of publishing to mqtt uh well we can do some of that stuff but also this is a bit of an example of survivor bias which is a a really cool topic as well if you i really really like this example the whole thing about the surviving world war ii bombers and uh and the analysis that was done to see where this is kind of a cool topic i think i might have even talked about this before let's see oh no i've just tried to open a browser window spinning beach ball all right ah i've got a browser window i'm just going to chase this squirrel for a little while because what is this live stream except chasing squirrels survivor bias yes survivorship bias here we go here is the first squirrel of the day and we are just getting started all right so this diagram and i'm going to switch to desktop view desktop view where are we there we go okay this diagram which i'm sure many of you will have seen before some probably have not is a really interesting story from world war ii i believe it was i'm probably going to butcher this story but my understanding of what happened here was there was an attempt to improve the survivability of aircraft in world war ii and so an analysis was done of aircraft and where the damage was located on them and the thought was okay if the you've got all of these aircraft returning to base after missions and they've got damage all over them in different places so what we should do is look at where they're taking the damage and then work to make those areas stronger make and protect those areas so what they began doing was an analysis of all of the aircraft and a diagram like this and then make a mark on the aircraft to show where that damage was sustained and then over time you can make a thing like a heat map like this diagram that's on the screen right now that shows okay these are the the aircraft that come back like the aircraft that have been flying on missions this is where they're taking the damage therefore this is where we should be concentrating our efforts in making the aircraft stronger and at first glance you might think sure that seems really obvious but the interesting thing is that what this diagram is showing is the exact opposite of what you think it is because the aircraft that come back are the ones that have survived the mission the ones that don't survive the missions are the ones that were damaged in the other locations that are not shown in the diagram so it's like an inverse heat map and so any effort that is spent on making the aircraft stronger in the area shown by this diagram means that you are fixing the exact wrong thing and the aircraft that take damage on all of the wide areas like the engines the cockpit the center rear section of the fuselage those are the ones that don't make it back from the missions so you have to make sure that you fix those areas anyway i just think survivorship bias is a really cool concept so um one yes yes scott said but if it returned to base the damage they can see is irrelevant yeah what this is die what this diagram is showing is the areas that are capable of taking damage and the aircraft still flying so those are the areas that you don't care about in terms of improving its survivability anyway i really like that concept i like logical fallacies in general they're interesting to um to play around with ah so oh andy said is that like the stockholm syndrome for home automation projects maybe oh incognito said ntp analog clock um yeah that's another interesting one uh so bob p says this does interest me especially the mqtt into obs bit all right so i forgot the reason that i was just telling you about survivorship bias is for a few weeks now i've been talking about doing this hack on this multimeter and the people that are still with me which means you are the ones that actually find it interesting so if i ask you right now should we do some ut61a multimeter hacking you're going to say yes and the people that haven't come along to the live stream today because they're sick of it they're not going to say anything so um i thought that at least for this week we might take a slight break from it although what would be a good move i think is i might even on the live stream today what we could do is push the stuff that we've got so far up to github and then if any of you want to look at it hack around with it try to do it yourself improve on it go for it so um james said yes peter said no i don't even know what you're replying to captain said yes but they're not here so if they're not here we should just do what we want okay dodgy says no i don't find it interesting i don't have anything to do better to do this sunday morning yeah i don't have anything better to do either um but i appreciate you coming along dodgy adam p says can't we do both oh yeah all right uh incognito first week for a while welcome back now um now this leaves me with no idea what to talk about so i so sorry so all right what i'm gonna risk it all and try opening a terminal come on term term item so that maybe i can push some stuff to github term it's still opening come on i'll get to a command line eventually one day coffee well in that case i should give dodgy i should give a shout out to erica erica good morning i hope you're having a great sunday morning oh i've got my terminal back uh so james asked have you been using the test probe jig that you assembled on the stream no it's sitting oh you can't quite see it it's just behind the second microscope so get that one out of the way there's another microscope behind it and then behind that is the uh the test jig but i have not been using it and scott says do all the things order pizza and keep going until midnight that is very tempting i could just i could just order pizza at the start of the live stream but then you'd all have to be watching me eat which would not be good all right so i'm before i bring up the um the desktop oh aaron said oh this could be an interesting little um squirrel chase aaron said i have a question regarding an esp32 and a single pole single throw light switch and trying to get it to operate like a push button to use deep sleep that is interesting touch portal has just opened touch portal is the program that i use for changing cameras and things on obs i started launching it before i began the live stream it has just finished opening so i'm just going to drag that out of the way and [Music] where what was i doing okay i've got to go into dropbox super house projects ut61e wifi here we go um so aaron that was an interesting question about deep sleep and the single pole single throw switch i think that is worth talking about i may not have an answer for you but it's an interesting question so we could probably get back to that uh firm untracked files firmware resources let's see firmware it's not very exciting watching me push stuff to github but uh okay i think it it's worth doing because then you can poke around on this stuff yourself instead of just watching the live stream wi-fi i'm gonna sorry i've got to do something before i switch to the desktop so you can see what i'm doing because i don't want to reveal my all my network credentials so what i'm going to do is to copy config to config example and edit config example to remove all my credentials and then i will be able to switch to a view that you can see and it will be less interesting so go and chat among yourselves which you always do anyway okay your ssid your pass your psk so we've got events blah blah blah in this config file you know how we started off by taking the the air quality sensor project and then butchering it i'm just looking through the source code for this now and it's still got pms entries everywhere particulate matter sensor rx from ut i gotta change this ut61a equals ut61etx that'll do uh i'm not going to clean this up more it's a bit of a mess but so what all right now i've got to add a git ignore git ignore and i'm going to add config.h to the gitignore so that you can't see all my details so um i wonder if this is gonna work cd git add dot get ignore this is probably something i should have done before the live stream isn't it i think it might be git add firmware ah i've got a repo inside another okay all right i'm just making a mess and i'm making you wait so i'm gonna give up on that for now but what i'm gonna do is what i will do is create a repo so that at least there's somewhere that you can check after the live stream now what have we got yeah sorry i think you're right you don't want to see me eat pizza all right peter lawless suda make me a coffee that is tempting i could make a coffee and ship it to you um all right i want to get back to aaron's question because that is interesting and i'm sure that there are people here in the chat who will have an answer to it so what was i doing come on change the desktop all right so let's um before we get back to aaron's question let's make a repository new repository and stick it on super house and ut e wi-fi that'll nope already exists okay i must have already i must have already done that where is this fictitious ut61a repository oh there it is all the way back there all right so i've got this repo but it does not have the firmware in it this is from when i started messing around because my original idea before i decided to make this a live stream project was that i was going to design a little board that goes into the back of the multimeter and so what i did was took another project and basically just duplicated it and changed its name and everything in fact i don't even know what state i got it to i think it's just a um it's some other pro i can't remember what i it from it's some other project with a whole bunch of stuff ripped out of it just as like a starting point so if anybody's interested in this check out this url or this repo what i'm going to do is add the firmware to that repo oh johnny the best linux command ever alias please equal sudo yes that's a good idea so please make me a coffee let's get back to aaron's question and see if anybody has any ideas now uh i'm just going to summarize because aaron has put in a few notes here aaron says i have a question regarding an esp32 and a single pole single throw light switch and trying to get it to operate like a push button to use deep sleep i'm messing around with an esp32 in i'm detecting the single pulsing or throw toggle on gpios and sending mqtt messages to specific topics cool oh and there is a url what is that ah cool okay so a regular wall mount light switch connected to [Music] like a node mcu or some board like that which is groovy okay so you got the hardware there aaron and the issue i'm finding is i need a circuit that will pulse a gpio to trigger mqtt message this loop will then set deep sleep the gpio then needs to be pulsed to wake esp back up ah okay i've got you however i want to run the circuit on battery and thus i either want the circuit excluding esp to use no power while sleeping but on a switch toggle pulse the gpio to wake it up um yeah okay gotcha i see where you're going i believe the esp32 i can determine whether to use low or high using sp deep sleep enable xt 0 wake up gpio numx level and i thought of using a variable to change level to the opposite of the current state all right so i think what you all right you've i think you've got two issues here the first is waking up the esp and the second is going to be sending the message and i think the second problem is super easy barely an inconvenience but the first one so waking it up from a single pulsing or throw toggle so waking an esp32 from deep sleep excuse me involves um triggering an interrupt so and that is normally done i think on a high to low transition on a certain pin so let's see sp32 deep sleep let's see what we can find haha random nerd tutorials for all your nerding needs randomness tutorials always have interesting stuff so uh what do we do to wake it up so time or wake up uh yeah we don't want okay so backing up a little bit there are a few different ways that you can come out of deep sleep one is with a timer so you can say wake up and do something and then go back to sleep again but you don't want that we want an event to activate it now ideally this could this should be done without using any other external electronics so we could probably solve this problem by building a circuit that goes in between the switch and the esp32 and it acts as a as a one shot like a a a monostable a monostable multivibrator so a one shot that sends a pulse and it is triggered on either a low to high or a high to low transition on the input and as you said ideally using no power so let's have a look at this so timer wake up touch wake up external wake up i think external wake up is what we care about in this case although maybe touch wake up could be useful i don't know okay sleep pattern blah blah blah blah blah let's see what we can find light sleep deep sleep hibernation rtc timer only is running power off chip pu is set to low level okay now why deep sleep mode i mean it's not so much fun watching me reading a web page but hopefully we will find some interesting information in here use the timer touch pins external wake up or several different external wake ups timer scrim through that wake up reason set up okay ignore that this is a detailed tutorial this is cool touch wake up i don't think that's going to be useful to us we'll skip past it for now but it might be useful external wake up all right uh toggling the value of a signal on a pin like a press of a button now i assume that this is what you've already been at i'm you're obviously trying to solve this problem already you've probably looked at all of this and this is exactly what you were talking about in your comment use the following function level all right it can be either zero or one um now one way to do this would be external wake up wake up if any of the pins you've selected are high wake up if all the pins you've selected are low so we could do this by using um hmm to i can i'm in my head now i'm visualizing a circuit i think we can do this by using two inputs defining two interrupts set one to be high level one to be low level no that's going to be a problem i was thinking that what we could use is bias resistors and diodes and then there would be very minimal power usage all right let's have a look because there are probably people suggesting things in the chat oh andy said definitely check out the ulp so the ulp is the i think it's the third core in the esp32 it's there um unless i'm saying totally the wrong thing i think it's the ultra low power processor it's the so people think of the sp 32 as being a dual core microcontroller and you can run code on core 1 or codon core 2 but in fact there is a third core which is the ultra low power core and uh you can run code on that yourself i've never actually done it it's something that would be interesting to have a look at but basically what it allows you to do it's a little bit like the um the way the new apple chips are set up with their little big architecture or big little whichever way it is big little i think it is so like in the new m1 chips they've got four high performance cores and four low power cores so that the computer can minimize its power usage by doing things on a low power core and make the battery last for ages and then just use the high power cores when it needs to for certain tasks so with the esp32 it has a low power core that you can use for really basic stuff like some real some basic io and then you can use that as a way of waking up the main cause i've never actually done that but that sounds interesting yeah so uh um okay so oh okay so aaron says i can use a variable to change level to the opposite of the last set state so low to high and high to low the issue is the battery and circuit and using no power ah i don't think you can use no power you can use very very low power so yeah aaron said that um so what i was talking about with resistors and two inputs would work with a single pole double throw switch but not a single pole single throw switch i beg to differ i think with a couple of diodes and a couple of resistors you could make it work with a single pole single throw switch but the problem is my reading of this is that if for example you have an input and you have set it to wake on a low level so when you turn the switch on and close a circuit so that you pull an input to ground you can't then if you then go to sleep it will immediately wake up because it detects that it's still low so i don't think it's a high to low transition i think it detects on the state of the input so if you've got an input that is set to wake up on a low state and you have a switch that holds it low it's never going to sleep it'll just keep waking up constantly so i think my original idea is not going to work because you would have to do the transition so it looks like the problem is not quite what i was originally thinking um so what we could it's it'd be quite easy to do a circuit where you have a single pole single throw switch and you have two outputs and when the switch is in one position one of the outputs is high and the other one is low and you put the switch in the other position and they switch so the high one goes low and the low one goes high you could do that with two diodes and two resistors just off the top of my head i think would do that but that is not going to solve your problem because it is going to keep waking up so i think you were on the right track with in your code changing the um the interrupt so changing it so that it's it changes its mode from low active low to active high so it basically just flips itself you wake it up it does its thing it flips the state of that input and then it goes back to sleep again and then you change the switch and then it gets triggered it does its thing changes the state and then goes back to sleep again um yeah so let's um let's think about that for a moment now [Music] uh so you're saying the problem is not using power okay and using i need a notepad i need to start drawing diagrams scratching things out what have i got [Applause] [Music] here this is one of those things where trying to figure this circuit out um could be very embarrassing james said i'm late how far off topic are we today the question is what topic oh and aaron said this is why we need a whiteboard yeah a um a live whiteboard session i can just use the overhead camera and sketch so that works um but i'm going to embarrass myself if i try so yeah johnny says surprisingly on topic actually yes we're um we are on the topic of home automation for a change um oh johnny point said trig board is designed by kevin dara yeah um uh kev that name is familiar i'm pretty sure i've seen trig board and i'm i've probably seen kevin on twitter or somewhere so that's a board that is designed for very low power use and is interesting but oh and the other thing is seon's tiny pico does extremely low power consumption as well and it's got built-in battery management so the tiny pico [Music] it's um quite unfortunately they are moderately expensive but they are really really nice boards so this little tiny pico designed by seon who is usually in the live stream but i haven't seen him here today could be a board that would do the job and as you can see there compared to a aaa battery it is tiny i could grab out a tiny pico and wave it at the camera but you get the idea oh yeah optimize power paths and deep sleep current he specifically designed it to use as little possible as as little power as possible so as low as 10 micro amps in deep sleep so that is worth looking at as well now what we were talking about though was power usage all right so looking at this number that cion has quoted here he rates it where was it there our official current rating in deep sleep is 20 microamps and part of that is also the efficiency of the voltage regulator so there are lots of design decisions that go into making a board that runs at this sort of level of low power so he's saying 20 microamps officially or 10 microamps he has seen so back up here on this um random nerd tutorials page there was a thing talking about power usage where was that mode mode i thought i saw something where it was talking about power okay deep sleep up co-processor is turned on 150 microamps so rtc timer plus rtc memory 10 microamps ulp sensor monitored pattern 100 microamps so [Music] yeah okay anyway it's in that ballpark i think that's the lowest that you're going to manage so aaron just to clarify uh because your uh your primary concern is about power usage because the thing is that if you if you didn't care about power usage you wouldn't be putting it to sleep and you would be oh there's another thing wake up time so if you didn't care about power usage if you had power available to that location to where you're going to install this light switch you wouldn't be caring about any of this you would just have the switch going to an input you would pull on turn on input pull-ups and you would detect when it goes low and do something and then detect when it transitions to high and do something so the fact that you are caring about power so yes to me that you're going to be running this on a battery so christian said the video i posted has zero usage in off stage what did i miss going back up the um the history christian did you post something earlier i'm just scrolling back scrolling back and i can't see um i can't see any previous posts by christian so christian if you can clarify what you meant by using zero power i would appreciate that now uh also um oh i just thought of something oh and aaron said uk switch is no live and no neutral available in light switch uh box yeah yeah uh yeah well james that can be done but the issue is that we don't have a button press we have a switch that is changing state and it stays in that change state but i'm just thinking about something the switches let's go back to the this photo okay aaron this is the light switch that you have on the wall now most light switches i don't know how it is in the uk but in australia all light switches everyone that i've ever seen is a single pole double throw switch it's not single pole single throw and the reason is that it needs to be able to support two-way switches and what they often have is in the back of the switch there will be the where the active goes in and then there will be the switched output and then there'll be another like another screw terminal in it often with a little plastic cover over it and by default you don't use it but you can break the plastic cover out and put another wire into it and then you can switch between the two outputs so single switch oh sorry single pole double throw maybe that's what you already said oh yeah single pole double throw uh yeah okay so that's what we were getting at before so i have a feeling that your light switches if you look in the back of them are probably actually single pole double throw oh okay um christian elwood said electro noobs latch circuit video ah cool thank you for clarifying that christian are you electro noobs let i'm going to have a quick look for that electronics latch circuit uh yeah so frank said c-n-o-n-c loop which yeah loop is just a connector that's for um like patching around uh like if you're if you're bringing a cable in and then you are taking active off it and then you're going on to another light switch somewhere else and you also want to be able to loop around neutral or whatever it's just a spare yeah so aaron said ah yes i have both single pole single throw and single pole double throw l1 l2 and com yeah so l1 l2 are live one and live two and common so yes the earlier comment was a single pole single throw but the question is um oh okay christian says no i'm not him it was in my feed not long back yeah cool anyway let's pull this up seven days ago so this is a um a fairly recent thing well maybe there will be some answers in here for aaron's question uh this is one of those situations where i'm not even sure if i'm trying to solve the correct problem but hopefully talking ah sion i was just talking about you a few minutes ago and in fact it's still here tiny pico i was just talking about this so um what was i saying that's right the um the question is am i even answering the right question and i'm not sure that i am but um just in in talking around this whole subject maybe we'll come out something will fall out of it that will be useful to aaron and help solve this problem all right so on this electron noobs thing so it says i want to power on my microcontroller for a short time do a process and go back to sleep where it consumes zero current okay so this is possibly a solution for you a latch circuit so we've got two um we've got two different things one is waking up the device from the switch action and the other is the circuit that will turn off the power uh circuit that enables power with the push of a button and then could be turned off by the microcontroller itself yeah so once again this is relying on a button input but maybe i'm gonna yeah maybe there will be some clues in this um so i've dropped the link for that into the chat so aaron that might be somewhere else that will um is worth digging into for you um so and so this is assuming i can use the gpio that triggers the wake up to also trigger the mqtt message to the given topic uh yeah because i don't all right i don't think that is a particular problem because well maybe i'm not understanding the problem when my assumption was that this was not a problem because when you wake up the microcontroller you just get it to publish to mqtt it's woken up so it knows it has to do something and if you want to you can check for the wake up cause in your code so when an esp32 starts up there is a um all right we're chasing squirrels within squirrels today esp32 wake up reason i think will get us to where we want to be uh oh more random nerd tutorials oh it's the um uh is it is it the same one no it's not okay so there is a variable in here usb deep sleep start somewhere there is a wake up reason and then oh hang on here we go here we go yes look at this here is an example so this bit of code right here looks at the um at the wake up reason so wake up reason equals esp sleep get wake up cause and then if it's one of these reasons then you can do different things so what you could do is use this to um michael yes meta squirrels uh what he could do is use this to determine that the re the reason that it was woken up and if the reason for the wake up was that the particular input had been asserted like the switch had been pressed then you send your mqtt message and if that wasn't the reason for the wake up then you don't send it so i think that part of the problem is not too hard to solve uh that's a that's a reasonably straightforward thing but uh did i drop this all right i'm gonna drop this url also in the chat maybe that will be useful for you aaron if you start looking at the wake up cause response value this thing here so the output of that now uh yeah uh so aaron said i think you get the issue with a single pole single throw as it's either constantly high or constantly low and we need to detect the state change while using minimal power in deep sleep hmm yeah and the latch circuit is the same as it's based on um a pulse of a button yes that's right so i'm just wondering how we could go about let's see maybe this won't help five five five or one shot let's see what options we've got for creating a um a one shot with a five five five monostable mode that's what we want let's see if there are any clues in here i suspect that this is going to be button input only but is there a way that we can make the 555 trigger on a transition in either direction and then initiate a one shot because that could solve your problem although the 555 is going to be using power the whole time and you want it to be zero power yeah i can see why you're going around in circles on this question it's a um it's an interesting one it's one that on the face of it sounds like yeah you can solve that and then when you start digging into it there are catches whichever way you go trigger uh yeah trigger turns on when the voltage supply to it drops below a third of vcc so that's not so use it's full um because it won't trip it would trip on closing and not trip on opening we want something that is going to trip on both opening and closing so we can't really use a triple five as a one shot that doesn't solve the problem [Music] the hook up hey rob thanks for coming along yeah the old should he use the triple five i know instead of a triple five what we could do is put a microcontroller in there and use that to run the microcontroller um [Laughter] i so wanted to use a triple five as it's all as it's always the in-joke yeah uh different okay so james said you might need a different solution for on versus off um hmm that has got me thinking yes are we trying to solve two different problems with one method when we could be using two methods to solve those two problems so maybe a combination of a one shot which would take care of a high to low transition and have the low to high transition taken care of by hmm i don't know i think this is over complicating it yeah i see what you're saying james that's an interesting way of thinking about it um but i don't think it's necessary i think i need to go back to sketching a circuit uh uh yeah ceon said you can use two by gpio1 for high detection and one for low detection yes we talked about that earlier actually just before you came on and there is a problem with that i believe you actually you can probably correct me on this so the problem i believe is where are we deep sleep deep sleep that the wake up does not just act on a transition it acts on a state which means if we have one input that is triggered on a high state and another input that's triggered on a low state and then we supply those based on the position of a switch and we can do that with some resistors and things then it is never going to go to sleep because one of them will always be asserted and one triggers on high and one triggers on low so um the the solution that aaron has been using is to uh is to change the mode of the input so what you do is you have your switch in a low state and you set your input to trigger on a high state and then go to sleep and then the switch changes and then you send your you do whatever your event is because you've woken up and then you change the input mode to trigger on a low state and go back to sleep and then the switch changes and it drops to a low state you wake up and you do your thing so [Music] i don't think that is the more i think about this i'm beginning to wonder what the problem is because if you do that you're you will always be going into a deep sleep mode and then waking up on the next switch transition and it doesn't matter if it's transitioning too high or too low because it's going to be the opposite of whatever it was last time you were awake so uh that doesn't oh zion's here keep reading i had a solution for that okay i'm talking and not reading i should be reading all right um i'm just trying to catch up so use a high side switch that goes higher when input goes low and low and input is high again both going to 2 by rt yeah okay um so yes that could be done and at the start of this i was talking about using a circuit that will um that will assert the two inputs but yeah and jordan has said can you change the wake parameters on the fly yeah i think that is the solution which is what aaron has been talking about um maybe um oh rob said the problem is a fast transition right like high low before the program completes uh yeah well this this is part of the question is trying to define exactly what problem we're trying to solve and um i started off down a certain path of thinking we were trying to solve one problem i don't think i was thinking about the right problem and so all right maybe we need to go back to right back to the start and say what problem are we trying to solve so aaron said i'm wondering if i can use a non-polarized capacitor and trigger it on switch state change to trigger gpio for a small period enough for it to wake up uh yeah use it like a one shot like like this is an interesting way of thinking like the way dtr reset works on an arduino that seems interesting now could you do that um so the way that works is i'm just wondering if i should chase that squirrel because it's kind of interesting when you it's a little bit odd and counter-intuitive and it takes the for those of you who haven't looked at this the way the reset works the auto reset when you're uploading code to an arduino is kind of bizarre and counter-intuitive and most people just take it as take it on faith that it works without questioning why and how it works but it does a really weird thing where it provides a negative voltage to the reset pin in certain certain situations and it takes it out of spec for an avr microcontroller but it works it's one of those things where you really shouldn't do it but the official arduino design does it and the avr doesn't blow up even though in theory it should but yeah we could use a similar technique to provide a one shot hmm yeah all right you know it it feels like i've totally lost my train of thought on what we're doing here talking about different random things all right so aaron says if you draw a single pole single throw switch and circuit using a battery and you'll see the problem without some wizardry circuits problem is down to detecting state change in both directions from an unpowered state yeah from an unpowered state um [Music] all right let's go back to a more fundamental question just to clarify getting back to this so this is what aaron has he's got light switches and what looks like a node mcu now the question is aaron are they single pole single throw switches or are they single pole double throw and i think that is going to guide how we go about solving this problem because if they are single pole double throw it opens up some more options and um [Music] may even allow us to do a uh to do an unpowered state that's the thing is trying to make this unpowered long flare hey chip thanks for coming along your apology is accepted but you have to put 10 cents in the tip jar um yeah deep sleep lowest possible lowest power possible to operate on battery and in deep sleep i think it disables the it even disables the rtc or does it ah no rtc is still running in deep sleep so hibernation is rtc timer only power off rdc timer only uh so [Music] maybe someone out there much more knowledgeable than i can clarify all right to reframe this question if an esp32 is put into hibernation will it come out of sleep if you assert the reset line now that would avoid um all of these issues so oh chip pew power maybe we can even do a power no because then you can't control it all right so what's going through my head just to bring you in on the you know the really grindy rusty gears that are very slowly turning in my head ins what i'm thinking is forget um an interrupt input and detecting either a high or a low state instead detect a reset event and this is coming back to that suggestion earlier i can't remember who said it i'm sorry about using a capacitor as a one shot and if we can trigger the reset pin so what you can do is in your code put it into a hibernation state not just deep sleep but put it into hibernation so nothing is running apart from the rtc but basically really make it go into the lowest level state possible apart from power off and if it's in hibernation if you assert the reset pin uh the chip will then come back to life i believe oh unexpected maker said no um so i'm probably talking rubbish here uh oh the hook up said also the question of why are we deep sleeping a device that has a bunch of power right next to it but that is the problem there is no power right next to it so what aaron is trying to achieve is a device is this device that can be mounted in the wall with a battery behind it and no other power so we we're not um we're not putting it into the location everything exists well you could be you could be putting it into the location of an existing light switch but there's no neutral available so um you've only got active which means you can't put in like a usb charger or something and use that to power it so i think the idea is just to run make a self-contained light switch that runs off a battery i think that's the summary of the problem we're trying to solve so if you put the um if your code puts it into hibernation and then the reset pin is asserted and released it will wake up from hibernation and then you can do your thing and put it back into hibernation again so i think maybe solving the problem of making a one shot onto the reset pin might solve the problem possibly kevin says customer service dear customer please explain what your problem is what equipment you're using and what are your desired outcomes um [Music] unexpected maker has been shouting no but i don't know what the no was in relation to uh andy said so just buy the right sort of mechanical switch and solve the problem andy yeah you're okay that is the the voice of pragmatism uh we could have how many of us are here okay so we've got 77 people currently on this live stream sitting here for a couple of hours so we've got 150 person hours of time taken to solve a problem that could be solved by going off and buying a different switch yeah unexpected okay so ceon said rest is not reset it's on or off rest is that reset uh it's on or off okay like um yeah aseon says every boot is considered power from reset yes that's true but there are also uh reasons every boot is considered power from reset um but hmm can we distinguish and to some extent i suppose this doesn't really matter because you can send an event what'll end up happening is that while you're doing development it'll be sending mqtt events but you can just be ignoring them and then once it's deployed you can [Music] run an oscillator through the switch so it toggle states constantly to create edges aaron says happy to move on just thought it was an interesting problem to see if there was an interesting work around solution i'm quite happy to keep talking about this because this is interesting to me uh as long as the rest of you think this is cool oh yeah so rob said no neutral stuff totally exists it just uses minimum load and inductance i believe yes that's right i did a video explaining how that works a couple of years and when was it a couple of years ago so for those of you that are interested okay this is kind of a squirrel but it's kind of related it's not solving aaron's direct problem but if we look at super house tv episodes uh somewhere science or sorcery sonoff t4 eu1c no neutral wi-fi touch switch so in this video for those of you that are interested in digging into this further i pulled apart one of these no neutral switches and showed the circuit and how it works and um yeah we used the oscilloscope to show how the power is passing through the load and then um well yeah lots of stuff there's a little breakdown of the different parts of the mains board and how it does its vampire power with no um with no connection whatsoever to i don't even remember what i was going on with what was i talking about there i don't know why was i adding two buttons to the i don't know what i was doing oh that's right um that was that's reset and gpio0 that's for flashing new firmware onto it so for anyone that wants to know the science of how these things actually work how you can power something with um with only one wire kind of then check that out so all right i know xeon i think is yelling at his computer right now because i'm um uh yeah chip enable is power on or off so power from reset it's not a reset like in an arm mcu it's a switch on and off yes so it needs to be in one state for the chip to run and in another state for it to not run yes that is absolutely right so that gets us back to an external circuit and how would we change the state of that yeah see on i agree i think i was running off down i was chasing a red herring there yeah i was um uh um so so you're only saying single pole single throw use internal pull downs single pole double throw use high side switch all right uh so aaron is saying okay so i'll just run with a single pole double throw switch with a tiny picot and use esp sleep enable ext0 wake up using two gpios per switch one for high and one for low uh [Music] i don't think you need to i'm um i'm going over the fundamentals of this question now if you use a double pole sorry a single pole double throw switch with two inputs i don't think that solves your problem because one of them isn't always going to be asserted so you're never going to be able to sleep i think you need to go back to your original idea which is changing the mode of the input um maybe i need to i kind of think visually so let's um let's do is this going to work but the thing is that when i draw diagrams it only ever works in my own head it never comes out on paper the way that i expected that it's going to all right how do we look at this so we've got our tiny pico and we have a switch and the switch is connected to an input and to a ground so that's ground and this is a gpio and the switch is um single pole single throw i shouldn't have drawn my um my label in there okay then on gpio we you can either use an internal pull up or an external pull up doesn't matter so what's going to happen is this input is going to be biased high when the switch is open when you close the switch it's going to be biased low all right so that is the simplest possible case for the external circuit so what we need to figure out is whether we can make this work with your requirements and then we have um uh so then we have a battery which is connected to ground and um vcc you know there's probably a power management circuit in there it doesn't matter so tiny pico has got you know power management we'll ignore that part of it for now we'll assume that it's got power from a battery what we care about is the input and the switch here so it probably feels like i'm going in slow motion now so i'm just going to write this out so we'll say let's look at it from a timeline point of view at time 1 we have gpiox is in in it's like a wake up interrupt input and it is going to trigger on low and the tp is asleep so this is describing the static state here with the tiny pico the switch is open and it's on a trigger low so at this point the input is high then you close the switch and then we go to point in time low r2 so the trigger is still on low tp wakes up and then 3 tp transmits to mqtt ok and then 4 tp changes it to trig on high and then goes to sleep and then at that point this is closed so then five the next the next event is going to be the switch opens so this is the next time you've used the switch it's still in trigger high the tp wakes it sends its mqtt message hopefully this is all making sense it sends its mqtt message and then it basically just goes back again it sets the trigger on the low and goes back to sleep so each time the switch changes state the tiny pico is going to wake up send a message and then flip it the sense on that input so that it wakes up on the opposite trend on the opposite state now hopefully i've summarized the sequence properly i'm going to come back all right so aaron says yep that's what i have right now all good so far this guy says nothing wrong with slow motion makes the squirrels easier to catch all right so gavin says put a momentary action switch on the battery feed and hold down the button for as long as you need to send an mqtt message uh no but the problem we're trying to solve is making this work with a regular light switch now if aaron replaced this with a momentary switch all of these problems would go away and but what we're trying to do is just make it work like a regular light switch so you walk up to the switch and you flick it and an event happens and you flick it the other way and a different event happens so [Music] and what you could even do is you could check the in the code you could check the state of that input after you've been woken up so you can detect have we been woken up because the switch closed or have we been woken up because a switch opened and you can send a different message so the idea is to make it work exactly like a regular light switch but to make it battery powered and have an esp32 behind it yeah okay aaron says yep that is the circuit and idea i first described so i don't think you have um uh maybe i'm misunderstanding the whole problem this is why articulating it like this might be um might be good is the problem that when the esp32 is in deep sleep it is still pulling too much power if that is the problem then we've got a slightly different issue so actually something that um you someone here i'm sure can answer uh so aaron says i thought there was a flaw in my thinking or that someone smarter than me would come up with a better solution no i think you're on the right track i don't i i don't really see the problem with this so [Music] that process that's on the on that notepad right now what the end result of that process if it works is that you will have your esp32 in deep sleep when it is not doing anything so okay the question for the audience this is something that i should know and i don't because i've never actually done much with low power stuff and um other people here like seon have done way more than i have and can answer this question how fast does an esp32 wake up and connect to wi-fi if it's been in deep sleep if it is if we're talking about milliseconds then you don't really have a problem if you're talking about multiple seconds this could be a really big problem so [Music] how fast while you are thinking and talking among yourselves let's see how quickly i'm going to ask my friend google does esp32 connect to wi-fi after deep sleep so scott says all we're really looking for is to get the esp to detect the state change while in deep sleep uh rob two seconds with a static ip yeah that's really disappointingly slow oh scott says time to wake up is it relevant oh um okay if that kind of throws me because for any kind of user interface where someone is interacting with a system like a home automation system latency is very important and if you it doesn't have to be much a couple hundred milliseconds is enough to really really mess with your mind if you walk up to a light switch and you flick the switch and nothing happens for a few hundred milliseconds your brain thinks it didn't work and then like you flick the switch back again and like you'll flick it to see what's going on so if it takes two seconds to wake up and send its message that it that is like flick one one thousand two one thousand oh the lights come on that's a long time uh yeah aaron says from what i've read online people suggested up to four seconds from deep sleep to wi-fi connect to mqtt message send to sleep yeah yeah okay all right aaron i am really curious to know how it is that a two plus second delay is not a problem [Music] okay trying to balance quick response and minimal time awake for power savings uh oh and james said wouldn't the internal pull-up increase power consumption the internal pull-ups are very weak i believe in a what are they in an esp32 i can't remember but that isn't that is an interesting question maybe we shouldn't chase that particular squirrel today but do pull ups on a microcontroller affect its deep sleep performance so one thing you could do is just use a really weak external pull up like a 100k pull-up let's have a quick look at let's look at this um ohm's law calculator and uh see if you're going this is the thing about job interviews and exams and all that said that stuff you get tested on whether you can do stuff in your head but the reality is with a question like this okay we've got voltage 3.3 volts and i want 100 oops 100 000 ohms how much current is it going to take and in milliamps it is 0.08 it's bugger raw it's approximately bugger or milliamps okay so faced with a question like that is faster for me to open ohm's law calculator and type in some numbers than to do the v equals ir thing so um uh yeah you could use an external 100k pull-up and it's going to use approximately bug raw milliamps to you know while it's in deep sleep so i don't think that's a huge problem yeah rob says i really think a kinetic switch and rf bridge is the winner here yeah i'm wi-fi to me wi-fi feels like a heavyweight solution to this sort of problem now i'm not against i'm not against wireless solutions even though i kind of seem to have developed a reputation for being against wireless solutions with my big rant about why is not wi-fi for home automation that rant was the rant was really use the right the correct solution to the problem don't take this thing and use that as the solution to all problems and people have a have a tendency to use wi-fi as a solution to all home automation problems and i use a lot of wi-fi myself like um i've got in fact um rob's done some good videos about about ubiquity and unified gear i've done a couple of videos about that as well i've got a lot of a lot of wifi devices many many wi-fi devices in this house and i use it and rely on it but i do that you know as one solution to a certain problem and there are other rf options as well so in this situation yeah a kinetic switch and an rf bridge would be a very cool way to do it another way might be a zigbee sort of thing no i am not going to do the actions that go with all the zigbee um uh rf bridges yeah okay so rf rf is an interesting thing so there's another video i did where was that um all right think about how often you have to change the not that i was trying to go i was going to the wrong thing i've had a real problem with spam on the super house site recently which is why there are all those notifications in the admin area uh this one the six dollar universal home automation button now this little project was using basically this is like a diy rf bridge and if you think about how often you have to replace the batteries in your your garage remote control the garage remote control typically uses a tiny little button not a button they're either use like a button cell or they use a little 12 volt battery and they'll last for years and years with a tiny little thing so and they're very fast as well so maybe a solution is something like this an rf receiver connected to anything doesn't really whatever board you like it could be could be a tiny pico so you could do an rf to wi-fi to mqtt bridge and that would be fast because your your bridge can be powered up and always awake always connected and just listening for rf events and then when it receives an rf event it publishes to mqtt and then the world's your oyster you can do whatever you like with that but the device that actually goes out on the switch can be essentially like the guts out of a remote control transmitter like um [Music] um they're everywhere you know what i mean hang on you're not even seeing i thought i was showing you stuff on screen you can't even see it okay so this thing this project the um the six dollar universal home automation button this was taking uh a fourth thirty three megahertz in this case a button and a receiver feeding the receiver into an arduino detecting events and then triggering things so this was the thing that i used on my rubbish bin i don't have it running anymore because it didn't it didn't handle the weather it ended up falling apart in this video i think i showed it on the on the garbage bin so that in the kitchen the little tile indicator lights up to show whether i need to take out recycling or green waste that week and then when i take the rubbish out press the button on the rubbish bin and it clears the notification because the home automation system knows that the rubbish bin has been taken out so that's what that was all about so maybe that would be an alternative approach you could use a transmitter that triggers once again you still have the same thing of how do you trigger the transmitter on a rocker switch rather than um oh yes scott says bugger all milliamps can equal massive microamps that's true where did that i think i closed that calculator but i think looking at the orders of magnitude on that calculator it was still very very small microamps as well it was uh was it okay let's get back to this ohm's law calculator let's go back to here and do this again i'm running i feel like i'm running around in circles now 3.3 volts and we'll do 100 kilo ohms we want the answer in milliamps go ah you're right the um if we move that decimal point to the right a couple of places that is a not insignificant number of microamps hmm true yes good catch scott oh rob thanks it's very cool to be an inspiration um uh yeah oh michael says i use cheap zigbee door sensors and remove the reed switch i then solder wires yeah yeah cool and i think you might be able to get zigbee sensors that are a dry contact input as well uh let's find out anyway this is kind of deviating a little bit from solving aaron's problem directly but um yeah it's all related dry cond dyro contact zigbee dry contact transmitter i've got an idea of this if there is anything like this maybe there is uh except input from other devices mm-hmm this replaces earlier dry contact sensor all right so for those of you that haven't heard the term before dry contact just means that it is an input that um it's basically like a relay terminal the idea is that it's meant to be like a totally isolated thing and you can trigger the input by shorting or output it shorts it so same thing it means that it's like open circuit versus short circuit that's what it means by dry contact so garage door tilt sensor yeah z-wave door and window sensor anyway there are probably some modules but um whose suggestion someone suggested taking um sorry i'm scrolling michael yes michael sullivan said i used cheap zigbee door sensors and removed the read switch i then solder wires uh so zigbee read switch um read i love read switches they are so cool it amazes me that something can be made that is mechanical that responds to the uh to such a weak magnetic field all right alibaba alibaba let's drew scse let's just try this one looking at stuff randomly okay what 40 bucks each okay i am backing away slowly zigbee reed switch ali express let's try that hmm oh this is just going to be magnetic reed switches i want zigbee reed switches uh i'm i am going way off the reservation now oh hang on there was something what have we got here 12 bucks 80. still seems a little expensive i'm yeah let's just look this live stream is uh watch john click around random websites now uh oh also i sh while i'm thinking about it since rob is here let's do a um d hook up let's do a shout out to no not the podcast the hookup there it is hook up youtube channel you can see it's in my history uh i'm gonna drop this in for those of you who are here because you're interested in this sort of stuff you really should go and say hi to rob at the hookup um and as you can see just looking at my screen here i've i've watched rob's videos you can see there's uh little watch markers and stuff on on some of those so uh i have got to discombobulate my brain all right where were we now we were looking at reed switches so summarizing for those looking on from the sidelines what was it michael i think it was michael michael sullivan we're suggesting is take something like one of these read switches and modify it so that you replace the read switch with with the switched input and i don't know whether these trigger on both opening and closing i have a feeling that they might only transmit on clothes on open sorry um that is something that would be worth checking out uh app notification um open close detector i can't remember [Music] scott says question question is does that link get rob more hits or is everybody here already subscribed i suspect everybody's already subscribed his channel is way more popular than mine um uh so if all right so michael you've done this before so probably you you've probably looked at the reporting on this i use these reits which is all all the um all the time but i haven't been looking at the i haven't looked at the output recently i haven't played around with them like they just work let's have a look at something here node red that one i want this one loading nodes i've got some events here that are triggered by read switches that are coming off um the zigbee to wi-fi bridge zigbee to mqtt what am i looking at lab all right no outside maybe the outside stuff what have we got buttons back door ah here we go back door no no those are buttons that's not what i want where is it security infrastructure enviro doo doo doo somewhere in here i can never find this stuff um is it i thought it was in this flow somewhere around here i've got inputs from [Music] read switches that are triggering different things look at this drill past drill press power the um the power to my drill press it's controlled by a tasmatized um power socket rack lights uh office lights this is not riveting viewing was it in here now this was just some stuff i was messing around with color of color i don't know where it is what i was the point of this what i was trying to get to was looking at the signal that comes from one of those little reed switches and see if it notifies events both on opening and closing events if it does then aaron i think this is the solution to your problem i know that it notifies on open events but i don't know if it notifies on closed events now part of i'm being slightly circumspect here i'm going to switch to different cameras so you can't see what's on my screen one of the i'm being a bit careful about what i click on in here because i'm not sure if i'm going to reveal stuff in my in my flows that i would prefer for you not to see enviro sensors tasmuta here we go okay let's do a test um i think this is useful so all right so we've got sensors achara akara z2t which is zigbee to test motor and i'm sitting up here on my bench where are we can i i can just no i can't quite get it into the field of view of the camera that is my little zigbee to wi-fi gateway and when it when an event comes in it publishes to mqtt and this is where it goes so this converts between a json knob string and an object and then the um the node red object comes into these different things and then it gets no notified open closed lab door status this is what we want to play with all right power is true it goes to one is false it goes to the other i think this answers the question lab door status open message payload is one closed message payload there so all right let's do this we'll grab a debug node and we are going to connect to uh let's connect it to both we'll take both of these outputs and we're going to go to message.payload now let's change it to complete message object and go to debug do a deploy database not connected oh i know why that is that's because i shut down a computer i'm going to get all sorts of rubbish on here so let's do selected nodes it is that one debug node float where are we environmental no stuff that we'll just do current flow it'll take too long to mess around all right so e-host unreached we're getting all sorts of nasty error stuff in there what i'm going to do now is walk unfortunately i have to go out of your field of view but what we should be seeing is events if i open the garage not the um the lab door let's see what happens do we get an event opened and then closed and what why did that clear there is close that message uh all right i'm gonna try again hopefully before more stuff appears open we didn't get nothing i wonder if that is even doing anything at the moment hmm all right let's oh let's just turn this one on see what we can see clear this we'll watch everything open i'm not getting any events off this door i wonder if this is even working i'm going to go and open another door open closed now did anything happen no i have a feeling that this is all very broken right now ah okay but how is it broken how is it broken is it something that i can fix right now or not so we've got sensors acara um i have a feeling that fixing this is going to be something that is not a spectator sport so i'm going to go back to reading the chat okay so david says i've used the xiaomi mccgq01lm door sensor and replaced the read sensor sends mqt on state change to both open and closed perfect that is exactly what we want and that answers the question now um [Music] so and that confirms what is in my um my thing here so this oops these nodes just here so lab door status this what this should be getting is what it's looking for is the zigbee payload which has this id so it is coming from the the device that is connected to my lab door not that one not the one you can see there another one over that way and it is looking for the power topic now the way this now my understanding is the way these work so the read switches that um like the little zigbee read switches that you put on doors and windows and things the way they report is power and it will be power on or power off it's um instead of reporting open and closed basically it's uh it's using a label kind of inappropriately but it works so if you look for a state of power on then it's transition to on if you look for the state of power off its transition to off and that is equivalent to opening and closing whichever way around it goes i don't know which way but it doesn't really matter all you're looking for is a transition so what you would do is you wouldn't even be um be looking for in this case what i've done is split it and it's kind of stupid here what it's doing is if the it's splitting if it's true send it out one output if it's false ended up out the other output and then doing different things based on that and then it goes back into influx db so that it can chart over time the periods when the door was open and closed that's actually what this is all about although it looks like it's broken right now i have gone through this whole live stream without cracking open the max taste no sugar and my throat is starting to feel it and you can probably hear that i i don't have much live stream left so i'm resisting stopping for a drink now aaron um yeah james says come on door sensors would be useless if they only reported open yeah they also have to report clothes that's true but in the context of a security system yeah you are right i was kind of overthinking that whole problem they would be useful if they only ever reported open i was thinking of it in terms of security reporting an event like this window has opened or this door has opened therefore you've got to do something but for other situations yes you also need to detect events like this door has closed or this window has closed yes ah kabletti said what the hookup said okay so what did the hookup said um the hookup says i don't think you deployed that yes probably probably um gavin jackson contractual obligation coke promo um all right so the uh the thing is pepsi no this channel is not sponsored by pepsi it is sponsored by you uh yeah but john doesn't solve the problem but does achieve his daily steps oh yes ah okay now let's kind of get back to aaron's question here i'm going to switch back to overhead all right so what i would do in this situation and um going on the suggestions of michael and many other people i would take a zigbee a zigbee read switch like okay i should have done it big enough to write labels so a zigbee read switch uh transmitter and you open it up and the contacts where the read switch is so basically you remove the read switch and you got two contacts then you would um take your light switch in your case it's a three-way switch but we're only we're going to ignore the other two you take the contacts from your switch and you connect it across the zigbee terminals just to really belabor the point so this part of it is at the location of your switch each time you flick the switch it is going to either open or close the terminals on the zigbee read switch transmitter which will then send an event then what you have is a device like a um a zigbee 2 tasmota device which would be like a wemos d1 mini or something equivalent to that and that can be on permanent power so we've got power going into that and that's running 24 7. so it receives the signal and then that transmits to [Music] wi-fi and so it's connecting via wi-fi to get onto your network so that then goes by your network to your mqtt broker and that receives the event and that goes to whatever you like new acronym that we just invented for this so i think this would achieve what you're wanting because the zigbee read switch transmitters they last for ages like measured in years before you've got to replace the coin cell battery in it so zigbee read switch transmitter mounted behind your light switch and then an always-on zigbee gateway so zigbetter mqtt and then from mqtt you can do whatever you like so aaron would that meet the objectives of the project uh that would give you low power pizza fund some call it fun thank you um yes we invented a new tla uh so jordan said my wife was trying to set a timer and the voice assistant heard john say security system so it said an eight minute timer called security system yeah i've uh i've gone off saying okay i have a she who shall not be named sitting on the bench right in front of me right now and it's um i changed the trigger word to be computer so that i could use it on live streams without triggering everybody else's voice assistant and that turned out to be a really bad idea because do you know how often i say the word computer when i'm doing live streams like this so then i changed it to echo and that is also a bad idea because echo the like that sound appears in many many other words and it was just constantly waking up so now whenever i'm doing live streams i have to hit the mute button on it there's no other way around it [Music] now daniel said arrow 404 door not found um oh okay and this is a catch to watch out for andrew gordon said lots of cheap 433 megahertz door sensors only report on open yeah uh okay hmm so aaron says for one l for one switch this solution per light switch seems like a lot to fit in the light switch black back box no it's not those things are actually really remarkably small let me let me get one out um i think it pretty much is pizza time but still oh stretching that kind of hurts [Laughter] so if you haven't used these before i think you will be surprised because you were talking about putting a tiny picot or something else like that in there if you're wanting this is this is my big box of zigbee bits including uh the little gateway board that i designed and lots of modules i've got lots of stuff in here where are we gonna find a reed switch a reed no is that a reed switch a car i believe it is uh zigbee reed so it i don't think this is going to be too much to fit in the back of your in the back of your light switch lots of box not much content yeah look at this it's pretty small and this is inside the enclosure as well so you could de-can it and um like there's the coin cell battery now where's something i need a banana for scale where is all right maybe maybe a pen will do for scale so it's just a normal normal size pen you know exacto knife it's the same sort of size this is quite small i need a quarter like an american quarter that yeah i mean you've seen the size of a an x-acto blade they're not exactly large this is uh yeah they're small you would not have any trouble at all fitting this behind a light switch you wouldn't have any trouble fitting three of these behind a light switch so for your three-way thing i don't want to break this because i'm going to want to use this one for real but yeah what you would need to do is take it apart find out how to pop it open and find the contacts for the reed switch why not let's let's see what we can find it's got it i've got to see if i can get this open without breaking it up correct crack if i'd been clever i would have taken the battery out first but i'm not clever uh-huh come on regal wriggle wriggle why is what's holding that in i don't know oh okay there's that little button assembly now uh let's get some zoom edge oh that was maximum it is maximum zoom that's as far in as i can zoom okay i'll see if i can get up a bit closer and still get it to focus so um channeling someone else focus you no i'm not going to complete that come on back out back out back out it's got to focus here somewhere just there is the reed switch on the side of it so when it's in the enclosure this gets mounted on uh like on the frame this gets mount this has got a magnet in it this gets mounted on the door and they sit side by side and then when the door opens the magnet moves away when it closes the magnet moves closer and this little reed switch on the inside here is what's detecting the presence of the magnet so all you would do is remove this reed switch you could either unsolder it or if you were being brutal you could just cut the little wires there and then wire your switch directly across this so that when the switch changes state this will think that the door has opened or closed and then it will report a zigbee event and with this battery in it that'll run for a long long time and if you wanted to make it last for mega years just connect a bigger battery this is a um it's a three volt coin cell it's a cr1632 uh which has a there's not a whole lot of energy in these things they're energy den the energy density of coin cells is pretty low but it's a three volt cell so if you got a bigger three volt cell something with a higher energy capacity and you just wired it across the same terminals you could easily make something that would last for the the shelf life of the battery like you can make something that's going to last for five years before you go to change the battery and that is small like the size of you know half my thumb small so excuse my throat i so aaron says but i'd need three of them in the back box for the three switches right yes that is correct you would need three uh oh yeah trevor so you said i have a battery in frame what size is it that is a cr1632 which is the one that was included in it the magnet is look at this er the magnet has connected everything together magnets are magic i love magnets so just put a um a bigger thing in there like a and what was it cr1632 put a see a 2042 20 40 or you know just a large capacity 3 volt coin cell and that will last for years with being you activated many many times a day so dime sized i wonder if i've got any coins i don't think i've got i'm rich enough to have coins uh coins do i have any coins here i don't know yeah uh dime size no it looks smaller than a dime to me oh i think i have american money here i've got a um i've got a little box with stuff in it like um travel sims and things because when i whenever i travel you know you always end up with money left over that's not worth changing and then like usd so us dollars whatever is left it just goes into a ziploc bag so i've got new zealand dollars and euros and rmb and hong kong dollars what else is there pounds [Applause] so whenever i come back from a trip whatever is not worth changing back into australian money just goes into a ziploc bag and then next time i go back to that country i've got some change so i can buy snacks at the airport hello well if i'm richer than i thought i just pulled out my united states dollars thing and there's look us money what's this it's this funny paper money it's like it's fake monopoly money it's still made out of paper like back in the dark ages all unhygienic and uh doesn't last all right what have i got here what coins have i got that is well there's the united states quarter there's a quarter dollar next to the battery what's this one one dime no you're right it is about the size of a dime there you go for the american viewers there is a dime and a quarter next to the battery and this is the zigbee reed switch transmitter so it's small damn small now next time the um the australian dollar crashes i should go and change these us dollars so this is my my foreign currency trading method get some notes stick it in a ziploc bag and keep it on the shelf although like every time you do a currency conversion it costs 15 bucks or some ridiculous fee so that's why it's often just not worth changing the money back again [Applause] i want to travel again i love seeing new places one day one day we will be back living in a world where we can jump on an airplane and go to cool places and meet cool people again [Music] so 32 so 16 millimeters wide that's right so the way battery sizes work like clean cell batteries the first two digits are the diameter the second two digits are the thickness in what would you call it deci millimeters no what's a tenth of a millimeter so 1632 is 16 millimeters diameter and it's 3.2 millimeters thick so it's in thickness in tenths of a millimeter okay so aaron said what brand model is that are they expensive this one is a xiaomi akara um i've i use pretty much exclusively akara stuff let's see what we can find a cara read switch well that is come on reed switch ebay i'm just trying to find somewhere that will give a vaguely sensible um price on it what is with these prices that is crazy 25 bucks for a read switch no go away 25 ah they were when i bought these i thought they were like five dollars each hmm have their prices gone through the roof recently let's um let's go back to aliexpress i'm going to go and grab some lunch soon and you probably should too if you're in my time zone usa oh hang on let's see this flash deals 5.52 what is this one two year oh that this is a two year one i don't know who makes this but this is more don't you hate it when they advertise shipping at dollar 26 552 why does it go up to 34. oh plus gateway okay forget the gateway you don't need that build one with the d1 mini and stuff uh so this is more what i was expecting us 5.52 plus a dollar 26 shipping for a read switch now that is not the particular one i was looking for what i was looking for was an akara reed switch maybe they don't even exist anymore what about xiaomi red switch nope uh zigbee reet switch what what am i doing wrong here surely there can't be zero matches for zigbee read switch zigbee maybe is it the door sensor maybe i'm just looking for the wrong thing uh yeah this is more like it this is better us 11 what why is anyway okay so 10 bucks if you buy four of them 37 so eight dollars each nine dollars each somewhere in that region anyway you get the idea uh the the acara ones i've kind of stuck with acara devices i've got a whole box full of acara stuff there because the way the protocol is supported in zigbee details motor all of the acara stuff is well supported so other stuff i'm sure is supported as well it's just that i ended up getting a cara because i knew that it would work yeah um okay so james said info on zigbee d1 gateway um yeah jordan was spot on call them door sensors instead of read switch all right now i'm gonna show you this will be the last thing i'll show you before um before i sign off [Applause] so this is a project i've i did ages ago and i've never actually done a video about it so the um i've got to find some other boards to wave in front of the camera there's that one so i've ended up building a couple of different oh yeah there's that and that oh and there's a d1 mini and here's a big pack of pcbs where do these ones come from i don't know the jlc this one might have been from all pcb or somewhere so and more pcbs all right so this is the zigbet has motor coordinator board and uh what it does is you combine a wemos d1 mini which can plug in which way around that way or that that way it goes in that way now this was one of my test boards which is why i've got sockets on it but the idea was that you would just put it directly on with pins and the spacer and so it'd make it a much lower profile thing and then there is a module like this which is a zigbee module which plugs in here although i think this particular one is this the right module i don't remember that's right i think this might be the one where i screwed up the the position on the board i had to change the offset on the socket a little bit because i've got the footprint not quite right so combine those two things and what you can do is zigbee communications here and wi-fi from the d1 mini so this whole device acts as a zigbee to wi-fi bridge and the software that runs on this is the um is uh zigbettertaz motor and the yes i need to do something about my throat so the lead developer on zigbetter taz motor uh is a i can't remember his name he's a guy in france who is i think he's actually the head of amazon web services in france but he does he does test motor hacking just for the fun of it and so he's running he's got my boards but as far as i know he and i are the only people in the world at the moment that are you that have this gateway and so he's been using it for his zigbee to tasmoto development so that just makes a nice little package i'm going to unplug it so my actual live gateway i'm going to unplug it so that i can get it in camera view this is my what's inside this box is this but without all of the sockets it's the module soldered just with pins straight onto the pcb to make it low profile which is why it's skinny and this is what i have acting as my zigbetto wi-fi mqct gateway all right now this one here this is another one which is like a super low profile version and if i take that off there so this pcb and that's what's in this bag is a d1 mini breakout for a zigbee module so the zigbee module that goes on that side and then you get a d1 mini and in this case what i've done is i've put pins on is my camera not in auto focus mode or something i'm wondering why no it is in auto focus okay that's about as good as it's going to get okay so what you do is just mash these two together and i haven't soldered this on but the idea is that you would solder these pins on directly onto the d1 mini and then clip them and you'll end up with a super low profile little device it's basically the size of a d1 mini with another pcb sandwiched onto it because that's what it is and all you do is plug in usb for power and that's it you've got a tiny little dongle that you can stick on a shelf somewhere and it acts as your zigbee two mqtt gateway and it's tiny uh anyway i did that ages ago what's the this is one of the many things i work on so many projects and i just never make videos about them is there a copyright date on this i don't think there is i didn't bother putting one on the pcb but i think it's a couple of years ago that i did those so many projects not enough time to make videos all right cool kabletti says john's house stops in its tracks yes i just pulled out the gateway is currently sitting on the bench unplugged um but i will plug that back in now but luckily if i can find the yeah there's the power cable luckily i only use that for non-essential stuff so my all of the essential things in my house are wired i just use that for things like acquiring data from temperature sensors so i've got um aaron says they're not on your store no um uh most things aren't on my store i'm really bad at commercializing stuff i just like making things i make them and then i don't bother selling them all right i think i i'm going to call it for this live stream but first i will have a quick look through what have i missed uh the hookup said it's cloth actually what was cloth cloth what um i don't know what that was in relation to sorry rob uh aaron said so i wonder if i make my own board does the rf chip allow multiple codes for multiple pins uh yes all right so just before i wrap up this is throwing back to um i've got to find it yes this one could you hear that that was my stomach that wasn't an earthquake all right so this is throwing back to this one this was using a transmitter all right here we go this is another episode of watch john brows ali express no i do not want your stupid pop-ups did that oh hocker like the suggestion what the hell is a hawker the autos the search auto the search suggestion um in aliexpress says hawker h-o-c-k-a-r i'm not even going to search for that i don't want to know what that is so let's do 433 megahertz transmitter and receiver module well at least that auto complete was good but what we want is let's just pick one that's got some batteries i mean it's got some buttons uh multi button multi button this one will do let's have a look at this okay so this one's got four buttons on the front and it's got a receiver and if you i'm just going to close a whole bunch of these things that are open and confusing things leave site yes leave i do not want to deploy changes close that close that close that all right so this thing in this tutorial it's talking about reading so on this one it's it's receipt it's using a receiver that just has a relay so it just triggers a relay when you press the transmitter button and you can get receivers that have got multiple relays like for two channel four channel eight channel receivers and transmitters that have got matching numbers of buttons on them you can also do it this way where you have a receiver that you connect up to a data pin on your arduino or whatever receiver board you're using and then you decode the data to see what the signal is that's been transmitted but that takes a bit of software jiggery pokery and in this case we've got a four button transmitter and a receiver so what you could do well here's another one look at this one if you're looking for simplicity it's kind of crude but these ones with the relay receiver are a um an interesting way to do it now i don't think this will actually solve your problem very neatly aaron it's interesting to think about but i still think zigbee is the way to go this will be cheaper but there'll be some messing around and it doesn't solve the problem of the momentary switch because these transmitters expect you to just press the button and let go of it if you connect a rocker switch across one of the inputs on the transmitter when you turn it on it's just going to keep transmitting the same signal over and over again and it won't stop until you turn the switch off but if we look at this this is the um the stuff that you'd use so you would get the transmitter mount that behind your wall plate and on the receiver on this case it's got relay outputs so you would have four digital inputs onto whatever your device is and then you just read the state of the relays when the relays are fired you know that the button is being pressed and you can do something so that is super simple and as you can see it's 7.98 for the four channel version oh plus some a few buck shipping but it is super cheap it is super simple and the buttons in the transmitters last for ages but it does not solve the problem that we were talking about with the switch so you would have to go back to solving that problem but in some situations this can be a very useful sort of thing all right oh jordan reese said us dollar is cloth yeah okay that's right it's um it it's not paper it is some kind of woven material but it's uh it still seems like pretend money it should be plastic like in all good countries lasts much longer and harder to counterfeit and can be cleaned so it's um you're not handing around little bacteria tokens to everybody [Music] says having no idea what we were talking about today did we solve the problem ah i don't know um aaron hopefully we've given you some ideas rob just said i just searched i'm not even sure aliexpress knows what a hawker is yeah h-o-c-k-e-r don't know i don't know all right um scrolling back who was it that sent me pizza money some call it fun thank you very much for the um the 15 super chat some call it fun i really appreciate it uh yeah on that subject i'm going to have a new computer in my very near future so i might be putting out the call for donation sometime soon yes my my computers have just barely um have just barely held on they're holding on for the new max to be released and they might live long enough just barely all right thank you very much for coming along and sharing a bit of a weird live stream with me but it's interesting looking into random questions and thanks aaron for bringing the interesting question because it allowed us to uh to dig into all sorts of different things and chase different squirrels so um oh cabletti said david's pizza for the win david's pizza i don't know that one dar pizza where are they uh so for those of you who don't know cable thai lives quite close to me david's pizzeria croydon um mcadam square okay i've never actually had pizza from david's uh yeah so thanks for the recommendation stephen w said a shiny new m2 chip is in your future yes m2 or m1x whatever they end up calling it uh yes so there are some options i'm not going to start talking about that i need to end the live stream and go and get some lunch and you need to go and get some lunch or a midnight snack depending on your time zone so thank you all for coming and i've got to try to remember how do i end obs again all right thank you for coming and i will talk to you all soon bye go and make something awesome you
Info
Channel: SuperHouseTV
Views: 2,927
Rating: undefined out of 5
Keywords:
Id: Wh0qJwJgDbc
Channel Id: undefined
Length: 149min 30sec (8970 seconds)
Published: Sat May 01 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.