Connect with us

Backup External Power Circuit for Arduino Project

Discussion in 'Microcontrollers, Programming and IoT' started by wrecks, Jul 16, 2013.

Scroll to continue with content
  1. wrecks

    wrecks

    4
    0
    Jul 16, 2013
    Please review the attached schematic and let me know if it will work for the below described application.

    I am making a locking electronic treasure box based on a home built perfboard Arduino. There will be an internal 9v power supply but I also wanted a way of "jump starting" the system and automatically opening it from the outside if the internal batter dies or if you simply forget the access code. So there will also be a way to supply an external "emergency" power supply (via a 9v or higher power source). When you supply power to the hidden external positive and negative leads the Arduino will power up and Pin 1 will go high, thereby automatically opening the box.

    In order to save battery power I'm using a DC-DC switching power module that can take in anywhere from 7v to 28v and output 5v with up to 92% efficiency.

    I'm an electronics beginner and I have pulled together the attached plan for my circuit from various places. Don't hold back and please let me know if I have hit the mark or royally screwed up. Thanks in advance for your help!
     

    Attached Files:

  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,480
    2,828
    Jan 21, 2010
    The easiest way is to have a small hole somewhere that you can poke a straightened out paper clip into to unlatch the lock.

    Beware that a DC-DC converter will draw some quiescent current. This might exceed the current the ATMega chip draws when in a power saving state.

    There are some references on the net for getting minimal power consumption from your ATMega chip. Check them out.

    A linear regulator with low quiescent current may be more efficient in the long term. Even more efficient is to make sure your battery voltage never exceeds the max voltage for the chip. Three AA cells might be the way to go.
     
  3. wrecks

    wrecks

    4
    0
    Jul 16, 2013
    Thanks for the tips.

    Can you comment specifically on my schematic? While there may be other ways to go will the circuit diagram I provided at least work for the application I have described?

    I'm not overly worried about quiescent current since the system will power itself down to almost nothing after timing out with a Pololu Pushbutton Power Switch (which I left out of my schematic - it draws .01ua in the off state). Also, I just compared the quiescent current of both the LM7805 and the switching regulator and they both are in the same 5-8 mA range.

    I've not seen people powering the ATMega with 3 AA batteries. Is that a better route?
     
    Last edited: Jul 17, 2013
  4. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,480
    2,828
    Jan 21, 2010
    In addition to my comments on the regulator, this circuit has at least 1 other problem.

    If you connect an external voltage source, it can flow into the internal battery. This could cause it to explode.

    For this application I might consider a single LiPo cell. If you get an ATMega chip which will operate down to 2.7V, you won't need a regulator at all. If you need a higher voltage rail, you could have a boost regulator which is only turned on as required.

    I presume the connection to pin 1 is there to indicate that external power is attached. In this case, with a 9V battery the voltage here may never reach 5V (not that it matters greatly -- it's close enough). Another option (especially good if you go a single cell solution) you might want to consider is using the input voltage to switch a transistor to pull a pin low (against the internal pull-up).

    edit 3xAA batteries will give you a voltage guaranteed to be below the max voltage for a typical ATMega, and unlikely to fall below the min voltage. The drawback will be if you need to use the inbuilt ADC to measure an absolute voltage because the input voltage is often used as the analog reference.

    edit2: showing or describing all of your circuit would be great. Especially the magic pushbutton. It may swing you back in favour of the switch mode regulator. Even still, unless you have LEDs on, etc, your current draw may be lower than the regulator anyway. The 7805 isn't a low current regulator. There are others with far lower quiescent current.
     
    Last edited: Jul 17, 2013
  5. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,480
    2,828
    Jan 21, 2010
    Here is a low quiescent current regulator
     
  6. wrecks

    wrecks

    4
    0
    Jul 16, 2013
    Steve,

    This is great! Exploding batteries are bad right?

    I appreciate all of your recommendations and advice. I will draw up the entire circuit and get it up here (today is kind of crazy here at work so probably later tonight). That will also help by forcing me to put my full plan down in one place (which I have not done yet).
     
  7. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,480
    2,828
    Jan 21, 2010
    Yeah. Especially if they're inside a box that contains something valuable.
     
  8. wrecks

    wrecks

    4
    0
    Jul 16, 2013
    Thanks again for all of your help so far. I have attached a more complete schematic showing my plan. Remember - I don't really know what I'm doing here so I'm grasping for straws here - this is a learning project.

    Pin1 is in to indicate that external power has been applied (thereby automatically triggering the servo at Pin2 to open the box). Pin 1 should only go HIGH when external power is supplied.

    Pin2 is the signal source for the servo that opens and locks the box

    Pin3 & Pin4 are just indicator LEDs

    Pin5 when Arduino sketch sets Pin5 HIGH the Pololu switch turns system off

    Pin Ao is a Piezo sensor (this is a box that opens to secret knocks)

    A lipo might be fine, but a single lipo solution wouldn't work because if the internal battery dies then the box still wouldn't open so I want an external source as a way of "jump starting" the system in the event the internal battery dies or if you forget the code. That is the only purpose of the external power leads and the Pin1 connection and that is the only time power would be supplied.

    I don't think I have solved your exploding battery concern and I don't think my switch does the job - because if the switch could be on when a user supplied external power. Would a diode between the Vout from the Pololu switch and the DC/DC converter solve the problem? If so, what diode would you recommend?

    The link for my DC/DC converter is:
    http://www.recom-power.com/pdf/Innoline/R-78Exx-0.5.pdf

    The link for the Pololu switch is:
    http://www.pololu.com/catalog/product/750

    Finally, I think I'm beginning to understand your concerns about using a 9V battery. I just read this article: http://cybergibbons.com/uncategorized/arduino-misconceptions-6-a-9v-battery-is-a-good-power-source/.

    Since I'm making my owner ATMega328P board (that is the chip I happen to have) I can come up with a different internal power supply using AA batteries (or LiPo as you suggested). I'm not sure I want to take on the task of making my own switching regulator though. What would you suggest?
     

    Attached Files:

  9. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,480
    2,828
    Jan 21, 2010
    OK, your power sources to the regulator BOTH need to be protected with a diode (as you suggest). I would recommend that both diodes are 20V 1A Schottky diodes as they are easily obtainable and have a low forward voltage drop.

    I think the switch thing and the SMPS regulator are an expensive way to do things, but they're safe (i.e. you can be pretty sure they'll work)

    AA batteries are probably going to be cheaper in the long run, and they'll last longer. But size may be an issue.

    If you only use small amounts of power, briefly, then a 9V battery may be OK. If you need significant current (100mA or more) or you draw significant current continuously, then probably not.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-