#218

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ก.ย. 2024
  • My current project requires two switch detection from a single, common input wire.
    JLCPCB Only $2 for PCB Prototype any colour jlcpcb.com/cyt
    More details (circuit diagrams, sketch) can be found here:
    github.com/Ral...
    This means I will be able to detect which switch initiated the on/off/kill auto circuit for my next fridge door alarm.
    A simple, useful project that is ideal for beginners to learn about MOSFETs and how an Arduino can control them.
    List of all my videos
    (Special thanks to Michael Kurt Vogel for compiling this)
    bit.ly/TH-camV...
    All about the ILI9341 2.8" Touch TFT Screen (about $7 from Banggood)
    www.lcdwiki.com...
    www.banggood.c...
    The AUKEY Ground Loop Audio Isolator from Amazon
    amzn.to/3of3xdb
    USB to TTL Serial Cable by DSD TECH SH-U09BL, with CP2102N Chip 1.2M/4FT
    What I have been using to monitor the Web Radio project for days on end!
    amzn.to/2Jx13Id
    TTGO T8 V1.7.1 ESP32 Rev 1 4MB or 16MB FLASH with 8MB PSRAM
    s.click.aliexp...
    If you like this video please give it a thumbs up, share it and if you're not already subscribed please consider doing so and joining me on my Arduinite (and other μControllers) journey
    My channel, GitHub and blog are here:
    ------------------------------------------------------------------
    / ralphbacon
    ralphbacon.blog
    github.com/Ral...
    ------------------------------------------------------------------

