#171

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 พ.ค. 2024
  • Don't let a flat battery ruin your data gathering! This simple trick shows you how to detect a failing battery.
    PCBWay Assembly Service only $30 with Quick Turnaround Time www.pcbway.com
    You can read all this and MORE (eg Circuit Diagrams, Sketch) in my GitHub:
    github.com/RalphBacon/171-Mon...
    So your battery-powered project runs on a buck-boost (or other DC to DC converter) and you need to monitor the voltage of the LiPO rather than the VCC supplied to the Arduino (as shown in video #160).
    A simple configuration at the Arduino and a simple potential divider and it's job done! Then you can monitor the voltage of your LiPO (or car battery etc) and *get early warning* when it is on the slippery slope to complete discharge.
    Remember, too, that you don't want to run a LiPO (eg an 18650) any lower than 3.0v or you will *permanently damage* the device and it may never fully recover. If your battery has protection circuitry included (18650 batteries WITH protection are slightly longer than unprotected ones) it will automatically shut it down at 3.0 volts anyway.
    The sketch is so simple I'm almost embarrassed to upload it - BUT there is a *critical line* of code that is essential this all works without destroying your Arduino's AREF pin so do check it out before connecting anything.
    List of all my videos
    (Special thanks to Michael Kurt Vogel for compiling this)
    bit.ly/TH-camVideoList-RalphB...
    You can read all this and MORE in my GitHub:
    github.com/RalphBacon/171-Mon...
    =============================
    LINKS to products used in the video
    =============================
    CJMCU-4599 Si4599 N and P Channel 40V (D -S) *MOSFET Expansion Board* Module about $4 for 3 pieces:
    www.banggood.com/3pcs-CJMCU-4...
    DC-DC *Boost Buck Adjustable* Step Up/Step Down Automatic Converter XL6009 Module about $2.67 (or $5 from UK warehouse):
    www.banggood.com/DC-DC-Boost-...
    DC-DC 2.5V-15V to 3.3V *Fixed Output* Automatic Buck Boost Step Up Step Down $1.67 each:
    www.banggood.com/DC-DC-2_5V-1...
    0.36 Inch *Digital Voltmeter* DC 0V-100V Three Wires 3 Digit Battery Voltage Panel Meter about $2 each or $1 each in a pack fo 10:
    www.banggood.com/805-Micro-0_...
    Wemos *18650 UPS/PSU* as used in the video, about $7 for THREE pieces ($3.68 if bought indivually):
    www.banggood.com/3Pcs-Wemos-E...
    Interactive cheat sheet for calculating *potential (resistor) divider* values:
    www.ohmslawcalculator.com/volt...
    My blog article on what happened to my eye (again):
    ralphbacon.blog/?p=340
    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/SolderingIronCLeaner
    SMD Components Solder *Practice Module Kit* - all components incl QFP chips
    bit.ly/SMDPracticeBoard
    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 and blog are here:
    ------------------------------------------------------------------
    / ralphbacon
    ralphbacon.blog
    ------------------------------------------------------------------
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    All fine and good (plus another informative video), just don't put your health and well being at risk. I'm looking forward to many years of your work and can wait a bit for you to get better.

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

      Your concern is greatly appreciated, Dale. It might be that I don't a video every week but we will see how it goes. It certainly takes longer working with just one (misty, slightly blurred) eye, that's for sure!

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

    Cool video, thanks Ralph! For anyone not already aware.....those small voltmeters can be very easily calibrated by hooking up to a voltage reference and turning the tiny pot on the back of each one.

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

      You are correct! I had to look under my microscope and there it was! Very, _very_ small. Tiny, in fact. A very small screwdriver will be required. Thanks for the heads up. Good to hear from you and I'm glad you liked the video.

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

    God to see you back, I hope your eyes get better
    Cool glasses :)
    Most of those volt meters can be adjusted for accuracy.
    Well explained as usual and good ideers.

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

      Yes, there's a tiny variable resistor on the back. I didn't see it, unsurprisingly! Now I know where it is. Glad you like my glasses. Did you still want a universal timer board (green)? Email me!

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

    Ralph, take a little bit of advice from an old MSEE. Rest, and tend to your eyesight. It’s important. I read your blog, and this is nothing to mess about with. (Sorry for ending that sentence with a preposition.)
    I value your videos, and I’m still waiting for the one hour video where you build a GPS disciplined clock using an Arduino Uno, and explain the software build as well.
    But, I would like your eyesight back firing on all 24 cylinders again. So take some time, mend and stay optimistic. We all are rooting for you, believe me.
    Great video. Good advice, and I like the way you set the reference voltage and can shut it down when you need low current mode. Excellent!!

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

      Thank you for your concern and wise words. As it happens I might just do a couple of videos a month for the next month - we'll see how it goes.
      Were you serious about the GPS clock? We've covered using GPS in a past video #70. Grabbing the time from that and displaying it any way you want is easy enough - 7-segment LED, 64-LED moving LED matrix... whatever! I don't think you were serious! But correct me if I am wrong.
      Thanks for posting, very good to hear from you.

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

      Ralph S Bacon You are most welcome! I expect to continue learning from you for many more years. So take care of those eyes! I know you will, but don’t become discouraged!
      So the GPS disciplined clock...
      Personally, I think it would be a great project for all your viewers. An ATMega 328P-PU, a GPS receiver/with built in antenna, and an e-Bay Maxium DS 3231 RTC clock module with battery backup, and a display, color LCD or the like. THEN create a PCB and give everyone the gerber and drill files to have it made by JCBPCB and have it built themselves.
      The GPS will be on the job all 24 hours, but every hour, the software sends that hourly update to the RTC clock module, and the LCD display. Use a dip switch that tells the software what time zone you’re in and then the software displays the precise time and date. In the time between updates, the software just uses the RTC DS3231 and keeps the display updated every second. It won’t drift much during the hour.
      Now for the fun part: split it up over 6-8 months. I know you can do it in your sleep. But for us out here, learning this hardware and software, watching you and building the clock... it is really a great learning tool. Spread it out over time and set a deadline. Finish by 1st week of November, say. Then you can actually teach the hardware build and the software build.
      And break it up with some other projects like the Tiny85 or 15 projects also. I find them absolutely fantastic. And show more AVR programming, or another project you fancy.
      Nothing that would hamper your healing though. Sounds complex, but, in small bites, I think it would be stellar. Just an idea.
      Be safe and take care of yourself!!

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

    Great video as always, I can think of many applications for this idea. Please take good care of your eye, I wish you a speedy and full recovery!

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

      Thanks, Bora, always good to hear from you.

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

    Glad you're getting better. Your video has just stopped me making a mistake on the bord that I am working on . I had 1 mosfet now I see where I have gone wrong. Thanks.

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

      Interesting, Michael, that you're only using 1 MOSFET. In some circumstances just using the P-Channel should work (though not in the original Auto Switch-Off configuration from video #123). The item I was showing was the dual MOSFET but I have others ready to show once I can see to solder them onto DIP boards! The takeaway from this video is that using the dual MOSFET approach is guaranteed to work!

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

    Great Festive Glasses and good to see the festive season being celebrated.
    If invented I would like to send you a couple of bionic eyes with optics that focus between 1mm and one mile, just have to invent them now.
    Fantastic vid and thanks for sharing.
    Happy Christmas and a Happy New Year.
    👍👍👍👍👍

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

      I've applied on your behalf for a patent for those bionic eyes. Just let me now when you have a completed set and we'll complete the paperwork!!! I wish! The consultant told me he couldn't see the back of my eye clearly now because of the cataract introduced by the gas bubble in my eye. It just gets better by the day! Not! But at least I put out a video! Thanks for your kind wishes, and happy you liked my festive sunglasses, great to hear from you.

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

    Interesting vid. Glad you're getting back into the groove! Look after yourself.

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

      Glad you liked it, although it wasn't really groovy! I will certainly (try and) look after myself. Thanks for posting.

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

    Great to see you back Ralph! Don't stress about putting videos on every week. I for one have to keep watching your older videos over and over, as I build various projects. As others have said look after your health first. Good on ya mate!!

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

      So it's you, Jimbo, increasing my viewing statistics, single-handedly! I'm glad they are that useful! don't worry, I'm looking after my eyes, just waiting for my sight to come back in that right eye!

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

      @@RalphBacon It's only fair Ralph, as I have gained so much from them and your posts on GitHub. Have a great Christmas to you and yours, and to all of our fellow enthusiasts.

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

    Good to see you safe and well again.

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

      Yes, but I'm not at the end of the tunnel quite yet, Ken, but fingers crossed. Thank you for your kind wishes.

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

    Welcome back strong as ever with a new interesting project.
    Love your glasses, though I believe you can see them on for a very good reason.

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

      The festive (sun) glasses dim the glare of the monitors and my video lights so they help me quite a bit. Glad you liked the project, thanks for posting.

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

    cool and interesting stuff i like the in-depth approach you do too..top stuff

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

      Glad you liked it!

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

    Glad to see you back up and exercising my old grey cells again.

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

      And it exercised my brain cells too, making this very disjointed video, as I had to stop often. But it can only get better!

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

    Hi Ralph, good to have you back.
    As an aside to the fet on /off control, have a look at the dedicated LTC2954. Now an Analog Devices part in the same package as the dual fet although you still need a seperate P channel fet. Operates over a wide voltage range and low supply current of 6 micro amps.

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

      Great information, IVo, I shall Google it immediately I've responded to comments here, thanks for the heads up. I lied! I looked immediately, Very interesting.
      www.analog.com/media/en/technical-documentation/data-sheets/2954fb.pdf

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

    Great to see you back Ralph. You were certainly missed here.
    I was just working on a PCB layout that uses the circuit from video #123 but modified a little. I'm using an NPN transistor instead of the N-channel MOSFET. The p-channel can be used on it's own to switch an input voltage on/off or can be used for auto-power off using the NPN. The pcb also has a 3.3v regulator to provide a 3.3v bus and a 5v bus along side an I2C bus. It also includes a header for an NRF24 module. The micro-controller is an Arduino Nano. I've used a dupont jumper to select whether the Nano is powered from the P-channel output or directly from 5v input. I used the separate NPN and P-channel because the cost of the SI4599 using the SMD assembly service is $2.74 USD each which I thought was crazy high and it's not in the 'basic' component selection for SMD assembly.

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

      Great to see you creating custom PCBs - and you have considered a lot of options, nice work, if I may say so. The assembly cost for "non-basic" components is indeed quite high. I think I would have soldered that component myself but I can understand why you would not want to. Yes, the BJT would work in place of the N-channel MOSFET, just not quite as convenient, but it's marginal. Thanks for your good wishes, and thanks for posting.

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

    Ralph, you rock! Take care of yourself is Job #1. Get well soon

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

      Thank you and I will! Nice to hear from you.

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

    Best wishes and hope you recover!

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

      Thanks, Bollie! Fingers crossed!

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

    To use your opening line “and welcome back!”. Glad to see you back after your surgery. I hope all is going well. As one of my wife’s aunt said when you get to our age it’s patch, patch, patch.

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

      She is correct! I have umpteen pairs of glasses all with a patch on the right eye. No pirate jokes please.

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

    I have used those little meters a LOT over the years, keeps track of the voltage on my home built spotlight and such.

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

      Now that I've discovered the adjustment pot on the back (miniscule) I like them even more!

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

    I don't have much time lately for my hobby, but I make time for your work, glad your on the mend (couldn't take much more of the glasses !) great vid and love these little voltmeters haven't seen them before, and your right, a good idea to have a couple lying around...cheers and merry christmas to you and your family.

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

      I'm flattered by your loyalty, Andy, thank you for sticking with me! As others have mentioned there is a TINY (I mean MINUTE) variable resistor on the back of the LED display to make it more accurate, I didn't spot it with my eyes until I used the USB microscope.

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

      @@RalphBacon Oh!..I forgot to mention how cool it is to have you vids laid out as they are, they can now be used as reference, info at a glance, it brings it home to me just how much stuff you have, a veritable gold mine of tutorials..well done to you and the gentleman who made the list.

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

      You're referring to Mike Vogel, from down under (well, he is unless you're from down there too). He does a great job. I use the list all the time now to find old videos! Far quicker than scrolling through TH-cam pages!

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

    Glad you are back, Ralph......but hope you are completely fixed and recovered soon!

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

      It will take a while before I can be truly fixed but thank you for your good wishes!

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

    Glad your back and feeling a bit better, oh yes good video

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

      Glad you liked it Keith, and yes it's good to be back too!

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

    And welcome back Ralph!
    Couple of comments.
    1) Why did you use a dual mosfet IC to switch off the current through the resistors I use just one N Channel on the low side on my current project?
    2)Also a tip for getting the voltage divide accurate as I played around for some time using offset factors to make it accurate but all really needed to do was measure the actual resistance of the two resistors and use that instead and it was bang on correct after that, for example the 5.1k resistor was actually 5010ohms.
    Great to have you back mate but the glasses have to go it looked like Christmas at Elton Johns house ;)

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

      Thanks Andrew!
      Sorry about the glasses but next week it's either Wizard or Danny La Rue!
      Now, I used the dual MOSFET approach for two reasons:
      1) we had used that circuit (sort of) in the Auto Switch Off video #123 and I felt it was a good opportunity to reinforce that circuit (even if viewers don't use it as shown here)
      2) I had that nice dual MOSFET chip/breakout board hanging around like a bad smell and now was the time I could show everyone how easy it was to use and then put it in my component drawer, off my workbench! I also mentioned some others I have with a 1.8v gate voltage - for future use.
      In future I think I must emphasise the fact that the things I show in my videos are mostly demos to highlight a particular feature or component or code example (or all three). As an example, my toothbrush timer project (now used every day, it's great BTW) would never normally be used with a 74HC165 Shift Register and DIP switches! But it was a great opportunity (I thought) to show a way of reading DIP switch values very easily for whatever project might need flexibility like that. Better than a rather sterile breadboard and no practical application, however weird that application I'm using it for appears to be! Right, now I'm off to buy a new electric toothbrush that doesn't even need a separate toothbrush timer!
      I'm explaining all this here, not for you Andrew, but for everyone else who might read it and realise why some of the "solutions" to my projects are a little over-engineered. I'm obviously being too subtle about it, ha ha!

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

    Welcome back Ralph, another informative video. I hope you make 100% recovery and I hope it is soon. We take many things for granted until they go wrong. All the very best for Christmas to you and your clan. Greg

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

      Wow! Two comments from you, Greg, that great, keeping up my stats with TH-cam, always appreciated! Seriously, I am grateful for all the good wishes from everyone, including you of course.

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

    Good to see you back. Please take care of your health.
    The voltage divider can be switched on/off way easier than you did. Have a look at the battery sensors of mysensors.org.
    They connect the gnd of the voltage divider to a pin of atmega. When output of this pin is set to zero, the voltage divider does its work. When the pin is set to input -without pull up/pull down resistor, the pin just floats. Then there is no voltage drop over the voltage divider. So no power loss.

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

      Yes, that is an alternative way of doing it, Psilin, and we've used that method when switching on actual devices to save power. But I was just experimenting with those dual MOSFET devices in the hope others can see further uses (eg auto switch-off). All good, thanks for the simpler method.

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

    Welcome back and nice to hear your pleasant voice here again.

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

      I'm very happy you think I have a pleasant voice, Sgt Bond! And I'm glad to be back too, thanks for posting.

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

    Glad to see you're feeling better.

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

      Thanks, Lee, it's a waiting game now!

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

    Hey there Ralph love the glasses. I can just hear the Dad-jokes about them, lol. I feel like you made this video for my benefit and it is on the money for my mobility Scooter control board. I had not thought about switching the current through the voltage divider but a lot easier than doing it in code. I will also be getting a few of the SI4599's, much cheaper that buying the mosfets (everything is more expensive here).
    As you know I spent a lot of time messing getting multiple voltage dividers working to monitor the 24v battery and if the charger had been connected. I used a Zener diode in reverse bios to clamp the voltage going to the Arduino to 5v max regardless of fluctuations from the battery/supply. This worked very well.
    Take care brother.

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

      If you watched the next video, Adrian, you will have been even more impressed I am sure. Not with the video, but with the additional Xmas decorations!

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

    Welcome back Ralph, glad you have recovered sufficient to be able to entertain and teach us again :-).

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

      I think the glasses were more than enough entertainment, for sure, Ole! Glad you liked the video!

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

    On the three wire usage of the Volt meter: that's needed when trying to detect V 4V? Then you can use the two-wire configuration just as well.

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

      That's true, Eric-Jan, the diagram does show that although my one works right down to 2.0V (slightly dim, but useable). And it goes right up to 100V. Oh, and as others have reminded me, it DOES have an adjustment on the back too.

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

    Hi Ralph. Sorry hear your eye is not yet up to snuff. You have my total sympathies since a year ago at my last annual diabetic ophthalmic exam I was told that there were signs of macular degeneration, but at that time I was experiencing no visible symptoms at all. Wind on about 7 months and suddenly, literally overnight, I'd lost all vision, other than colour, vague shapes and sort of outlines in my left eye!! Turns out I have had quite a severe bleed from capillary veins in that eye, probably from a blocked vein.
    Roll on a few months, multiple waits for appointments, multiple eye scans and finally treatment by way of an injection into the eye which took almost immediate effect, as the next day vision had improved markedly. It's still blurred but with a much greater level of detail, thank goodness. I have this year's exam tomorrow and another appointment for a further injection early next year so here's hoping for further improvement. Now at least I can ALMOST read my keyboard which previously was just a dark rectangle!
    Likewise I hope your eye/s get sorted fully ASAP since even though I have just one reasonable eye I have been trying to do some relatively ordinary soldering (repairs) and have been struggling significantly without stereoscopic vision. So when I say you have my sympathies, you know I mean it. Not a nice thing for anyone to have or endure but especially when doing what you love relies on good if not excellent eyesight. Good luck and best wishes for Christmas and the New Year!

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

      Ouch, now you really have got me cringing in empathy, Bob. I'm so glad you've said it is getting better, we understand each other's condition and what it means only too well. I hope your eye continues to improve with further medication. As I've said before, next year 2020 is also the result we will both get from our eyesight tests, right? 20/20 vision. Fingers crossed.
      Stereoscopic vision is so essential to carrying out everyday tasks, I've found. Even making a cup of tea can mean I miss the cup with the hot water entirely. As for putting in Dupont cables into a breadboard, well, that brings a whole new level of frustration as I miss the hole, time after time. I tried to solder but ended up sticking the hot soldering iron into my hand rather than onto the PCB so I've given up for now.
      It can only get better with us both, right, Bob? Great to hear from you (well, sort of, you know what I mean) I hope you have a great Xmas and a good start to the New Year. 20/20. Don't forget your eye test!

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

    Looking good Ralph.

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

      "As always", I think you forgot to mention, Ane. Not to forget "youthful", "intelligent" and let's not forget "humble", "modest" and "self-deprecating". Oh. I see how that doesn't work now. Drat! Thanks for posting!

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

    Love your videos, but I was worried about sparks at 12:50 between the bare alligator clips when you moved the wires. LOL

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

      That was done just to keep you tuned in, David! Keeps my audience interested to see if I am going to survive the episode!

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

    Hi, I make a similar device with the 1.1 volt internal référence build in the Att328 and two resistors 75k/24k. Thank for the interrupting device with 2 fets. It's à very good idea. Xmas and bye from France

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

      Glad you liked it Rene, from France. So you are using the internal 1v1 as your reference for the analog input? How does that work? Surely the 1v1 is too low to compare against?

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

      @@RalphBacon I use it for read the voltage of a alcaline battery Ni-mh and Li-ion cell. I make a little device for evaluate the internal resistor for these bat.You can have my code and schematic on github.com/kotec-le-raleur/Resistance_interne.
      It's just a little project , but it work for me and I can dispatch my cells between bad or good. Sorry for my poor syntax !

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

    Very interesting video, thank you for sharing. I found your circuit diagrams for the two transistors, can you share the diagram for using the Si4599?

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

      I've added this to my GitHub repository for this video:
      github.com/RalphBacon/171-Monitor-Your-Battery
      Go to the "images" folder and find the file "LiPO Monitor Circuit.JPG", which is a rather shaky, hand drawn circuit diagram and shows how the Si4599 fits in.

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

      Thanks Ralph!

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

    Welcome bk sir.very informative video

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

      Glad you liked it Muhammad! Nice to hear from you again.

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

    Have you already made (or considered making) a custom board which combines the battery voltage check and a full power disconnect as a little breakout board. Maybe also include battery protection (tp4056+dw01 + FET) as not all batteries have protection and possible load sharing so battery can complete its charge?
    Think this could be desirable and an interesting challenge/video?
    Happy new year Ralph!

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

      Well, my outdoor storage container (bin lids) project uses an 18650 battery and sends the battery voltage to me here in the workshop along with the lid status. When the lid closes it switches off the circuit completely, see videos #221, #214 which describes this project (I think).

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

      @@RalphBacon thanks very much will take a look!
      My festive break has involved watching many of your videos, keep it up!

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

    Good day, Ralph! I'm glad to realise you're back online. This is GREAT !!
    I'm sure you'll excuse my behaviour as I laughed when I first saw you with those glasses. LOL! I do fully understand you wearing those, however. Better take it slowly.
    Thank you for that very instructive video and I hope you will recover 100% of that vision .. age considering, of course. Health first !!
    When I built my Weather Station, I figured out another way to measure the battery voltage, since I included a battery monitor in my project. I'll write to you this weekend and we'll talk about that.
    Have a nice weekend, my Friend. Take care and God bless!

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

      Thank you , Daniel, for your warm Welcome Back - hang on where have I heard that before? Always look forward to your missives, speak to you soon!

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

    Hello Ralph, glad to see you back at the bench. What you said about Li-po is correct, but 18650's are Li-on and can be run down to 2.5v before they are damaged. Using the 3.3v ref for comparison against battery voltage would be perfectly safe.

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

      What people call Li-po and Li-ion are the same thing just in a different form factor and built for different applications.

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

      @@superdau and with different chemistries. Therefore not "the same thing" at all.

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

      @@Tsnafu
      The chemistry has nothing to do with the form factor. They can have different chemistry, but so can cylindrical cells between them and pouch cells between them. Again, the form factor is not what dictates the chemistry, what the manufacturer puts in them is. You can have the same chemistry in either form factor. Have you ever seen something like IMR, INR, ICR, IFR, LMO, NMC, NCA, NCO, LCO or LFP written on cylindrical cells or in their datasheet? Those signify different chemistries. Pouch cells use the same chemistries, although they most often use the Lithium-cobalt-oxide chemistry (ICR/LCO), which is also the same that's often used in laptop battery 18650 cells. So they *are* the same thing.
      My guess why "li-po" as a name for pouch cells came to be is marketing. Cylindrical cells were the norm when the somewhat "freeform" pouch cells came along. Someone heard about the "new" cell chemistry of real li-po batteries at the same time and slapped that label on their batteries, because, hey, they got a polymer sheet separator in there (as all of those cells, even the cylindrical ones, had anyway) and a polymer (=plastic) pouch around it, even when that has got nothing to to with actual li-po cells. Lipos true to the original meaning of the name (the electrolyte itself being a solid polymer) still don't exist commercially. And even if they should ever exist, they will still be li-ion cells.

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

      The protection circuit on my Li-Ion cells (like the on in the video) does kick in pretty much at 3.0 ±0.1v. Perhaps it is being very cautious? I misspoke when I said LiPOl I just tend to use that term for all rechargeable batteries, LiPO, Li-Ion, half the time we don't know what type it is!

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

      Update: Jessica says her Li-Ion cylindrical battery cuts off at 2.5V so maybe my one is super cautious?

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

    Glad you're back

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

      Thanks, Dave, thanks for posting.

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

    God to see you back here

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

      Thanks, Wegi, it's nice to be back! Thanks for posting, nice to hear from you.

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

    Hello Ralph. I'm using a buck/boost regulator powered by 3 1.5 AA batteries to provide Vcc=3.3V to my ATMega328 with fuses burned for 8MHz internal clock mode. I just want to detect when the 3 battery levels are < 3.0 V according to the regulator minimum Voltage spec. Seems to me, all I need to do is read pin A0 connected to the batteries via a voltage divider R1/(R1+R2)=.6875, and calculate Vbats=4.8*readval/1023 (where 4.8 is max. voltage of the 3 bats.) so that I know when it's time to change them. Do you agree? Thanks.

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

      Not to simple, Bill. The analog ports will ALWAYS read 1023 if connected to the VCC line as the VCC value is fixed, whether +5v or 3.2v. So the analog ports compare to the VCC value, understood?
      You need to compare the incoming voltage to the fixed internal reference voltage (1v1) on which I have done a couple of videos: #160, #171 which do the trick nicely. I'm using that technique right now monitoring my batteries in a project (all three). Works like a dream.

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

      @@RalphBacon Hi Ralph. I'm using 3 AA batteries to power a buck boost converter. The Arduino VCC line is coming from the buck boost converter output (always 3.3V or 0 if battery is dead). The analog port is connected directly to the battery output (I had to use a resistive divider 'cuz fully charged batteries provides 4.5V).

  • @johnrees44..G4EIJ
    @johnrees44..G4EIJ 4 ปีที่แล้ว

    Hi Ralph, again..A quick question for you...Re: The Lipo holder/charger/psu...Does it charge via the USB socket, and, Does it continue to output 5V while it's charging?..Thanks...John..Bristol

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

      You're referring to the 18650 holder that outputs 5v (and 3V3) and also via the USB socket, right, John? Yes, whilst charging (the LED is red) it still outputs power. The LED goes green when fully charged. You charge it not via the full-sized USB socket (that is output only, and controlled via a small on-off switch). The charging micro USB is on the main board, marked 'power' or something like that. To be honest, I just pop in another fully charged LiPO and charge that in a purpose-built, commerical charger rather than using this device, but that's just my preference!

    • @johnrees44..G4EIJ
      @johnrees44..G4EIJ 4 ปีที่แล้ว

      Ralph S Bacon ..Many thanks for fast response again, Ralph... That's exactly what I wanted to know..Thank you..Looking at Bangood, the Lipo they advertise has a micro USB in it...Does that one work in the charger module ok?..J

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

      The micro USB is the charging port on mine - works fine!

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

    I ordered some of those two mosfet on a board chips some time ago. What with this damn virus thing, it took so damn long to get here that I plum forgot what I wanted them for. So I have been going back and reviewing videos from around that time and I found this one. Perhaps this is the one that sold me on them however I haven't figured out what I was going to do with them in the first place, except perhaps to play with them. Guess I am just a kid at heart even though I will be 69 years old in two weeks.

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

      That's happened to me many times. In fact, even now I'm still waiting on stuff I've ordered several weeks ago and have lost interest in the item! Usually, it was free delivery to the UK, and quick too. Now it's not free and not quick.

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

    You are looking great!

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

      You ain't seen nothing yet, Ernst! The Christmas season is upon us!

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

    I wonder if a portion of a 4007 IC could be useful in terms of providing a couple of complementary FETs...?

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

      Sounds possible but the only way to find out is to actually do it. Remember that the chips inside a CD4007 will be fairly low current. I probably have one of those chips lying around, I will put the idea on my list!

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

    Good to see you back. Even if I did think I'd tuned in to Elton John. ;)

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

      They were a bit Elton, weren't they, ca. 1975 during his Glam Rock phase (that never quite ended). Just a bit of fun with a serious side inasmuch they helped me avoid the glare of the video lights and monitors.

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

      I thought the same, a weird "Elton John" version from the 70's! Ralph, I'm glad all went well with the surgery!!!

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

    Is there a difference when using this on an esp32/esp8266 with the voltage source being 3.3~ ? Do I use different values for the resistors?

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

      Calculate the resistors so that the monitored voltage does not exceed your ESP32's VCC and is around that 95% of that value (otherwise you will always read 1023 on a 10-bit analog input).

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

      @@RalphBacon thanks for replying kind sir. Another question but out of topic. When using a dc-dc buck converter with the source being a battery, when the battery level goes low, does the voltage output from the buck converter also goes low?

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

    Welcome back Ralph.

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

      Cheers, Phil, you stole my intro catchphrase though!

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

    Good to see you back Ralph! (No pun intended)
    Quick question.....if you only use an input source of 5v or less do you really need the voltage divider and an external 3.3 ARef? Couldn't you just hook up the battery+ to A0 and monitor analogRead() to a specific level, say a value of 700 for 3.4v? (0.0049V / count).
    Without any resistors drawing power could you then omit the switching too?
    Just thinking out loud.

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

      use a 10k in series with A0 if it is a 5volt arduino. Use a 10k in series with A0 and a 10k from A0 to GND if your arduino is 3.3volts. the above is only if the battery voltage is 5 volts use a larger resistor (15k or 20k) in series with A0 and 10k to GND. just for info 5 volts / 1024 = 4.88 mV.

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

      i always like to use a clean noise free source for my ADC's Ref. when the battery is getting low the DC_DC converter might start getting more noise on its output. what's the cost of a few extra resistors and a fet or so. if you want to make it more accurate then your into ref, resistor temp coefficients and drift over time, getting a known reading now does not mean that in a years time it will read the same.

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

      It is another method

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

      If your supply is FIXED at 5v (and doesn't run down as the battery gets flat) then you can do it your way. Just remember that the AREF by DEFAULT compares against VCC (whatever that is) so 3.3v compared against 5v (DEFAULT analog ref) is about 675 on the analog port, but 689 against 4.9v. But if the VCC drops to 3.5v then A0 will report 965 for 3.3v! So you can see the importance of a stable VCC reference (which is what the 3v3 output from the Arduino's voltage regulator gives us).

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

      I hear you but doesn't that buck/boost module maintain a FIXED output voltage? Its written in the description as being **FIXED OUTPUT**....so the AREF will be compared to a fixed VCC regardless of the battery voltage....no?
      Not trying to be awkward but I know you don't do something without good reason and yes, for an 'unregulated' supply the whole resistor divider/external Aref makes perfect sense.

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

    It's good to see you back Ralph. I am making a 5 volt pack and I am using vcc as a reference (internally) so I dont need to use a voltage divider to measure cell voltage. But in your case could you connect the bottom of the voltage divider to a pin and make it high Z when not measuring and low when you are measuring ? I am using an ATTiny85 (thanks to your videos). I have a LED and a push btn switch. When the switch is pushed the Tiny reads the voltage and blinks the led to let me know what the voltage is to two decimal places so I know when to charge it.

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

      " could you connect the bottom of the voltage divider to a pin" Where would the junction be connected to?

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

      "I have a LED and a push btn switch." Why not periodically check....no need for a switch

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

      @@kennmossman8701 The junction goes to the ADC like usual. Instead of connecting the bottom of the divider to ground connect to another pin. Make the pin low (close to ground) then make the measurement.

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

      @@kennmossman8701 Because then its blinking the led when I don't need to know the batt. voltage. That uses more power.

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

      @@noweare1 say what? in pseudo code"
      if delta elapsed time > a minute or such
      if battery voltage is low
      blink LED

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

    Hi Ralph. How would i measure the voltage of evey single cell in a 7s battery? I can inly use ground once. I could measure the difference every step up in the stringi voltage using voltage deviders but i worry 7 different voltage dividers introduce lots of errors or devintions in the results i wonder if tgere is a better way?

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

      Hmm... you might be able to use an ADS115 Analog to Digital converter for each of the battery cells. That way, each cell is measured accurately. Have a look at video #104 and see whether that helps at all.

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

      I believe that some ADC modules have more than one channel, seem to remember one with 4 channels. 2 ADC modules might be able to monitor your 7 cells, guessing that you access each channel sequentially in code.

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

    why switch high side and use both types of mosfets? ADC input is high-Z anyway, right? So just use n-ch mosfet and switch resistor divider's ground.

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

      I'm assuming you mean connect the Drain from the N-channel to the LiPO +ve, the Gate to the GPIO pin, the Source via two resistors to GND with the junction of the resistors going to A0? Normally the Source of an N-channel needs to go to ground to work properly (including getting the Gate voltage +5v above Source voltage). Have you tried this? It _might_ work but I haven't tested this.

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

      @@RalphBacon No, what you are describing is called high side switching. It won't work without bootstrap gate driver. But if you move voltage divider between +Ve and Drain, while connecting source directly to -Ve, it should work. The only limitation would be voltage of battery pack should not exceed input voltage of ADC pin, which should be fine in your case with 5V MCU and 1S LiPo.
      See schematic:
      i.imgur.com/gjRssCb.jpg
      Edit: Hell, you could connect 1S Li directly to 5V MCU, and there would be no need to waste power on divider at all. If your battery pack voltage exceeds input voltage of MCU, then your circuit makes sense.
      Or even better add a simple zener:
      i.imgur.com/l0rDmwU.jpg

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

      Yes, the zener would be required if the voltage was above 5.5V otherwise you are presenting more than that (potentially) to the A0 pin (eg car battery, drone battery). Zeners are not Schmidt triggers though, they can start conducting quite early on in the voltage range, trial and error may be required! Thanks for clarifying.

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

    Ralph, Instead of switching the high side of the resistor divider with mosfets, how about switching the low side (GND) using an arduino port? Instead of connecting the low side of the voltage divider to ground, connnect it to an arduino digital pin. Then, in code: pinMode( VMgnd,OUTPUT); digitalWrite(VMgnd,LOW); would turn the voltmeter on. digitalWrite(VMgnd,HIGH); would turn the voltmeter off. Or, the pin could be tri-stated by setting pinmode INPUT, which would provide a high-impedance connection, effectively turning the voltmeter off. This seems simpler than all those mosfets.

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

      Switching the low side never works well, John. That's because the ground reference changes and upsets the entire electronic circuit. Try it if you want (and, who knows, maybe it will work for you) but I'll stick to high side switching.

  •  4 ปีที่แล้ว

    Can you share the link for the other MOSFET?
    If you only use one MOSFET will not be enough?

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

      Did you mean the other video, Auto Switch off, Luis? That used two discrete MOSFETS because we were switching potentially higher power. Have a look at video #123: th-cam.com/video/g1rbIG2BO0U/w-d-xo.html
      In THIS example we might have got away with one MOSFET (or even a BJT if it comes to that) by powering the MOSFET, or just the resistor divider, with output from an GPIO pin) but I was trying to adapt the auto switch off circuit but this time using a tiny IC. Food for thought!

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

    Hi mr. Ralph, Is possible make a video where you go in more depth and show how this is setup? I've tried but not able to get it to work. I need a way to measure battery voltage on 3.3v battery operated sensor.

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

      It depends, Stig, on whether you are running on a 3v3 battery (perhaps 2 AA batteries?) or whether the battery goes through a buck/boost converter before getting to your Arduino. Is the sensor close to the Arduino or remote? Let me know your setup.

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

      @@RalphBacon You know what, I just realized that I had forgot to put in 100K resistors like in your schematics so it works now :-) My plan is to make a wireless weather sensor using ATTiny84 with a weather sensor, a 433Mhz transmitter and a voltage divider. My thinking is to run all this from a CR2032. My thinking is to have the ATTiny sleep every 30 min, then wake up, turn on the sensor and read, connect the voltage divider and read voltage, turn on transmitter and send (haven't found out yet if sleep mode is supported) and then go back to sleep. All this data will be sent to an ESP32 with a small display and to the cloud so that I can integrate with Google Home and maybe even create an app. aconfluence.no/display/SS/Google+Assistant+based+weather+station
      I'm not very good at this but it's a nice project and I learn a lot. Thank you so much for your help and inspiration :-)

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

      I'm very glad you got it working. Just one point on the "waking up every 30 minutes". The maximum time an AVR chip will sleep is 8 seconds before being woking by the WDT. You can, of course, check a counter, increment it if it is not time yet to wake up, and go straight back to sleep. This means your Tiny44 will wake up about 225 times to increment that counter before deciding to do some real work. Still very power efficient. Or use an external interrupt - the question is, what?
      Watch my videos on this topic, #115 and #116.

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

      @@RalphBacon I watched the videos and it's exactly what I need. Just one note to the schematic, I needed a 1000 ohm resistor between P Channel Drain and ground before AO was able to measure correct voltage, with out, my oscilloscope showed just a few mv change between high and low. Is this correct?

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

    Nice one

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

      Thanks Yogesh, nice to hear from you!

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

    Ralph! It's a good job you are not a fly!! Only two to fix!

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

      "ONLY" two you say, Jon? MY left eye is cloudy, misty and slightly out of focus. My left eye is a sloshing glass of water through which I can see nothing much. If I were a fly I would go nuts! But the hope is that all this can be fixed in due course, so roll on summer 2020 (which will also describe my eyesight at that time).

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

    I am surprised how you're getting that Serial Monitor Output, as you are Currently connected to External Battery to power up Arduino right ?.
    Or Are you connected to computer USB port for Arduino to Power up ?
    Then, what the External battery is doing just for Voltage divider ?☺️

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

      I'm pretty sure I was running this on a battery to monitor its voltage with the potential divider. Remember it uses the internal AREF fixed voltage reference. Although this video is now well over a year old I remember that I was surprised at how easy it was to do this (but don't connect AREF to 3v3 until the sketch is loaded or the magic smoke will appear).

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

      @@RalphBacon Thanks Ralph for the Reply.
      I tried this with Sleep function and it works perfectly fine Thanks.
      What i was confused initially and asked you the question was
      how you connected External Battery to power up Arduino and connected Computer USB at the same time.?
      Since you got that Serial Output in ur computer Monitor..right?
      as you must have connected it through a computer USB.So, then Arduino will also automatically draw Power from.USB and not from Battery right ?.
      Since it was not clear, i connected a OLED to display the Battery Voltage. Thanks 👍

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

      No, I have a separate FTDI USB-to-Serial to connect to the Arduino (for the serial monitor output) but I do not connect the +5v, just RX (goes to TX on Arduino) and GND.

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

    WELCOME BACK 😀

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

      Ha ha! Cheeky, Mark, but most appreciated!

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

    more easily you can switch off the voltage divider by just connecting the lower side of the voltage divider to an IO pin. Switching this pin to an output and outputting a 0 will switch the GPIO to ground and thus also the lower side of the voltage divider. Switching the IO pin as input without pull-up will leave the voltage divider floating and no current will flow.
    The series resistance of the output pin is less than 100 ohm and negligible compared to the tolerance of the resistors in your divider.
    Alternatively it is also enough to just have a single NPN or n-channel MOSFET at the foot of the voltage divider to switch it off.
    This works reliably as long as the voltage you want to measure is lower than the supply voltage of the microcontroller, because otherwise you might get a leakage current into the protection diodes.
    You can also easily scale up the two resistors in your voltage divider by a factor of 10 and then you should be able to leave it on.

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

      Indeed, Uwe, that would be a very good way to approach this problem and probably similar to how I might do it in the future. I wonder how high the resistors can go with the analog input still being able to reliably read the voltage? If we got the current through the resistors down to a couple of microamps then, as you say, just leave it wired up!

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

      @@RalphBacon I did some tests before a student lab 2 years ago and was surprised. In the lab I let the students measure the discharge of a capacitor with an Arduino nano. The interesting fact is that a discharge resistor of 100 Mohm parallel with the input and capacitor is not yet significantly affected by the internal resistance of the Ain-pin - so I must assume that the analog inputs of the ATmega have a resistance in the order of 10 Gohm!

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

      Actually, if you connect the lower end to an IO pin and set it to input-no-pullup, the middle of the "divider" will suddenly rise to the full supply voltage, potentially killing the Arduino. Granted, it's a very small current, but still.
      I suggest simply using bigger resistors (~10MΩ) and leaving it connected.
      In addition, you can dispense with the AREF connection and simply instruct the chip to use its internal 1.1V reference. Choose a resistive divider that produces voltages between 0V and 1.1V, and go from there.

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

      @@SodAlmighty as I wrote: "This works reliably as long as the voltage you want to measure is lower than the supply voltage of the microcontroller, because otherwise you might get a leakage current into the protection diodes."

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

    Yayyyys!!!! He is back!!!!

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

      I'm very pleased to have such enthusiasm, Michael, it warms the cockles of my Christmas heart!

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

    welcome back

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

      Thanks, Elie, nice to hear from you again.

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

    I the ad part for pcbway, you mix up the bit about supplying some or all of the parts.

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

      Drat! I only noticed that right at the end. But no-one has mentioned it, so if we keep it quiet I think I might have got away with it, Andy!

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

      @@RalphBacon my lips are sealed.

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

    I see a lot of comments here stating that you don't need a voltage divider since the battery is less than 5v.
    this is false.
    wall of rambly text incoming, I tend to write the same way I think...not always easy to follow
    the ATMEGA 328p (I'll just call it the chip from here on, it's easier) has protection diodes for all its inputs, including the analog ones
    that means you can power the chip from any single pin until that protection diode fails
    so you find yourself thinking the chip is unpowered and not working, and the feed from a data line is powering it so it is running normally
    I should point out that these particular diodes are not designed to power the chip, only to protect the pin from overvoltage...
    so you toss a voltage divider in and it limits the current to a few nanoamps, problem solved, the chip powers only from the main rail, no risk to the internal diodes, all is well
    playing Schrodinger's cat with an Arduino is no fun...is it alive?

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

      as a bonus note: forum.arduino.cc/index.php?topic=102770.5;imode

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

      Yes, I did notice that, Jeff, I would always limit the current via a voltage divider in this sort of situation. And once we go above 5v it's required anyway. Thanks for posting, good to hear from you.

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

    Voltage divider isn't necessary if the maximum battery voltage is less than Vcc.
    The important lesson here is that one can switch sub-circuits off and on by microcontroller output.
    That's a lesson with which automotive manufacturers seem to be taking many years to learn as they add their products to the Internet of Toys. Because consumers love to come back home after a long vacation to find their car dead in the garage.

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

      the voltage divider is required as the ADC reference voltage is lower then the supply. Ralph connected it to the 3V3 regulator output as it should be more stable than the 5V.

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

      That's happened to me, Bernd. Car battery flat after 3 weeks. It must happen often because there was an AA (Automobile Association) assistance truck patrolling the car park giving free jump starts to motorists like me!
      Certainly for battery powered circuits switching off sub-circuits is imperative. I even do that in Benny cat run for the (mains powered) Rain Detector. It has stopped the corrosion on the sensor because it is now only switched on for two seconds twice a minute.

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

    You did make that more complicated than it have to be. With a 5V processor and

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

      I love all those discharge curves - I even have some of the exact batteries you have tested. I guess the "nominal" voltage is more an "average" voltage. At least you showed the voltages all dropping off the edge of a cliff though, at the end. But it seems we might catch it before that happens with the discharge curves you plotted. Very instructional, thanks for that.
      But I made it (slightly) more complicated one to allow for voltages greater than 5v (eg many drone batteries are higher voltages) and car batteries (or other, smaller lead-acid ones) are 12v of course. Not to be connected to the Arduino without a resistor divider (and now everyone knows the formula to calculate that too!).
      I did wonder if a P-Channel MOSFET with its gate brought LOW by an Arduino GPIO and the DRAIN brought to ground via a series resistor (connected to A0) would work reliably. You seem to indicate that would work OK?

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

      I test all the batteries I can get my hands on (LiIon, NiMH & Alkaline), this also means I publish a few battery reviews each week and have done that since 2012.
      The nominal voltage for LiIon is the average output voltage, sometimes (not often) you even see it specified with and extra digit like 3.62V instead of just 3.6V or 3.7V
      As long as battery voltage is below Arduino voltage and you do not turn the port output off (High-Z or remove power to processor), you can control it directly. If you remove power to the processor the FET will most likely be on.

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

      I think that was one of the issues that Jessica faced: the analog port remained on after switching off the Arduino and started then powering the whole thing in some weird way. I never knew there were so many batteries out there, you must be busy doing all this!

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

      Battery tests are mostly automatic, but they take nearly a week for each battery (A few is more), I have a couple of "Test stations" that I simply has to load with next battery. In addition I have to take some photos, do a minimal amount of writing, move some files and run a couple of scripts. It is not that much work, some of my other reviews requires much more work.

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

      @@henrikjensen3278 Have you found that the discharge curve is fairly linear over the useful range say 4.2 to 3.3 so that after 20 minutes or so you can extrapolate ? I have been charging then discharge and plotting the volt vs time at a constant current discharge using recycled batts and found I really didn't have to discharge all the way.

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

    Just read your blog Ralph, what a scary ordeal you have endured. Lets hope for light at the end of the tunnel.

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

      There's plenty of light at the end of the tunnel, it's just very, very blurry at the moment but the consultant said I should start seeing stuff again in a week or two, can't wait! Thanks for posting, Greg, always good to hear from you.

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

    So know we can call you pudding man

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

      Only for this week, Bob. Next week, well, wait and see!

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

    hi Ralph Sir, I have a small suggestion: you can add to the title of the video the IC name so anybody searches in google for: "si4599" can reach yours 👍😀🎅

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

      Great idea Ronen, I'll do that from now on.

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

    why use a voltage divider, since the UNO is 5V, so take the voltage directly from the battery. Save the, arguably small, drainage with the voltage divider, and the UNO will handle up to 5 volts no prob. You surely have a good reason, I am not sure what it is.

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

      It is another method

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

      Answered in your other post!

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

    @1m08s: OMG!! Your hand is so much larger than your head. ARGH!!!! ;-)!! Nice to see you; we hope that you're doing well.

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

      I have mutant hands, that's for sure. And a few other body parts but that would be telling! Glad to be up and (sort of) around, thanks for your kind words, JH.

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

    Those glasses :D

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

      You ain't seen nothing yet, Christian!

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

    Elton John has got nothing on you!

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

      Apart from the estimated $500million? 🤣

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

      @@RalphBacon Yeah, its so wrong, engineers should be the ones making that kinda scratch!

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

    Well come back, loose the glasses humbug ;-)

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

      Noooo! "Humbug, I say, Humbug. Down with Christmas." You can't mean that!?! The glasses are actually sunglasses (maybe for use in tropical, sunny climes?) and dim the glare of the monitors so they actually serve a purpose.

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

      My honest children did not approve your glasses. They were very acceptant as I explained your reason. But please don’t get attached to them :-)

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

      Wait until next week, they can score me like ice dancers, 4.9, 5.1 ... perfect 6.0?

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

    That's not a lipo? right?

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

      Same thing, just a different form factor.

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

      @@superdau I think they have different "chemistry"

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

      @@andymouse
      They can have different chemistry, but so can cylindrical cells between them and pouch cells between them. The form factor is not what dictates the chemistry, what the manufacturer puts in them is. You can have the same chemistry in either. Have you ever seen something like IMR, INR, ICR, IFR, LMO, NMC, NCA, NCO, LCO or LFP written on cylindrical cells or in their datasheet? Those signify different chemistries. Pouch cells use the same chemistries, although they most often use the Lithium-cobalt-oxide chemistry (ICR/LCO), which is also the same that's often used in laptop battery 18650 cells.

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

      @@superdau cheers!

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

      My bad. I tend to use the word LiPO to encompass Li-Ion and even rechargeable Ni-Mh and the such like. The cylinder battery is Li-Ion but the smaller (flat) ones I was experimenting with (from drones) are, apparently, true LiPO. Not sure of the exact difference apart from the chemicals inside.

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

    INA226

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

      The INA226 is more a current sensing device, Javier, I've used a mains voltage version previously to detect when the washing machine switches off. But they are not cheap (not even from Asian markets) about $5 each.
      If anyone wants to look, here's a link:
      www.banggood.com/CJMCU-226-INA226-Voltage-Current-Power-Monitor-Alarm-Module-36V-Bi-Directional-I2C-For-Arduino-p-1101401.html?p=FQ040729393382015118&

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

      I use the INA226 as a voltage sensor, 840k Ohm input impedance, infinite in standby mode, 36V max. and very accurate 16bits. I am just ordering 4 more at this moment. INA226 on ali is €1.20. I like it a lot!

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

      @@javierpallalorden I am with Ralph on that one I wouldn't use a dedicated IC and add an I2c library just to read a voltage. 16bits is way over the top for this purpose (low battery warning). It also draws a Quiescent current which can be as high as 300-400ua! A nice IC but I wouldn't use it here.

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

      @@andrewtoogood1429 True, I agree on that it wouldn't be a good idea to use it in this scenario (a resister divider is way cheaper and simpler, leaving out the mosfet switch....), but in general to measure a voltage on it's VBS pin with very high accuracy and high impedance......…..it is a very nice chip.

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

    how you even see throu this glasses xD

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

      They are sunglasses, it's true. But they help against the video lights.

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

    Worrying about the current drain of the voltage divider is like worrying about a prostitute's bad breath when having unprotected sex. The efficiency of the boost converter swamps the overall efficiency. While 95 to 98% efficient boost converters can be had, MOST use far cheaper and far less efficient boost converters. Read the datasheet charts, lads.

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

      I think the efficiency of the one I used is about 85%, Kenn. But as I said, we have to be sensible when trying to squeeze the last ounce of power from our batteries. It would be better to have the dual MOSFET switch on the LiPO-powered buck-boost device (OOPS! Li-Ion, I meant, of course) thus removing all current drain.

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

    30 minutes to say use a voltage divider and one of the analog inputs!

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

      30 minutes to describe an issue raised by a subscriber, show a dual MOSFET circuit previously used and now adapted to prevent battery drain via the potential divider, with a couple of bench experiments with some LED readouts (who doesn't love an LED display?). So, yes, 30 (rather disjointed) minutes to say all that. Too long, didn't watch? Shame.

  • @Abc-sl1nf
    @Abc-sl1nf ปีที่แล้ว

    The video would be more productive w out your picture in the video.

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

      Close one eye and I disappear. It's true. Try it.

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

    why use a voltage divider, since the UNO is 5V, so take the voltage directly from the battery. Save the, arguably small, drainage with the voltage divider, and the UNO will handle up to 5 volts no prob. You surely have a good reason, I am not sure what it is.

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

      ..because he wants to set a simple trigger point at 3.68 V or so.... probably doing a simple compare to the reference voltage on A0?

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

      @@whitefields5595 Good point, shorten the range that the ADC on the UNO needs to read, gives more accuracy. instead of 4.2-3.3/1023, one gets 3.4-3.3/1023. But is this accuracy needed? approx. 1 volt (4.2-3.3) divided by 1023 gives less than 1 mV, while the aim is to monitor 100mV range, hmmm.

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

      @@ElieWar Well, if he didn't do it, folks like me and you would tell him he should have done! He probably does not want a true measure, but a comparator. If < 3.8V then do something. Go/No Go gauges are often more accurate and reliable than absolute measuring tools, especially if you have foreshortened the range in the first place

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

      It is another method.

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

      Others have probably explained this, Elie but the whole point of NOT using the 5v supply when running off a buck-boost device is that the voltage is not (particularly) stable. Maybe your voltage starts dropping a bit as the battery gets discharged. Using the stable, voltage-regulated 3v3 pin means this will remain steady regardless of the VCC voltage. On custom boards I would use a simple 3v3 zener diode. I should also state that if the VCC voltage changes then the AREF is going to compare against a changing voltage - thus making it inaccurate and potentially unreliable. I hope this helps and my bad I didn't really clarify this in the video.