#172

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ส.ค. 2024
  • How to request a graceful shutdown of your microcontroller project without using an LTC2954.
    JLCPCB Prototype for $2 & Free SMT assembly: jlcpcb.com/
    Free coupons for SMT assembly - just pay for the components
    More information (including all links, sketches & PDFs in my GitHub):
    github.com/Ral...
    The Linear Technology *LTC2954* device allows a single push button on and off of your microcontroller (via a P-channel MOSFET). Additionally it can request an emergency shutdown via a user-configurable delay by pressing and holding the aforementioned button for several seconds.
    Here's how to emulate the first two features using our previously used (video #123) Auto Shutoff dual MOSFET circuitry with just a couple of extra components.
    Compare the two circuits in my GitHub; the one of the left is the original circuit; the other is the modified circuit to allow a graceful shutdown request to be be sent to the µController.
    The two additional diodes are just IN4148 small signal diodes. Nothing special!
    The shutdown request is serviced by the microcontroller on an interrupt pin. Full details in the video.
    More information (including all links, sketches & PDFs in my GitHub):
    github.com/Ral...
    LINKS
    Linear Technologies *LTC2954* from RS Components UK Warehouse, about £3 / $4:
    uk.rs-online.c...
    *LTC2954* From AliExpress, $10 for 5 pieces free shipping:
    s.click.aliexpr...
    DUAL MOSFET CJMCU-4599 Si4599 N and P Channel MOSFET Expansion Board $1.89 each or $4.08 for 3 pieces:
    *Single:* www.banggood.c...
    *3 Pieces:* www.banggood.c...
    **Datasheet for LTC2954**:
    www.analog.com...
    *Datasheet for Si4599* dual MOSFET:
    www.vishay.com...
    Interactive *cheat sheet* for calculating potential (resistor) divider values:
    www.ohmslawcalc...
    List of all my videos
    (Special thanks to Michael Kurt Vogel for compiling this)
    bit.ly/TH-camV...
    My blog article on what happened to my eye (again):
    ralphbacon.blo...
    More information (including all links, sketches & PDFs in my GitHub):
    github.com/Ral...
    Popular Links
    YIHUA 938D Portable Hot *Tweezers Mini* Soldering Station 110V/220V
    bit.ly/2M8R0bj
    DANIU Heavy Duty Soldering Solder Iron *Tip Cleaner* Steel Wire $3.33 from China, higher price local warehouse
    bit.ly/Solderin...
    SMD Components Solder *Practice Module Kit* - all components incl QFP chips
    bit.ly/SMDPract...
    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 journey
    My channel, GitHub and blog are here:
    ------------------------------------------------------------------
    / ralphbacon
    ralphbacon.blog
    github.com/Ral...
    ------------------------------------------------------------------
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @seditiousmonkeyart
    @seditiousmonkeyart 4 ปีที่แล้ว +6

    Love the glasses, again! Don't listen to the kill-joys, no reason we can't have a laugh while we learn.

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

      I'm not listening to any Killjoys, Adrian, that's for sure. I release serious videos on this channel about 45 times a year so if I want to wear silly glasses (and more) once a year I think that's fine! And it helps my eyes, which is the main thing and what prompted me to don the Xmas glasses! Glad you liked it!

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

    Ralph you are one in a million!!! THANK YOU FOR MAKING IT FUN TO LEARN

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

      Glad you found it fun(ny) but could still learn, Mark. But despite what another Blackadder viewer (ISO Guy) has mentioned I am NOT putting my underpants on my head with two pencils up my nose.

  • @Mr.Leeroy
    @Mr.Leeroy 4 ปีที่แล้ว +1

    now that's a great example to use both n-ch and p-ch mosfets for the job. well played.

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

      Glad you liked it, Leeroy. If you use the dual mosfet chip it becomes even easier.

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

    You'll have a hard time one-upping those glasses. Absolutely hilarious :D

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

      That sounds like a challenge to me, Christian. We shall see...

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

      @@RalphBacon I take it the challenge was accepted. Looking forward to the next one haha

  • @IvoBallie
    @IvoBallie 4 ปีที่แล้ว

    To eliminate the > 5000 millis , you can do a while pushbutton is low do nothing until pushbutton goes high, then on next push and release (low and high) carry out shutdown procedure . That should bypass the bootloader problem. So basically 2 while routines where the pushbutton must go low and high again to continue the routine. I hope this makes sense.
    Great headgear and glasses.

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

      Ah, Ivo, my inspiration for this video! Thanks for suggesting it, it was good fun and lots of comments about other ways we can do it too. Thanks for your >5000 suggestion too! Glad you liked the headgear!

  • @BerndFelsche
    @BerndFelsche 4 ปีที่แล้ว +5

    Relax and take it easy. And you'll be able to see 2020 in a few weeks. 😀

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

      How old-school of you, Bernd. 20/20 is no more, now it's 6/6, they have converted from feed (20) to metres (6). It's all here: www.allaboutvision.com/en-gb/eye-exam/2020-vision/ in case anyone is remotely interested!

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

    Btw.: I hope you are doing better again, Ralph!
    And just in case ... a 'merry x-mas and a happy new year' in advance!

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

      The same to you Sebastian, let's hope 2020 is not just the year but also my eyes' vision (although it's called 6/6 these days).

    • @asagk
      @asagk 4 ปีที่แล้ว

      @@RalphBacon You certainly will become an eagle eyed person again. Sure thing! Ich drücke jedenfalls die Daumen dafür!

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

    ...taking the Dad jokes to the next level, Ralph puts the "HOHOHO" headband on back to front... 8:09

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

      No, no, Chris, it was put on the right way but my camera flips the image so that you see me looking at the right screen, but I didn't notice this until far too late! But you are right about the Dad jokes.

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

    Very nice! Interestingly, one month ago I made the same circuit with the two diodes 😄. For safety, I added some additional resistors to protect the gates and the input of the μC. The problem with the bootloader timeout could be overcome with a small cap parallel to the gate of the PMos. I also used the service of jlcpcb 👌🏼
    have a nice day - I always enjoy watching your nice videos!!

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

      Glad to hear that we are singing from the same hymn sheet! I usually protect the gates of MOSFETs but then everyone keeps telling me I don't need them. Technically true, but I just feel the need to protect! Happy to see that someone else does that too.

  • @bipolarchemist
    @bipolarchemist 4 ปีที่แล้ว

    Hope your eyes get better and Happy Holidays.

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

      Thank you, both for the good wishes for my eyes and the festive tidings! Back at ya! as they probably don't say any more. Thanks for posting.

  • @iandawkins2182
    @iandawkins2182 4 ปีที่แล้ว +1

    As always a fantastic informative video. I am new to the Arduino world but love learning and you make it so understandable.

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

      Thanks Ian, glad you can follow along. If you ever need clarification do let me know in the comments, after all this channel is designed for enthusiastic beginners as well as the more experienced viewer. Thanks for posting, good to hear from you.

    • @iandawkins2182
      @iandawkins2182 4 ปีที่แล้ว +1

      Thank you so much really appreciate what you are doing, greatest respect and hope all goes well for you in 2020.

  • @Graham1904
    @Graham1904 4 ปีที่แล้ว +1

    BRILLIANT. Love the antlers

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

      It's great that you liked them! As long as the video content was OK too!

  • @wegi9621
    @wegi9621 4 ปีที่แล้ว

    glad to see you again, all of the best for you

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

      And I'm glad to be back, thanks for your kind words.

  • @ShishakliAus
    @ShishakliAus 4 ปีที่แล้ว +2

    Hilarious Ralph 😂😂🎄🎁⛄☃️

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

      I'm glad you found my Christmas fun amusing, ShishakliAus! At least, I hope it was the glasses that were funny not the video content, oh, I never thought of that....

  • @willofirony
    @willofirony 4 ปีที่แล้ว

    WELL AT LEAST YOU AVOIDED 'THE FLICKERING LED PROJECT AND CALLING IT A CANDLE IN THE WIND' CLICHE. GREAT VIDEO, RALPH. i THINK THIS CIRCUIT, IF PUT ON A DAUGHTER BOARD WOULD BE JUST AS USEFUL AS AN LTC.2954 (MIGHT BE AN IDEA FOR ANOTHER JLCPCB PROJECT IN THE SPRING) . LET ME KNOW IF THE CAPS ARE ANY EASIER TO READ.

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

      WHAT? I CAN'T SEE YOU, MICHAEL! Actually, reading my monitor (and these comments) is quite "difficult" but I sit close and increase the zoom and it's fine (for now). I agree about some sort of daughter board but maybe with another circuit I have been playing about with. Details (if it all works out) soon! Great to hear from you Michael, even if you did have to mention that gag! Just call me Rocket Man.

  • @oncledan282
    @oncledan282 4 ปีที่แล้ว

    Good day, my Friend !
    Like most of us by now, I can say this channel is of upmost interest, now we've got one of Santa's elf himself doing the videos ! Hahaha !! I just love your sense of humour, Ralph ! Great variety of Xmas-Theme glasses. All you need now, is the red and white furry Santa hat .. but I'm sure we'll see it by Xmas. LOL !
    As always, great video. I should work more on that Deep Sleep and Shut-Down statuses. This could hep me in real life application (like your « Benny in the Cupboard » project.
    Back to my Laser, now. Keep those eyes away from the Sun and other bright source of ligne, so your recovery chances would be better. I hope all is going well for you and your family. Until next time, take care and God bless !

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

      I had a mystery parcel today, Daniel. A couple of circuit boards. We shall chat about this the minute I get a minute. The do look very professional indeed.

    • @oncledan282
      @oncledan282 4 ปีที่แล้ว +1

      @@RalphBacon Wow! This was very fast !! I mailed them last week. I didn't"t expect you get them by Christmas. Santa was good to you this year !! I'm glad you like them and appreciate the look of them. I did my best and, when I put my heart to it, I shalt admit I'm pretty good at it :-)
      I got my Bare Arduino Boards Monday last and I really am anxious to assemble them to test them out. Unfortunately, I forgot to order the crystals and only ordered them yesterday. I shalt get them by March or April, since they come from China as well ! Hahahaha! They were about 1,50$ CAD each in pack of 10 .. and free chipping. Since I got 10 PCBs and 10 328PUs, I got the right number of everything. All I have to do, now, is wait for the postman to deliver.
      Thanks for dropping that comment my Friend. Have a great Holidays and say Hi to Benny for me ! See you soon. Take good care and God bless !

  • @seditiousmonkeyart
    @seditiousmonkeyart 4 ปีที่แล้ว

    I didn't think the cost was that bad considering it is saving you a mosfet, which are not cheap. Plus it gives you a range of extra features, as you mentioned, delay start/stop, handy for many switch applications.

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

      Well, cost is relative but I think better can be done with less money. The MOSFET it saves you is the N-channel one which is pennies (not the one in the demo), we could use a 2N7000 there. But stay tuned for my final solution!

    • @Numian
      @Numian 4 ปีที่แล้ว +1

      @@RalphBacon So I should delay my components order, right? :-)

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

      Yes, I would, bu tit's up to you, of course. You may think my "final" solution does everything the LTC2954 does and is more flexible. And if it turns out not to be the case you can order one anyway!

  • @r1273m
    @r1273m 4 ปีที่แล้ว

    Very interesting video and I hope your eye continues to improve. It's a long time since I heard the name "Radiospares", I remember back in the 1960's they produced a "Components application data" book, about A6 and 32 pages. The last printed version I received was in 3 great A4 files. They never were cheap though. Ditto Farnell. Where would we be without AliExpress and Banggood! Bob

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

      I find RS Components (Radio Spares of many years gone by) reasonably prices for the UK (about 4 times that of ultra-cheap AliExpress) but they do have free shipping in the UK, at least. And you get it the *next day*. And their components are sourced from authorised distributors, so no dodgy Asian fire makers (you know what I mean, Bob). They even have their own brand now. RS Pro, they call it. I'm not affiliated, in case you're wondering! They won't sell you anything with lead in it (including solder) unless you're a professional user (ie a company) as they have to abide by different rules to Amazon.

    • @r1273m
      @r1273m 4 ปีที่แล้ว

      @@RalphBacon Thank you for that. I have heard that people have problems using lead free solder, I have never tried it yet. I still have 3 x 500g reels of 60/40 "On-Line" solder so at my age I think that should last me...….. Bob

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

      Lead-free solder is the spawn of the devil. It does not flow, needs a higher temperature, solidifies in a dull, rough finish (so it looks like a bad/dry joint) and can grow tin whiskers to ruin your design! See here: www.autodesk.com/products/eagle/blog/tin-whiskers-pcb-soldering-issue/
      The only upside is that lead is no longer being buried in landfill and poisoning the world but this is a case of the tail wagging the dog IMHO. Decent recycling processes could have recovered all that lead, and more!

  • @romancharak3675
    @romancharak3675 4 ปีที่แล้ว

    Hello Ralph! I have been thinking about your Arduino "self power down" requirements. If your momentary button temporarily feeds power to your circuit, allowing the microcontroller to take control of a 5 volt relay or an N channel Mosfet - then the Arduino is self-powered, and will be able to turn off either of those devices when it wants to.
    This has worked for me in experimental circuits. Remember to use 2 Schottky diodes for isolation between the battery and the mosfet/relay circuits. The software will complete all required tasks before releasing the relay/mosfet, and shutting itself down. I hope that all made sense.
    Thank you for all your interesting videos, Ralph! Some of them I have watched numerous times to glean all your programming concepts and circuit ideas. Merry Christmas!

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

      Merry Christmas to you too, Roman. And don't forget to watch my future/next video on a better way to control power to an Arduino with the auto shutdown and emergency kill feature too!

  • @pfeerick
    @pfeerick 4 ปีที่แล้ว +1

    Just wanted to add another tidbit to this video... if you re-flash your Nano as an Uno (since this is what the 'new' bootloader for the Nano is ... i.e. the Optiboot bootloader... , but flashing it as an Uno gives the correct fuse setting for the bootloader partition so you get the benefit of the 1.5k smaller bootloader) it starts nearly instantly rather than waiting nearly two seconds. Arduino IDE still uses the old bootloader partition size fuse settings and 'maximum sketch size' because of yet another production error (see github.com/arduino/ArduinoCore-avr/issues/10).
    I only mention this as I've finally implemented auto-power off using this dual-mosfet idea the power control for a battery voltage monitor thingamajig (uses a relay for the 'load' switching, and the dual-mosfet to power off the monitor system and the load)... and not having that extra 1536 bytes of Flash was annoying me... even though my program is currently only 1798 bytes in size! The extra benefit I hadn't realised was that Optiboot is nearly instant on. Nice!

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

      Interesting. I already use the Optiboot bootloader (it's been standard for UNOs for quite some time) but maybe the Nano one is subtly different? I shall have a look, Peter, thanks for the heads up!

    • @pfeerick
      @pfeerick 4 ปีที่แล้ว

      @@RalphBacon Yes, the Nano bootloader pre January 2018 reserved 2k for the bootloader, and has the extended boot delay. However, since they don't give a changelog... hard to tell if anything else was 'improved' or fixed, other than a WDT reset bug. After that date, all 'genuine' nanos were shipped with the much smaller and faster bootloader used on the Uno, but they botched the fuses, so you don't get the benefit of the smaller bootloader. There is this notice on the www.arduino.cc/en/Guide/ArduinoNano page for the Arduino Nano "NOTE: We have updated the NANO board with a fresh bootloader. Boards sold from us from January 2018 have this new bootloader, while boards manufactured before that date have the old bootloader. "

  • @LimbaZero
    @LimbaZero 4 ปีที่แล้ว

    I think these chips are designed to handle 12 to 24v that then go to PSU section. So overkill for arduino. I think these were meant to use with Linux devices. This is usually done with ATTINY/CPLD/FPGA but you need separated programmer in production. These can give you sequencing for PSU powerup for bigger chips.

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

      The price certainly indicates a specialist use so you are doubtless correct. But my next video shows how we can do this more cheaply.

  • @gartmorn
    @gartmorn 4 ปีที่แล้ว

    A time delay to initiate shutdown could be seen as a plus to save an accidental shutdown. Someone knocking against the button for instance! In fact also good on start up for same reason!

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

      Ah, so a delay in pressing the button for both start up and shutdown could be advantageous. Yes, I can see that. I'll bear that in mind for my future video solution...

  • @_el.guapo_
    @_el.guapo_ ปีที่แล้ว

    Great video! That's the one I was looking for.
    I checked the specs of the LTC2954, you have a default PDT of 6.4s.
    Then you can extend it to +9s with a 1500pF capacitor.
    I'm not sure I would like to give that easy option to a user
    because they might use it even when it's not necessary (they always find ways to break the device).
    In that case wouldn't that be better to use the Arduino reset button ?
    Also, as you mentioned you don't actually save that much space with the LTC2954.

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

      Wash your mouth out with soap, Laurent! Disparaging our users like that. As if they _deliberately_ would cause us even more trouble than they normally do!
      Actually 🤔Hmm, now I think about it... scratch all that, you're totally correct.

    • @_el.guapo_
      @_el.guapo_ ปีที่แล้ว

      @@RalphBacon I like the idea of one button to rule them all though. I think I will give it a go.

  • @ForwardGuidance
    @ForwardGuidance 4 ปีที่แล้ว +2

    Hilarious Ralph, but I'm still going to ask you a serious question even though your channel is obviously not serious at all. ;) Question is 100 percent off topic, but I know you'll know. I lived in England 30 years ago, I remember wires to lights in homes being very small twisted pairs (I'm pretty sure this is what I saw... maybe my memory is whacked though?). Being from the US, I thought, why so small? I now realize 220 volts draws half the amps than 110 so less amps, less heat, smaller wires? I'm trying to figure out what size wire is typical in English homes? Here in the US, 12 gauge for 20AMP circuits and 14 for everything else.
    What size wire is used in England for high amp areas like bathroom, kitchen counter, garage as compared to wire size outside these areas?
    Thanks Ralph.

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

      Our wires are measured in mm² (millimetres squared) so we might have cable of 1mm², 1.5mm², 2.5mm² cable that can carry 6A, 10A or 13A respectively. The first two are generally for lighting with the last one for everything else (eg kettles, heaters, toasters) that can draw anything up to 3KW. The sizes are the cross section of the individual wires (LIVE, NEUTRAL and EARTH) and are bigger when stranded than when solid core, because stranded wire takes up a little more room). Stranded is for appliances (flex) such as your kettle, and solid core for fixed permanent installation (eg your house wiring).
      So buried in the walls of our houses we might have solid core 2.5 mm² for 20 ampere radial or 32 ampere ring socket circuits that literally form a ring (or loop) from the consumer unit (fuse box) and back again. Cookers and some electric shower units have their own 40A circuit directly from the consumer unit with their own breaker. Bathrooms are allowed no sockets at all, just pull cords for lights and isolating transformers for shaving points.
      Outdoors we must use armoured cable (very difficult to work with without the correct tools) or it must be protected in conduit or similar. so running an armoured cable down to a pond, for example, the cable must be buried 300mm - 600mm with warning tape above it.
      Does this answer your question or has it just raised more?

    • @ForwardGuidance
      @ForwardGuidance 4 ปีที่แล้ว +1

      @@RalphBacon That's a great answer. US has solid core 4.0 (12AWG) buried in the walls of the bathroom, kitchen, and garage. These are the high amp areas (hair drier, curling iron, toaster, toaster oven, food processor, then tools in the garage). The lower amp areas get solid core 2.5 (14AWG) buried in the walls (lvrm, dining, bedrooms).
      4.0 is for 20AMP circuit, 2.5 is for 15AMP Circuit.
      I was wondering because higher voltage will carry less AMPs.
      1000w / 120v = 8.33amps
      1000w / 220v = 4.17amps
      1500w / 120v = 12.50amps
      1500w / 220v = 6.25 amps
      Smaller wire should be able to carry 4.17amps or 6.25amps so I was wondering if smaller wire was buried in the walls there and how small it was. It appears 2.5 is standard in the walls no matter the room type in the UK. No need to have 4.0 buried in the walls there. Larger wire is used to directly connect a high amp appliance (cooker, shower) to individual high amp circuit.
      Thanks Ralph, that puts an end to my wondering.

    • @alanpatterson2384
      @alanpatterson2384 4 ปีที่แล้ว

      In practice, in the UK, we have what are called 'ring circuits'. These comprise 2.5 sq mm circuits which are looped back to the circuit breaker so that each socket outlet is fed by two 2.5 sq mm cables. The circuit breaker is 32 amp. Within floor area restrictions, any number of sockets can be used on the circuit because of the diversification concept.

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

    Very informative video

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

      Glad you liked it, Muhammad!

  • @paulyorke1437
    @paulyorke1437 4 ปีที่แล้ว

    Hi Ralph. Loved you OHOHOH head decoration. Thought you'd burnt your finger on a soldering iron :-) Then I realised you forgot that your image is reversed . HOHOHO !!! :-) :-)
    Is an interrupt really necessary? Anyway just want to thank you for all your great instructables this year, I've learnt a lot from you this year. Now make all my projects using EasyEDA, JLCPCB boards and buy super cheap mostly SMD devices from LCSC. Hope your eyes give you a better 2020 that they have in 2019. All the best,

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

      Yes, Paul, my camera flips the image (well, I've set it that way) so that I'm looking the correct way on screen, but I forgot about the writing, including SAMTSIRHC YRREM or whatever is was on one of my glasses. An interrupt is the _best_ way to detect infrequent signals although polling _could_ be used if you really wanted to, I guess (but you might miss a pulse). Glad you like the new PCB way of doing things, me too!

    • @paulyorke1437
      @paulyorke1437 4 ปีที่แล้ว

      @@RalphBacon re earlier videos, will you be showing us how to use the USBAVR programmer from Aliexpress, the ICSP port and the Ardunino IDE to flash the atmega328p? I can flash the 328s with my sketch using the DUO shield after flashing the bootloader on but I've had no luck flashing with the USBAVR. All the best

    • @paulyorke1437
      @paulyorke1437 4 ปีที่แล้ว

      Stand down boss :-) cracked the ICSP USBAVR programming issue. Hadn't realised that you have to use Upload Using Programmer from the Sketch menu. All now OK.

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

      Easy to forget, and many is the time I have overwritten my "Arduino as ISP" board with the sketch meant for the board attached to it. Doh!

  • @danielroibert5631
    @danielroibert5631 4 ปีที่แล้ว

    Hello, That is great. Good video. Thank-you. Why using a big power mosfet for the N channel IRL3705 ? there is no current pass thru. I think that a litle BSS138 or 2n7002 like is largely enough.

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

      Absolutely, Daniel. These were the MOSFETs on the breadboard from when I did a previous project and I left them in situ. But I did mention in the video that such large transistors are not required, not even the P-Channel MOSFET. But small current (say, up to 1A) P-Channel MOSFETs are less ubiquitous but I've found some I think might be suitable. Or use the dual MOSFET chip from last video! Stay tuned for a future video update! Good point you raise, thanks for posting.

    • @danielroibert5631
      @danielroibert5631 4 ปีที่แล้ว

      @@RalphBacon How, sorry :-)

  • @henrikjensen3278
    @henrikjensen3278 4 ปีที่แล้ว

    Nice circuit and fairly cheap with that dual MOSFET.
    I do not need a interrupt pin for that, the pin can be polled in loop or a timer interrupt, a reaction time of 0.1 seconds would be good enough.
    Anyway setting up interrupt on LOW is a bad idea, have your tried counting how many interrupt you get while holding the button down? The correct setting is FALLING, it will only give a few interrupts (depending on how clean the button make contact).

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

      Yes, you do get an interrupt whilst the button is held LOW, Henrik, that is true. FALLING may be better here and I do sometimes use that too (just not in the Rotary Encoder sketch). I'll plug it into a totally different sketch for anther video to see if it works as well. Polling is OK if your program never delays but an interrupt works best, IMHO. Perhaps a Pin Change interrupt would be enough here, I haven't tried it (yet) though.

  • @trevornorrey7483
    @trevornorrey7483 4 ปีที่แล้ว

    Hi Ralph,
    I remember x-ray specs being advertised in Exchange & Mart many moons ago, but I always thought they were to allow the wearer to see through things, not for everyone else to see straight through the wearer.
    Hope your eyes are up to soldering duties again soon.

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

      You can see through my head because I have nothing in there, Trevor. Not even sawdust! Soldering is off the agenda right now but perhaps by 1st Jan my eye will give me some sort of stereoscopic vision again, so essential for fine (SMD) work. But I do have a large Andonstar microscope ready in case it does not! Thanks for your kind words, appreciated.

  • @markj3851
    @markj3851 4 ปีที่แล้ว

    Ralph- would like to get your recommendation on which microphone you use to record your audio? Are you using any special video or audio equipment? The sound and video are great, keep them coming!

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

      I use cheap stuff! Most TH-camrs use the Blue Yeti microphone (amzn.to/35IwCFf) but I use the Auna like this one amzn.to/2Q9o3wJ as it was much cheaper at the time and sounds good! It's on a proper mic stand that clamps to my desk so I can move it out of the way. That cost about £20. Any camera (still or video) that can record clean HDMI HD 1980x1080 at 25fps output is fine - don't spend too much as you can always upgrade when you are the new PewDiePie! I hope this helps.

  • @keitholiver3981
    @keitholiver3981 4 ปีที่แล้ว +1

    Could you not use the long hold on the switch not to shutdown but jump to a configuration/setup mode

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

      Possibly. Depends what the host µC does with that trigger signal. I shall muse over this excellent suggestion, stay tuned. Thanks for posting, Keith, nice to hear from you.

  • @jensschroder8214
    @jensschroder8214 4 ปีที่แล้ว +1

    may be cheeper with a tniy13/tiny45 in sleep mode switching a mosfet and a big arduino

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

      OMG another person suggesting an AVR TinyXX solution! OK, Jens, I hope you like my forthcoming video doing just that...

  • @reelrebellion7486
    @reelrebellion7486 4 ปีที่แล้ว

    Zigmoond Frood would be interested in your internal resistance to saying internal resistance, I on the other hand, am concerned that reading through the code made your eyes go on fire. Later I could see straight through your head, are you alright? OHOHOH. On the on/off chip it seems more useful if you are desperate for one more pin, or maybe if space is a concern. I think you could do similar for less with a 555 timer waiting for the arduino to raise a power good line. Of course that is more parts, pins and real estate on the pcb.

    • @reelrebellion7486
      @reelrebellion7486 4 ปีที่แล้ว

      And some additional sort of latching with the 555, a bit busy maybe, but it fits with your new "glam" theme.

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

      What we really need is a better chip than a 555, Kent, something with a bit of "intelligence". Hmm, watch Friday;s video!

  • @SergiyGryb
    @SergiyGryb 4 ปีที่แล้ว

    that shutDown variable should be defined as volatile bool !!!!! because it is altered in the pwrIntISR() function called by interrupt...

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

      Correct. I spotted that yesterday but thought "Hey, no-one will spot that, I'll just mention it in my next video." Drat! I can't get away with anything on this channel. Good call, Sergiy, but have no fear, all my interrupt variables are declared as volatile (usually).

  • @gregwmanning
    @gregwmanning 4 ปีที่แล้ว

    Gday Ralph, I'm glad your eye is improving. Thanks for informative video. What situation is the D2 "Request Off" diode necessary? I'm thinking the circuit may work without it. Merry Christmas. LC&S Greg

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

      That was belt and braces as I was developing, Greg, as I didn't want power flowing from +ve down D2 but that is under our Arduino programming control, I guess. As it stand it isolates D2 from the circuit and I'd probably keep it in just for safety. If it were a commercial product they would force me to remove it, that's for sure.

  • @hasmorais
    @hasmorais 4 ปีที่แล้ว

    The feature of that timer can be done in arduino checking button pressed until countdown time?

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

      Possibly, Hugo,possibly. I wanted to keep it reasonably straightforward though, but there is definitely a better way IMHO to do all this so keep tuned!

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

    Hi Ralph, your a fashion god! I was also very surprised at the price on that device and would probably opt for 2 Mosfets but the small 100mA ones (TO92 I think) another thing is, yeah those see through bread boards are awful, I bought a couple because I thought they look neat but in actual use they have strange optical effects that make them hard to use, I would warn anyone about that, anyhow nice vid and merry christmas to you and you gang!

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

      The transparent breadboards are just as bad in my view as any of the others I have. I'd pay £10 for a decent one that lets me put in components without bending the leads or just refusing to accept them at all, or having a dodgy connection when inserted. I;m sure professional electronics engineers must get good ones from somewhere?

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

      @@RalphBacon I would like to no what the pros use as well, I too would pay a bit more, I have asked the question in comment sections before but never had a definitive reply.

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

      If I ever find out I will let everyone know!

  • @romancharak3675
    @romancharak3675 4 ปีที่แล้ว

    Program your Arduino to go to sleep after power up, then your button can wake and sleep the microcontroller. No mosfets required - just wake on interrupt.

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

      What if the Arduino cannot be put to sleep because it has to do lots of things, like counting bees in a beehive? But I get your point, there a number of ways to do this and your suggestion is up there with the rest of them, Roman! Thanks for posting.

  • @bugiroff9926
    @bugiroff9926 4 ปีที่แล้ว

    Just a thought... Could this be used as a "factory reset" button? I work with wireless access points all the time, and if something has gone wrong, you have to hold in a button to clear out what ever settings it has on board. Perhaps the same concept could be applied to an esp8266 or something. Use one of these ICs to act as a reset to have the code reset it's IP to a known address.

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

      Do mean actually writing to an ESPXX or just requesting the ESPXX does something?

  • @romancharak3675
    @romancharak3675 4 ปีที่แล้ว

    That boot-loader is really messing you up, Ralph! If your microcontroller is sleeping, you can wake it up with a button press. AND put it to sleep again, with a button press. I constructed a lighting controller for my garage lights with just such a sketch, using PIC Microcontroller. The same will work with Arduino.

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

      Yes, I've done a few Deep Sleep videos, awoken by a button press. This video was more how to power up the Arduino with a single button push and then let the Arduino power itself off again when it wanted to. Whilst this is OK I think we can do better and without buying an LTC2954.

  • @yogeshitaliya473
    @yogeshitaliya473 4 ปีที่แล้ว

    Have nice day sir

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

      Thanks Yogesh, you too!

  • @asagk
    @asagk 4 ปีที่แล้ว

    Sounds like a similar setup commonly used with NAND gates. A TTL device with 2 input NAND gates have mostly 4 of them inside one IC. Actually, this is already enough to create the logic for a momentary on/off switch. The resistor/capacitor values decide the switch timings in such TTL-on/off-switch scenario.
    Example: www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch#press-on-hold-off-latching-circuits
    Products from Linear, Analog Devices, Intersil and some of the other US companies are generally overpriced by large amounts.
    But you could replace the LTC2954 by an ATtiny, since this is what this device basically is at a functional level. The ATtiny could deep sleep all the time, except when the button is pressed (INT), and then do all the stuff to signal the "power down sequence" in the arduino, wait for the "ready for shutdown signal" by Arduino and turn the MOSFET for cutting off power supply. An ATtiny is cheap and would do the same stuff for a fraction of the price for a LTC2954. The only parts needed with an ATtiny is a resistor+capacitor to debounce the momentary switch (as low-pass filter), a mosfet+resistor for the power switching and Bob is your uncle.

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

      Robert is indeed my mother's brother. So my hours here on my workbench developing a robust (and cheap) ATTiny85 solution in secret have already been thought of? I knew someone would have tried it before. But my final solution also ---- oh, no spoilers on that one yet. I'm happy that at least two people will not consider my solution over-engineered as you have both thought of it and at least one of you implemented it. Keep tuned!

    • @asagk
      @asagk 4 ปีที่แล้ว

      @@RalphBacon Your approach is not over-engineered at all, especially when not only powering down the arduino, but also all the sensors and else stuff attached to it. That can make up great power savings over time!

    • @Roy_Tellason
      @Roy_Tellason 4 ปีที่แล้ว

      That's not TTL, it's CMOS!

    • @asagk
      @asagk 4 ปีที่แล้ว

      @@Roy_Tellason What difference does CMOS vs TTL make for this application then?

  • @vonries
    @vonries 4 ปีที่แล้ว

    Hi Ralph,
    What on earth did you do to your eye this time? I hope it is not too serious! The glasses didn't bother me. What makes me worry about you is the blue hair. You can say that's because of your eye. Either way Merry Christmas to you my friend. May the best of 2019 be the start of even better things in 2020.

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

      You must have been living in a cave, Steve, if you don't know about my most recent "right bad eye" experience. I even released a blog entry too. Sigh. All that effort gone to waste! Just so you know my right eye decided to detach its retina (more seriously than the left one previously) so more emergency surgery in Oxford University Hospital. That was 4 weeks ago. Still can't see anything out of it except light/dark. Yes, the blue hair is a side effect of the operation. What? Don't believe me? Oh, fine, it was the white balance of my camera, fixed now (I hope). Thanks for your best wishes, nice to hear from you now that you are out of your cave!

    • @vonries
      @vonries 4 ปีที่แล้ว +1

      @@RalphBacon that's not a rock in living under, that's my head. ;

  • @SergiyGryb
    @SergiyGryb 4 ปีที่แล้ว

    Also, you may add LED with current limiting resistor in parallel to the top 100k resistor and use it as power on indication :-)

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

      That would make your previous suggestion (and my reply) even more likely. But if leakage were not a problem, would the 100K even be required in that case?

  • @SergiyGryb
    @SergiyGryb 4 ปีที่แล้ว

    Hi Ralph! I think it should work without diode connected to D2 (horizontal on your schematic), just short it out... Could you try/test it, please?

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

      It does seem to work, Sergiy, but then allows current to potentially flow into the unpowered Uno. We've all experienced the situation where the UNO is powered off yet current is now coming into the device via the GPIO pins, probably flowing through the pins' MOSFET protection diodes or something similar. In this case it's a tiny (potential) current as it's limited by the 100K resistor, but even so I think I would keep it in.

    • @SergiyGryb
      @SergiyGryb 4 ปีที่แล้ว

      Ralph S Bacon you are right, I have not though about that tiny current leakage...

  • @MrAlFuture
    @MrAlFuture 4 ปีที่แล้ว

    Could the LTC2954 be emulated by a very cheap 8 pin microcontroller? Sure dumping the firmware onto the chip would be a hassle up front but that'd only be a one off pain.

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

      Jeez Louise, this is the 5th suggestion along that route and I thought I was going to be ground-breaking in my next video! There is indeed, nothing new in the world. A simple, cheap, µC would be ideal (instead of the overpriced LTC2954) so keep tuned for my final solution on this front. Glad to see you are thinking along the same lines as me!

  • @zaprodk
    @zaprodk 4 ปีที่แล้ว +1

    You might need to adjust the color temperature on the face-camera. You are all blue in the face like a smurf :D

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

      Erm, but I AM a smurf, I thought everyone knew that?

  • @JerryEricsson
    @JerryEricsson 4 ปีที่แล้ว

    I purchased a couple of those 18650 battery sleds, they are indeed cool for use with Arduinos and ESP series, but if I leave a battery in them overnight, they seem to drain the battery about half way and if I leave it in day and night, I must charge it every day to be useful. Have you found where the current is leaking?

    • @brendan3966
      @brendan3966 4 ปีที่แล้ว

      The voltage regulators are always working. The on/off switch only turns off the usb.

    • @andyfraser5876
      @andyfraser5876 4 ปีที่แล้ว

      The one I have doesn't discharge so quickly; I sometimes don't use it for weeks and it's still fine. Maybe yours are faulty, or a different version?

    • @stuartajc8141
      @stuartajc8141 4 ปีที่แล้ว

      I think the things are variable quality. I have two, one won't charge, the other is fine. It has been on my desk, charged but unused, for about three months ,and the voltage is still 4.03V. I think that you may have a bad one?

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

      Mine doesn't discharge when just left alone. Can you measure the current being drawn from the actual battery (intercept the positive in the battery holder with your multimeter). It should be microamps.

    • @JerryEricsson
      @JerryEricsson 4 ปีที่แล้ว +1

      @@RalphBacon I will give that a try. Last night I charged her to full charge. This morning she displays 2 leds on the charge indicator on the bottom. The only mod I made to it was simply putting 4 nylon standoff's on it so there is no chance of shorting the board on the bottom.

  • @omaral-halabiah2851
    @omaral-halabiah2851 4 ปีที่แล้ว

    ha ha ha , funny glasses 😁

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

      The ones I used are, of course, my everyday glasses. Wait until I get out my funny ones.

  • @Graham1904
    @Graham1904 4 ปีที่แล้ว

    Dave Jones EEVblog made up a cheap switch that doesn't need an LTC. Go look for that to review......

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

      Yes, I watched that, a very young Dave Jones indeed. But we can do more than what the LTC offers us, more cheaply too. Stay tuned.

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

    no amazon echo owner can have a cat/dog/child called alexander, sad ( tested by Ralph : no problem ok thanks )
    Don't force your eyes, take it easy
    Our eyes have been entertained ....

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

      I just tried it. Alexa ignores me, no matter how I say Alexander. Or Alexandra, at which point she opened one eye but did not respond. Amazon are getting better! And you can change th wake word to Echo or Computer, of course. Thanks for your concern over my eyes, I am definitely slower these days trying to see stuff but that will improve, I'm sure (he said, confidently).

    • @Roy_Tellason
      @Roy_Tellason 4 ปีที่แล้ว

      This reminds me of a guy I met many years ago, who was named Alexander. And he named is daughters Alexandra, and a couple more similar variants...

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

    why is this chip so weirdly expensive?

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

      It was expensive even _before_ the general chip shortage. I guess it's all down to supply and demand.

  • @andyfraser5876
    @andyfraser5876 4 ปีที่แล้ว

    I just checked Farnell, but it comes up as 'no longer stocked': uk.farnell.com/search?st=LTC2954

    • @andyfraser5876
      @andyfraser5876 4 ปีที่แล้ว

      Maybe this alternative? uk.farnell.com/maxim-integrated-products/max16054azt-t/pushbutton-on-off-controller-tsot/dp/2515822 A bit pricey though.

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

      There are quite a few alternative devices to one I showed, but I'm hoping my final, future video on this topic is even better! In this day and age I think we need more intelligent switching and more control!

  • @davidbottrill5122
    @davidbottrill5122 4 ปีที่แล้ว

    Thanks for the video as usual very interesting. On a slightly related note you may be interested in a technique I first used on the MBed platform for driving an illuminated push button from a single GPIO port. This only works on boards such as the STM32 BluePill where you can set a GPIO to Open Drain output.
    I've put the sketch on my GitHub: github.com/djbottrill/Single-GPIO-LED-Button
    Most of the time the GPIO is an output driving the LED, periodically the GPIO is switched to an input and the switch state is read, the switch simply connects the GPIO to ground when pressed this does turn on the LED but in practice that's not an aesthetic problem.

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

      I've read your GitHub entry, very interesting and not so say efficient way of doing it. You may appreciate my future, overengineered (final) solution on this topic! Keep tuned.

    • @Roy_Tellason
      @Roy_Tellason 4 ปีที่แล้ว

      It seems to me that the lack of an open-drain output could be dealt with by simply adding a diode.

  • @CXensation
    @CXensation 4 ปีที่แล้ว

    Never mind commenting on your glasses, we all know you have to use them for a reason.
    I was thinking about your sponsor on the component price issue.
    Do they have an option to deliver non-mounted components at a fair price together with a pcb project ?
    If so, you could bring it up explaining ins & outs as a sub issue in a future video.

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

      So is your PCB going to be (partly) assembled? JLCPCB will only assemble SMT components, others you would have to order separately from LCSC.com (where JLCPCB get their stuff from) but then shipping costs come into play. Let me know what you are hoping for.

    • @CXensation
      @CXensation 4 ปีที่แล้ว

      @@RalphBacon I was hoping for an alternate components source at competetive prices.
      Not the case as I see it.

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

      I believe LCSC are very competitive in component prices even if we do have to buy 5, 10, 50 or 100 of a particular device (at $0.001 each it never amounts to much). Shipping is a different issue. DHL is about $20 so not something you would use for a handful of components. There are other, cheaper (and slower) delivery options though. AliExpress does cheap components but you won't know how good they are until they arrive.

  • @cmuller1441
    @cmuller1441 4 ปีที่แล้ว +1

    From 7.5 years ago on eevblog:
    th-cam.com/video/Foc9R0dC2iI/w-d-xo.html

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

      The take away from that video, is that Dave Jones looks soooo much younger! He's using a slightly different method than me (many ways to skin a cat or switch things on and off, I guess). Using a dual MOSFET chip like the Si4590 is probably a nice (and cheap) way to go these days, Fewer components for one.

    • @cmuller1441
      @cmuller1441 4 ปีที่แล้ว +1

      @@RalphBacon the big difference is that it's without any microcontroller and works with any voltage...
      Also the total cost is hard to beat even with nowadays $0.1 mcus

  • @TheEmbeddedHobbyist
    @TheEmbeddedHobbyist 4 ปีที่แล้ว

    need to dump that boot loader.

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

      Indeed, it was a real pain. But my new solution has no bootloader so keep tuned for that one.

    • @TheEmbeddedHobbyist
      @TheEmbeddedHobbyist 4 ปีที่แล้ว +1

      @@RalphBacon i just built a controller for my Weller soldering pencil, it's a pain that the display is shown doing things while the uC waits. just started to get interested in moving over to more Atmel chips, but moving away from Ardunio to MPLAB X ide so using them more like supper PIC's. I assuming that MPLAB X will treat the fuses just like it does with PIC config bits and you set them in the code. another great vid thanks

  • @usmanhaider4653
    @usmanhaider4653 4 ปีที่แล้ว

    Unprofessional youtuber. Need to grow up.

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

      It's Christmas Time, Usman. Time for a little fun. The video content was the same as ever, or did you not watch it? And I do have to wear sunglasses at this time due to my eye operation so what better way to do it?

    • @usmanhaider4653
      @usmanhaider4653 4 ปีที่แล้ว

      @@RalphBacon oh sorry I didn't know that. 👍

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

      No problem! 🎄🎅🎁