ความคิดเห็น • 149

  • @TheNCGardener
    @TheNCGardener 3 ปีที่แล้ว +2

    You could also detect multiple switches based on resistor voltage drops. Of course it would take different value resistors ins series with each switch to give the voltages and that is connected to one MC input and then the sketch would have to be written so that it compares the voltages to determine which switches are depressed. Some car keys are decoded this way.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Ah yes, the resistor ladder, suggested by many, disliked by yours truly. After all, in this circuit we have digital inputs going spare so why not use them!

  • @pekkagronfors7304
    @pekkagronfors7304 3 ปีที่แล้ว +3

    Keep the beer cold at all costs - finally an Arduino project for me

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +2

      Agreed. Warm beer is a crime against all breweries everywhere.

  • @mr.mythoclast4451
    @mr.mythoclast4451 3 ปีที่แล้ว +5

    a resistor for each switch but different values and read via Analog Input

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      Resistor ladder. Yes, suggested a few times here but with so many digital pins going spare there is no need IMHO.

  • @wjn777
    @wjn777 5 หลายเดือนก่อน

    Excellent video, how could I have missed it for so long? I hope you publish some new videos Ralph, you channel is one of the best on TH-cam

    • @RalphBacon
      @RalphBacon  5 หลายเดือนก่อน

      Thanks, will do!

  • @stealthblade2992
    @stealthblade2992 3 ปีที่แล้ว +2

    The first thing I checked if my fridge is completely closed 😂😂
    Nice video! 👌🏽

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +2

      And was it? See another comment above where a viewer lost the contents of their freezer just last week for the exact reason I demonstrated. I said it was a Real World problem!

    • @stealthblade2992
      @stealthblade2992 3 ปีที่แล้ว

      @@RalphBacon hopefully yes 🙏🏽 😁
      Maybe another method could be via measuring the temperature continously/periodically. If the temperature starts falling (slowly, not fast, caused from opening manually) , an alarm should be given out

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Sounds far too complicated for me! A simple "is the door open" alarm worked for years in my last place; this one will be battery powered so a bit more to it but basically a simple alarm. You'll be suggesting I send myself an email about the door state soon! Oh, someone did that.

  • @petelynch9468
    @petelynch9468 3 ปีที่แล้ว +2

    To implement multiple switches to a single input, just create a multi-tapped voltage dropper (say 5 10k in series) and use an analog input to the Arduino off the bottom of the first resistor. Each switch then shorts out one, two ... of the other resistors.
    This is the standard technique. Quite well known.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      Yes, quite well known but frankly quite despised by me, as I used one once and the hysteresis and drift on the analog reading was pretty wide.
      Not my preferred approach when we have digital inputs going spare, but that's just my approach, Pete.
      Perhaps I should do a quick video on resistor ladders? Hey, come back, I was just kidding!

  • @bepstein111
    @bepstein111 3 ปีที่แล้ว +3

    Wait I thought the whole point of this was to measure two buttons with one input? And then you use a pin each to measure each button (2 pins, 2 "inputs")? Am I missing something here?

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      No, you're not missing something but remember that each pin must be driven by the same +5v input (well, must be connected to the Gate of the P-Channel MOSFET, so a common connection). And I want to differentiate between switches, ie not wired in parallel.
      So it's not the same as having two independent switches connected to two independent input pins.
      Well, after my circuit it is!

  • @EcoHamletsUK
    @EcoHamletsUK 3 ปีที่แล้ว

    You could use a reed switch and magnet, as used in door and window alarms. Make simple enclosures for them out of styrene sheet, or 3D print if you can. Both parts could be made quite small and unobtrusive.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      I used a reed switch in the previous fridge alarm (for the fridge in the utility room, which I showed first) but it was tricky to get the distance "just right". The switch must not close unless the door is totally, 100% closed, not "nearly just 1mm open"!
      This way I can adjust the position without too much trouble.

  • @markday3145
    @markday3145 3 ปีที่แล้ว

    Quite timely. We lost everything in our freezer less than a week ago because something sat a little too close to the edge of the shelf, and the door pockets hit it (like your fridge). It’s out in the garage, and didn’t notice it for a couple of days, after all the food spoiled.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      The first fridge-freezer I showed is also sitting out in the utility room which we don't check every day. Hmm. Maybe I need to reinstate the original fridge alarm on that one! See, another Real World problem. Sorry to hear about your lost food, it also happened to us twice before we moved.

  • @Chriva
    @Chriva 3 ปีที่แล้ว +1

    Thank you for supplying us with the recommended dose of weekly Bacon. -I'd love to get some more tho ;)
    Awesome video as always, Sir

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Crispy, sizzling Bacon always served fresh!

  • @joseph9915
    @joseph9915 3 ปีที่แล้ว +1

    If you don't need to know if both switches are on at the same time you only need to check one switch. If the one you check isn't on then the other one is as the MCU has power :) So you can save a diode and pin. Not that there is much point I guess, going to be loads of pins not used anyway.
    If you want to check for both at once and don't mind using analogue you could also check if the voltage is 0.7 or 0 volts to save a diode.
    Just thought I would add an option to the resistor divider alternative posts :P
    PS.
    Isn't it going to be annoying if the alarm is on all the time the door is open? Nice upgrade might be if the you only sound the alarm if if doors is near to closed for more than say a second. You might need 4 switches :D

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Alarm will not sound all the time! That would not only be annoying, it would immediately have the alarm ripped out and never to be reinstalled by the senior design technician (yes, my wife).
      The alarm (see videos #40 & #41, yes, it's been that long) will chirp as we open a door (different chirp depending on which door), give us warning beep(s) as the time goes by, then finally really go for it when it is obvious the door must be left open! Different alarm rates depending on whether it is the fridge or freezer that is open.
      The only downside is that Benny (our cat, RIP) and Dougle (our Yorkie) got to recognise the fridge door open chirp and came running to ensure they didn't miss a tasty treat. 😄

    • @joseph9915
      @joseph9915 3 ปีที่แล้ว

      @@RalphBacon I guess the small beeps cover the problem of being 1/2 way out the room or back sitting at the table when the alarm goes off.
      Edit:
      Only beeping when the doors is left nearly closed would be better for the Cat/Dog though and save the need for the touch switch.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      I'm not sure I'll be implementing the touch switch this time; they still knew when I was opening the door, must be telepathy.

  • @gracc46
    @gracc46 2 ปีที่แล้ว

    Linux for ever.No blue screens.luv your vids,they are very educational.

    • @RalphBacon
      @RalphBacon  2 ปีที่แล้ว

      Glad you like my videos! I'm sure Linux is very good but I'm a windows man!

  • @icarossavvides2641
    @icarossavvides2641 3 ปีที่แล้ว

    Hi there, a couple of suggestions. How about using magnetic reed switches like those used in domestic alarms systems? For battery powered systems especially, try using as low a micro clock as will do the job, it saves power and there's nothing to be gained by clocking faster than needed.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Yes, magnetic reed switches would work, and require no physical contact at all. But I'm not sure I can get the accuracy I need (ie the door must be closed when the switch activates).
      In this case I'm not sure the clock speed is going to matter as the device is switched off for 99% of its life (whenever the door is closed). But I will certainly use an internal clock if available rather than a crystal one, as I don't care about accuracy but I do care about current consumption.

  • @djmikolajczak
    @djmikolajczak 3 ปีที่แล้ว

    Before installing your tilt sensor in the bin, try putting it in the freezer for several hours and then try it to ensure it works. You may run into an issue with the ball bearing getting frozen in place. I assume these sensors will be used year round so the freezer will simulate winter conditions

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      They'll be used 24x7x365, you are correct. But they will also be protected by a watertight box with foam inside, which should protect them from the worst. But, as it takes but a jiffy to try out the freezer test, I will do that; thanks for the suggestion!

  • @lestronicsuk5662
    @lestronicsuk5662 3 ปีที่แล้ว

    Just a thought and a simple solution, the two doors become one with a small flat join plate ! just the one switch then required, yes I know there then no longer independent but when I've been shopping and loading the fridge/freezer both doors are open and when I'm getting anything from either then there only open for a brief moment anyway :)

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      If the boss notices _anything_ different about the fridge/freezer it will fail the "wife test". Anyway, getting a bottle of Bud from the fridge should not involve opening the freezer door, surely?

  • @oleeide9763
    @oleeide9763 3 ปีที่แล้ว

    Thanks yet again for an excellent and inspiring video.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      If it inspires you, or gets you thinking, then my work here is done!

  • @gpTeacher
    @gpTeacher 3 ปีที่แล้ว

    Great as always Ralph! Uh...call me crazy, but for the fridge ,why not just take out the bottom glass shelf, flip it over and draw a nice thick Shapie line across it with a little arrow pointing towards the back of the fridge to let the 'user' know the edge of the door bin? No need for an alarm.
    But then again, what good would that be? It prevents your creative juices from flowing to make another Arduino solution!
    Great job! Gord

    • @TheUnofficialMaker
      @TheUnofficialMaker 3 ปีที่แล้ว +1

      your missing the point,he is teaching.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      I have often thought of your non-fun, non-Arduino solution, Gord and I might do _both_ as a belt and braces approach.
      Actually, why did the manufacturer not do that. Oh, because it makes the fridge storage look tiny, understood!

    • @gpTeacher
      @gpTeacher 3 ปีที่แล้ว +1

      @@TheUnofficialMaker I'm kidding. I'm a huge fan of Ralph's work😎

  • @craigs5212
    @craigs5212 3 ปีที่แล้ว

    Replace the diodes with a couple of different medium value resistors. Then connect the common side of both switches through a third resistor to your ground return. Connect the high side of the third resistor to an analog input on the CPU. Set the resistor values such that your power up circuit still works. Also set the values of the first two resistors such that when switch 1 is activates ~1mA flows through the third resistor and if switch 2 is activated ~2mA flows through the third resistor. Then measure the voltage across the third resistor to determine which switch is activated.
    SW1 inactive SW2 inactive = 0V volts
    SW1 active SW2 inactive = V where V is in the millivolt range
    SW1 inactive SW2 active = 2V
    Both active = 2V +V = 3V
    Only takes one input and is dead simple to build

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      Some "outside the box" thinking there Craig, very creative. However (you knew that was coming, right?) you've changed a digital input to an analog one and saved one input pin. I don't like resistor ladders or analog inputs if I can avoid them; but that's my personal preference based on what I've built over the years; YMMV as they say!
      Thanks for the suggestion, I suspect many others will read your comment too, thus spreading the knowledge far and wide 👍

  • @jebsjobs
    @jebsjobs 3 ปีที่แล้ว

    Got 9 and a bit minutes in. . .
    2 Points:
    1: Rubbish American Lager? Get some Belgian BEER. Now that's worth drinking! (And I'm from the UK).
    2: You have a cat (from your TH-cam 'header'). No fridge/freezer is cat proof. They have a Faraday/Tesla/Force field that stops all switches working.
    But seriously, considering for home use.
    Keep up the good work! :-)

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      The American lager is fine for lunchtimes (so I don't doze off in the afternoon). We no longer have a cat. 😥 Benny passed away 10 months ago and Dougle (our Yorkie) has yet to jump 4 feet into the air and open a fridge door!

  • @lint2023
    @lint2023 3 ปีที่แล้ว

    Nice switch differentiation.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Glad you think so!

  • @fredflintstone1
    @fredflintstone1 3 ปีที่แล้ว

    I love your real world problems of too many bottles of beer in the fridge:-), my fridge doesn't have too many beers in it as I tend to drink them as soon as they are bought:-) so the door closes okay :-) I also have the pico and the 1602A display waiting for your video on that ;-)

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      I have less beer in the fridge now as I have one in a glass right next to me... hang on... half a one in a glass right next to me. Yes, that 1602 and the PICO works fine using MicroPython but C++ still locks up the USB. Working on it!

  • @ForwardGuidance
    @ForwardGuidance 3 ปีที่แล้ว

    "What do you mean, a week?" lol. When you mention your sponsor, you might want to mention that you have the PCB playlist. I had to look it up.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      I have a PCB playlist? Really? I will have to do what you say then, I had totally forgotten (blame the 5 months of not doing videos, the house move, my age...).

  • @toneystevens5023
    @toneystevens5023 3 ปีที่แล้ว

    Use 2 switches in series. Both NC switches. Who cares if it's the fridge or the freezer. If either one opens that would be the trigger. Then write the code so that the alarm does not go off until the door is left open for some time period you set.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      I could do that, Toney, for sure. But as we _can_ detect more than one switch I thought I'd demonstrate a simple way of doing that and then I'd also know whether the fridge or freezer door has been left open.

    • @toneystevens5023
      @toneystevens5023 3 ปีที่แล้ว

      @@RalphBacon You could also use a temperature sensor. That would inform you if the door was left open or if the fridge/freezer developed another problem.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      A temperature sensor is too slow for what I want, really. And the "alarm" will get more urgent the longer the door is left open. I might be stocking up on beer so it might beep once or twice - but after 5 minutes it's probably a door-left-open situation (too much beer in the fridge) so all hell will break loose!

  • @BerndFelsche
    @BerndFelsche 3 ปีที่แล้ว

    Proper energy harvesting you use the opening of the bin lid to power the device. 😎

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      It probably could power it for one "chirp" of radio waves, but what about when it's left up - we'd have no power to keep sending the "chirp" every 15 minutes, say.

  • @familyminute9502
    @familyminute9502 3 ปีที่แล้ว

    Awesome!! Could I invite you to test a £39.99 desk lamp? Very suitable for home office & night working.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      I've already got all the lamps I need, thank you Carol, but nice of you to think of me.

  • @webslinger2011
    @webslinger2011 3 ปีที่แล้ว

    Nice. How would the alarm be sent? A buzzer? It's possible to send an email using python. What happened your finger?

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      A simple (but musical) buzzer would suffice as it sits in our kitchen. But the fridge I showed first is in the utility room and would not be heard so... I need to think about that one.

    • @webslinger2011
      @webslinger2011 3 ปีที่แล้ว +1

      @@RalphBacon Just in case you're interested, I followed this guy's Rpi3 tutorial and got my project working. I'm able to send an email alert to myself. Had to watch several of his videos and some videos from corey shafer as well. th-cam.com/video/ASXy92ZauwE/w-d-xo.html

  • @IanSlothieRolfe
    @IanSlothieRolfe 3 ปีที่แล้ว +1

    So you're not going to just wire the switches in parallel and power an annoying buzzer then? :D

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      Good grief no. You obviously missed the previous videos on fridge alarms, Ian. A nice chirp as the door opens, a reminder beep after 30 seconds, two reminder beeps after 60 seconds.... finally full blown annoying BEEP BEEP after X minutes (where X is yet to be decided by chief design architect, aka my wife). If the door shuts in time, we use an interrupt to give a reverse chirp that the door closed OK. It's amazing how quickly you get to listen for the confirmation-of-door-closed noise!

  • @MUHAMMADYAWARIFRAHEEM
    @MUHAMMADYAWARIFRAHEEM 3 ปีที่แล้ว

    Very informative video Sir

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      Glad you like it! Nice to see you here again.

  • @TheUnofficialMaker
    @TheUnofficialMaker 3 ปีที่แล้ว

    When will Benny II make his debut?

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Unfortunately not for some time. We still have Dougle (our Yorkie) to look after and we just have no desire for a Benny replacement. He was unique. One of a kind. Never to be repeated. Or replaced. 😥

  • @BaronVonBiffo
    @BaronVonBiffo 3 ปีที่แล้ว

    Budweiser! I'll give you the benefit of the doubt and assume you use it in a wasp trap. :D

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      I normally drink Real Ale (for Real Men, obviously) but for lunch I often share a Bud with my wife. At least I don't fall asleep after one!

  • @JohannSwart_JWS
    @JohannSwart_JWS 3 ปีที่แล้ว

    Hi Ralph, thanks again - nice video. An idea for you - how to drive a bicolour LED with just one I/O line in the simplest (and safest) way possible. Will be interesting, and useful for a lot of folks. Regards!

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Depends on the LED; does it have a common anode/cathode (3 leads) or is it just two LEDs in one package (with 4 leads). Former will require one resistor protected input to sink/source power respectively; and the latter, well, we would common the anodes and do the same. I realise that beginners would not know this so I might drop it into a future video.
      Just to make it more interesting we can use different resistors (across the diodes) to give different operating currents for each LED!

    • @JohannSwart_JWS
      @JohannSwart_JWS 3 ปีที่แล้ว +1

      Common cathode 3 lead seems to be the most "common". I already know how to do this - there's a few caveats though. Just thought it might make an interesting video.

  • @CTCTraining1
    @CTCTraining1 3 ปีที่แล้ว

    Ralph, given how little power your fridge monitor needs is there any chance you could trickle charge the battery from a tiny solar panel ? (Assuming the design meets your Mrs approval of course 😀)

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      You already know the answer, Chris. Firstly, the Mrs would *not approve* of any such nonsense. And, secondly, there is *no sun* in our kitchen.
      However, I do have a solar panel design for something else in mind in the future, so keep tuned!

  • @jenskaa4044
    @jenskaa4044 3 ปีที่แล้ว

    Wouldn't your microntroler pull down the inputs when power off. This will turn on the mcu again?

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      This rings bells that I might have put a further (Schottky) diode in series with the pin(s) in another circuit. I will have to check this. Excellent point, Jens.

    • @jenskaa4044
      @jenskaa4044 3 ปีที่แล้ว

      @@RalphBacon I don't think diodes will do the trick, and especially not schottky, they have a high quiescent current.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      I was thinking putting one in series with the input pins so current can only flow OUT of the μC not back into it, thus shorting the gate of the MOSFET to GND and switching it on. I'm sure I've done this before. Anyway, I will have to check that all is OK before finalising my design (which is 100% in my head right now). Keep tuned!

    • @jenskaa4044
      @jenskaa4044 3 ปีที่แล้ว

      ​@@RalphBacon My solution would be to connect one end the switch to VBAT+ ant the other through a resistor to ground. From the point called "A" where the switch and resistor are connected insert a diode (Anode) connect the Cathode to the gate of an NFET (Source to ground, Drain to the existing FET gate). And insert a resistor from A to an input port of the MCU. The purpose of the diodes is to make a OR gate. Now we only need to pull down the Gate of the new FET, this can be done connecting a resistor to ground, or perhaps connecting it to an output port of the MCU, in that way the MCU is in control of switching off power.

  • @andreaslindner8477
    @andreaslindner8477 3 ปีที่แล้ว

    Hello Ralph, have a look at reed-switches, thiey work with a magnet nearing it, so practically no force involved.

    • @stealthblade2992
      @stealthblade2992 3 ปีที่แล้ว

      The problem with reed switches is the high hysteresis - for this problem you need the smallest hysteresis possible to detect a minimal opening.

    • @andreaslindner8477
      @andreaslindner8477 3 ปีที่แล้ว

      @@stealthblade2992 Agreed, but those furniture-switches have a huge hysteresis too, so in any case it is a question of adjustment. The hysteresis could be adjusted with the huge opening triggering quite late and therefore have a late closing as well.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      The furniture switch can be cleverly mounted so that it only goes off when the door is really closed. And opens when the cupboard door has just opened. Now, I did do this with a reed switch (from a burglar alarm door contact) and high power external magnet on the previous fridge alarm (Nano-based, which I might reinstate now, on the "other" fridge I showed first).

  • @aviateur17
    @aviateur17 3 ปีที่แล้ว

    Good video. Thought you were going to wire them to one input and use resistors to check for different voltage levels. How are you running the switch wire from the freezer to your microcontroller? How do you get the wire out of the freezer cavity?

    • @TheUnofficialMaker
      @TheUnofficialMaker 3 ปีที่แล้ว

      i think its on the outside.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Yes, the wires are from the white switch which is screwed (currently Blu-tacked) to the inside of the cupboard but outside of the fridge/freezer unit.

  • @stevetobias4890
    @stevetobias4890 3 ปีที่แล้ว

    Would a NAND Gate work here, also the fridge alarm can easily and discretely be done with a reed switch.

    • @TheUnofficialMaker
      @TheUnofficialMaker 3 ปีที่แล้ว

      of course there are many solutions but most are mundane. This is why we love Ralph, for his teaching and elegant solutions, so we can apply them to our own projects not just duplicating his.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      I'm not sure my solution is particularly elegant but it will work! And meet the design and aesthetic approval of *the boss* , which is paramount. She lets me do whatever I want in my workshop, but the house is a different matter all together!

  • @alibro7512
    @alibro7512 3 ปีที่แล้ว +1

    If you're ever stuck for a micro switch just dig up an old computer mouse from the junk stash (We all have them). They have three or four nice quality microswitches in them that are very easy to push down albeit with no lever.
    Great video but terrible fridge. What a stupid design.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      Thanks for the tip! Those mice microswitches are pretty easy to press too. Regarding the design of the fridge, I could not agree more, but we inherited it. Maybe, one day, we'll replace it with a better one!

  • @flashcorp76
    @flashcorp76 ปีที่แล้ว

    😂might need a coupla screws for the switch……which I’m sure you done….😊

  • @andymouse
    @andymouse 3 ปีที่แล้ว

    Hi Ralph, The biggest problem for us Arduinite's at the moment is getting chips, the 328p-AU is either ridiculously priced or out of stock or both ! at least thats what I'm finding....cheers.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      That's a shame. Luckily for me I have a decent stock of both lqfp and Dip although I'll be using 3 of those in my bin lid project. I'll make a note to try and source more over the next few weeks - thanks for the heads up.

    • @andymouse
      @andymouse 3 ปีที่แล้ว

      @@RalphBacon Would be interesting to see how you get on.

  • @LauwersFreddy
    @LauwersFreddy 3 ปีที่แล้ว

    That fridge problem clearly needs AI and blockchain to solve this… 😉 Great video as always. Thank you for making these videos!

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      I think we should set up a design committee to plan the design approach first. Then a sub-committee to ratify the design decisions but only after some R&D and cost-benefit analysis. Anyone got a Quantum Computer handy?

  • @Arduino_Kit
    @Arduino_Kit 3 ปีที่แล้ว

    Good

  • @JBERGALIEN
    @JBERGALIEN 2 ปีที่แล้ว

    Hello Ralph, use magnetic switch eg: alarm switch

    • @RalphBacon
      @RalphBacon  2 ปีที่แล้ว +1

      Yes, that's an option as long as the distance between the door and the frame can be accurately measured. The door "nearly closed" is not good enough, if you see what I mean.

    • @JBERGALIEN
      @JBERGALIEN 2 ปีที่แล้ว

      @@RalphBacon I guess the only logical choice, a micro switch with low compression lever.

    • @JBERGALIEN
      @JBERGALIEN 2 ปีที่แล้ว

      there's also neodium magnet

    • @RalphBacon
      @RalphBacon  2 ปีที่แล้ว

      Exactly so!

  • @jonathanpayne9956
    @jonathanpayne9956 3 ปีที่แล้ว

    Well hello! maybe for a neat installation, remember the seals on a fridge and freezer are magnetic !, go hall effect or reed ? just a thought!

    • @jonathanpayne9956
      @jonathanpayne9956 3 ปีที่แล้ว

      having thought a bit, i suspect that the internal temperature of the fridge could be used effectively to tell if the door is open! direction and rate of change, either stand alone or with motor/temp switch input.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Glad you're thinking about this Real World problem, Jonathan, but how would it detect the door closing (quickly enough) and thus switching off the end-of-the-world alarm?

    • @markday3145
      @markday3145 3 ปีที่แล้ว

      Maybe by mounting the temperature sensor in the back (so the temperature won't change as fast)? Or just that the temperature has to be too warm for a long enough time (minutes?) before sounding the alarm.

    • @jonathanpayne9956
      @jonathanpayne9956 3 ปีที่แล้ว

      @@RalphBacon cos we is clever! we use the both rate of change and absolute temperature, we see the temperature is dropping and reset - leave for a couple of minuets and re test.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +2

      You is clever, maybe, but I is simple - which is how I want this alarm to be! 🤣

  • @crefmag
    @crefmag 2 ปีที่แล้ว

    Your fridge already has a switch for the light. Can't you hack into that?

    • @RalphBacon
      @RalphBacon  2 ปีที่แล้ว

      Unfortunately the switch itself can cause the door to not close properly. And the light will always go off _before_ the door has properly closed (if it does close properly at all).

  • @JC-zl7sq
    @JC-zl7sq 3 ปีที่แล้ว

    Have you considered using a Latch circuit instead of putting the micro to sleep, it use less power. Look at this video from Electronoobs th-cam.com/video/Er8fSoeaZD0/w-d-xo.html where he demonstrates it. If you look at the last comment, it's from me where I have a link to button circuit I built using his latch circuit. My version 2 of it (short, long or mutliple press) uses an Attiny85 and an ESP or a HC12 433mhz transceiver. I measured the current with an Power Profiler 2 and it was nano amps when idle.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      I will look at that with a beer in just a moment, JC. Thanks for the link.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +2

      So, the latch circuit he describes there is pretty much identical to my auto on/off/kill circuit from various of my videos (eg #172, #173). As I demoed this first I claim bragging rights!!!

  • @kissingfrogs
    @kissingfrogs 3 ปีที่แล้ว

    could you remove the fridge doors' bottom shelf so you can put what you like on the bottom shelf including the milk (which will stay just a little bit cooler as it will no longer be wedged up against the door in the door shelf). If not then you really need an AI house bot called Marvin to do it all.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Order #3254: one house bot (Marvin). Send asap. 😁

  • @robertobrenes5283
    @robertobrenes5283 3 ปีที่แล้ว

    I was watching the intro and it got me thinking of a funny problem I am having with some JLCPCB boards, I am using "ESP32 thing" boards and I made a PCB just to connect the ESP with logic level converters and some terminals, nothing more, not any component, it has only traces for connections. My ESP32s do not connect to WiFi if I plug them in the PCB, just the PCB, with or without the logic level converters is somehow making my ESP32 boards unable to connect to WiFi. I have checked visually, checked voltages, continuity, I have enough power supply current, the problem occurs with the 3 ESP boards I have. So I don`t know what can cuase this. I designed the PCB using Kicad and have done ERC.
    I wired the same circuit in a protoboard and the ESP connects to WiFi, but as soon I use the PCB the ESP can't connect. SO do you think something in the PCB manufacturing can cause this? I really have tried to find my own mistakes but the PCB is so simple I cannot find what went wrong.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      Hmm. So annoying when this sort of thing happens. So you have ZERO components on the (dual sided) PCB - just the ESP32? No pullups/pulldowns, caps or anything?
      1. Have you got a ground plane under the antenna area of the ESP32 that is zapping all the RF frequencies?
      2. Does the ESP32 boot normally otherwise, just will not connect to your home Wi-Fi? The serial output on a reset shows a normal boot?
      3. Which pins do the logic level converters connect to?
      If you can post a decent picture somewhere of the PCB (front and back) it might help us investigate further.

    • @robertobrenes5283
      @robertobrenes5283 3 ปีที่แล้ว

      @@RalphBacon thanks for the help!!!
      It only has a 10uF cap connected to reset because it is the only way I have found to successfully upload code to these boards, but besides that there is no other component, the problem occurs with and without this cap I have tested two PCBs and the two present this issue.
      1. Yes it has ground under the antenna, but the ESP is not directly sitting on the PCB, it is lifted like 8 or 10mm since it's sitting on a female header. I was thinking of grinding that section of the PCB with a Dremel to see what happens
      2. It reboots normally most of the time, but I have found the ESP gets hot on one of the boards while it is connected to the PCB, one board outputs garbage to the serial port sometimes, but I have one that has zero problems again I have not found any shorts or soldering problems.
      3. The logic converters are wired to 5,15,16,17,19,22,23 at first I thought it was some problem with 5 and 15 cause I read those pins output PWM signals at boot (I have no scope to see that :/) but I have this problems with and without using 5 and 15. Also with and without using the logic level converters
      Note: here is 1:44 am so I cannot take those pictures right now but tomorrow I'll do it and upload them to a Drive folder
      Thanks again!!

    • @robertobrenes5283
      @robertobrenes5283 3 ปีที่แล้ว

      @@RalphBacon drive.google.com/drive/folders/1BgIe6l5SQ4hib_POGQub8vhCrKpTUBWC?usp=sharing I uploaded some pictures, and pdfs, thanks for taking the time mate!

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      I've requested access to that drive.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      OK, I've downloaded the files to my PC for a good look later, as this morning I have urgent (yes, even _more_ urgent) business to deal with. I'll get back to you soon.

  • @gracc46
    @gracc46 2 ปีที่แล้ว

    By the way ,the finger looks a bit sore.

    • @RalphBacon
      @RalphBacon  2 ปีที่แล้ว

      It was _very_ sore when it happened! Healed now, but I do have a scar!

  • @martinbriselden7450
    @martinbriselden7450 3 ปีที่แล้ว

    Don't you mean Newtons Ralph?

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Er... at which point? Ah ha! The force on the microswitch can be measured in Newtons or grams if that is what you are referring to? I prefer grams, I can understand that!

    • @martinbriselden7450
      @martinbriselden7450 3 ปีที่แล้ว +1

      @@RalphBacon Ahh, but the gram refers to mass. Just messing ;-)

  • @mekuranda
    @mekuranda 3 ปีที่แล้ว +1

    I was living the story and enjoying it....then my common sense and stingy streak kicked in and spoilt my beautiful trans like state.....why add 2 diodes when you could add just one resistor...say another 100K in line with second switch....result would be the same ...both independently signalling hi or low states ...I am sure there is something I am missing...just can't see it

    • @jyvben1520
      @jyvben1520 3 ปีที่แล้ว

      if the microprocessor has adc (analog to digital) , checked ADC in Atmega328p, it has.
      checked attiny13, it also has adc.

    • @hauuau
      @hauuau 3 ปีที่แล้ว

      @@jyvben1520 ADC has nothing to do with it.

    • @hauuau
      @hauuau 3 ปีที่แล้ว +1

      That's pretty much how it's usually done, the whole role of pull-up resistors is isolation of switches from the supply.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +2

      I wanted to (a) keep this simple and (b) avoid analog resistor ladders just because I don't like them 😁
      Two 100K resistors instead of two diodes will also work but it can all get a bit edgy - diodes simply conduct or block so I find it a safer design decision. But that's me, squandering the family inheritance on diodes 🤣

    • @hauuau
      @hauuau 3 ปีที่แล้ว

      ​@@RalphBaconDiodes have voltage drop though. In some cases it may be high enough to bring high logic level below detection threshold. Or at least that drop in pull-up voltage will lower noise immunity on the input, especially with a bit high value of the pull-up, like 100K.

  • @pintokitkat
    @pintokitkat 3 ปีที่แล้ว

    Ugly microswitches are nothing that cannot be fixed with a 3d printer.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      If only I had one, Andy! But I am trying to learn Fusion360 in preparation for one...

  • @oleeide9763
    @oleeide9763 3 ปีที่แล้ว +1

    I was first :-)

    • @jyvben1520
      @jyvben1520 3 ปีที่แล้ว +1

      have a mirror, highfive yourself !

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Glad to see you are keen, Ole!