Dec 1, 2016

Raspberry Pi UPS from junk box

I've been using the Raspberry Pi 1 as an ssh shell for Irssi and as a web server for my IP cameras and self-made IoT gadgets. Maybe I had just a bad luck with the corrupting SD cards, but I ended up to put the Arch Linux and other files to 120 GB SSD (although the SD card is still needed for bootloader), which was connected to RPi via 2.5" USB HDD box. Some time ago the SSD died and I got a good reason to upgrade the whole system, so I bought the RPi 3 and replaced the SSD with an 250 GB Samsung 840 basic. The extra performance (1x 700 MHz vs. 4x 1.2 GHz ARM cores) is nice especially when rendering timelapse videos from my IP camera photos.

Click to enlarge
To get some extra reliability, I thought that some kind of UPS could be nice. There's plenty of complete kits on ebay, but I happened to have some suitable parts in my junk box, so I didn't bother to wait 2 weeks. It wouldn't need any fancy features, but obviously should have at least an overcharging protection and under-voltage cutoff if the power outage is long enough. So there's the plan:

Click to enlarge
To keep it simple, there's no separate charging circuit for the 12 V sealed lead acid battery. I had couple of 12 V power supplies so it could charge the battery up to 12 volts. However fully charged battery would sit around 14.2 volts, so charging it only to 12 volts would waste about half of it's full capacity (2.9 Ah). For me, that's not a problem because the RPi would stay on more than long enough even with 1.45 amp-hours. We can limit the charge current of the battery with the 47R resistor, but allow higher discharge currents through the schottky diode, when the primary power supply cuts off. Theres also a protection diode for the 12 V power brick, so it cannot draw current from the battery when the main PSU is down. At these voltages we don't have to care about overcharging the battery.

RPi requires 5 volts, so there's also a regulator. Because the voltage drop from 12 V to 5 V is quite large when considering the 400-1000 mA operating current, I chose a buck switch mode power supply module instead of regular LM7805 linear regulator. That Murata module is pin-compatible with LM7805 but the efficiency is a lot better as it's an SMPS.

The undervoltage cutoff prevents the output of 5 V SMPS module to fall down slowly by causing all kind of unwanted effects for the RPi. When the battery voltage reaches ~6 V, the relay disconnects the battery, which is connected again when the main 12 V supply returns. The coil of the relay is rated for 5 volts, so there must be a series resistor to limit the current. The value of the resistor sets the cutoff voltage. But why there's a capacitor in series with relays coil? I noticed that when the resistor value would be good in terms of cutoff voltage, the relay didn't switch on even at 12 volts. So the capacitor works as a high-pass filter which bypasses the 270R resistor and provides the "kick" to the relay coil when the main PSU turns on, but after that, the current passes only via the resistor, as the capacitor cannot pass DC current. After the transition, everything abouve 6 volts is enough to keep the relay switched on.

Click to enlarge

* The picture above still with the RPi 1 model B.

57 comments:

  1. Wow this look good and good thinking of rather than waiting for 2 weeks when you can made one for yourself. Thanks for sharing the blog.

    ReplyDelete
  2. Can you please enlist the components name and values please

    ReplyDelete
  3. Indexel is manufacturers and suppliers of control panel, SCADA system, VFD system and much more.
    Kindly find the below services:
    Control Panel manufacturers in India
    SCADA system manufacturers in india

    ReplyDelete
  4. Here you will find best Latest Ghana music where you can download videos about culture lifestyle of nigerian people african citizens and much more. Thanks for visiting this website

    ReplyDelete
  5. The UK's most visited estate agents.Our Experts can help you buy, sell, rent and let property with branches across the UK. largest online letting agent uk .We will list your property on the main property portals such as Rightmove, Zoopla & PrimeLocations.let your property within the first 48 hours.largest online letting agent uk.

    ReplyDelete
  6. One of the top website for organic SEO, where you can easily Drive More Traffic To Website within a month. Yes, it's time to increase your clients/visitors on your website and earn more and more money from your website or business. Visit for more details.
    drive more traffic to website

    ReplyDelete
  7. Our offer is very effective when compared with the listed list. You create a very site and boost your google rankings web site, but this site does not require anyone to use your site. This is the first place for SEO services to allow users to access your site.

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. Excellent blog & I love your
    latest foreign Music you have a good work here... It's hard to find good quality writing like yours nowadays..
    Naija Entertainment
    Excellent blog & I love your
    latest naija Music

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. I liked your blog very much it is very interesting and I learned many things from this blog which is helping me a lot.


    UV Light Ballasts

    ReplyDelete

  12. Xcluciveoffer
    buy the latest electronics product at here.Choose form a from a wide range of Electronics products at xcluciveoffer prices, brands, offers.
    Click now
    Shop now

    ReplyDelete
  13. In a superior and orderly manner that has a special and excellent function and must have a special result
    فروشگاه اينترنتی
    https://www.baneh.com
    goodluck

    ReplyDelete

  14. Xcluciveoffer
    Buy latest design Hp Desktop and more feature's like-
    HD camera,sound quality,4GB DDR4 RAM,1TB 7200rpm hard drive,21.45-inch screen.Xcluciveoffer get 50% offer all eletronice product's.
    Click now
    Shop now

    ReplyDelete
  15. Nice Blog with Fresh Content. I really Like your Blog. Thanks for Sharing.
    Electrical Accessories at Lowest Prices

    ReplyDelete
  16. such an excellent post regarding "Raspberry Pi UPS from junk box"

    thanks,

    Gmail Toll Free Number

    ReplyDelete
  17. Happy to see your post as it is just what I’ve looking for. I am looking forward to another great post from you.
    E-waste recycling chennai

    ReplyDelete
  18. This post is really insightful; it has helped me understand so many things.E-waste recycling company in Pune

    ReplyDelete
  19. very informatie blogs. we could see that electronics appliance is very important to our life and hobby. Very clear explanation. thank you for sharing muco.nl

    ReplyDelete
  20. Happy to see your post as it is just what I’ve looking for. Please keep it up.
    E-waste recycling in Kolkata
    Extended Producer Resposibility

    ReplyDelete
  21. Very nice blog on this website. It is really difficult to get this kind of with useful information. I will eagerly look forward to your upcoming updates. Thanks for sharing it here. BRP INFOTECH is one of the best E-waste company in Hyderabad.

    ReplyDelete
  22. Thank yo very much for the detailed information.This is useful for me.I waiting for your next post.E-waste recycling solution in India.

    ReplyDelete
  23. Thanks for sharing very informative post. Keep it up.
    BRP INFOTECH is one of the best Best EPR Service Provider in India.

    ReplyDelete
  24. This is a great post. I am pretty much impressed with your good work. You put really very helpful information. Keep it up. E-waste recycling plant

    ReplyDelete
  25. I’ve been looking for info on this topic for a while. I’m happy this one is so great. Keep up the excellent work.
    E-waste management in India

    ReplyDelete
  26. really very nice post I am very happy to be here thank you.... keep doing more posts like this for more arduino projects

    ReplyDelete
  27. This comment has been removed by the author.

    ReplyDelete
  28. Nice post just want to say thanks for your wonderful post, it is contain a lot of knowledge and information that i needed right now. I wanna tell you that if you want to get more fun and enjoyment then visit Garmin Express and get more fun. Thanks for sharing!

    ReplyDelete
  29. Hi, I read your post and found it quite interesting. The post you shared is very unique and informative. Thanks for sharing such a useful post. For more information visit on Garmin.com/Express.

    ReplyDelete
  30. Need an hacker for hire? need to keep an eye on your spouse by gaining access to their emails?, want to know what your kids do on social networks? Whatever it is, Ranging from Bank Jobs, Flipping cash,Taxes. He can get the job done. Are you looking for help hacking into social media? change of grades? help with projects management hacking, social media hacking- Contact him via: (hackingsetting50@gmail.com)

    ReplyDelete
  31. Need an hacker for hire? need to keep an eye on your spouse by gaining access to their emails?, want to know what your kids do on social networks? Whatever it is, Ranging from Bank Jobs, Flipping cash,Taxes. He can get the job done. Are you looking for help hacking into social media? change of grades? help with projects management hacking, social media hacking- Contact him via: (hackingsetting50@gmail.com)

    ReplyDelete
  32. I appreciate your article. You truly share relevant and extraordinary knowledge. Thank you for keep sharing these valuable thoughts.

    38 WATT DC/DC CONVR : 494GC : ALCATEL-LUCENT
    AC-DC PWR UN 950W : ES660C : ALCATEL-LUCENT
    208/240 V0LTS AC-DC : 364A3 : ALCATEL-LUCENT

    ReplyDelete
  33. The team of Sanjarirecycling is the organization occupied with sewage and profluent treatment since 2010. Our past experience of 6 years profluent treatment and recycling had helped us in awesome extent. With inventive specialized coordinated effort we had figured out how to streamline our procedure of electronic waste recycling. We likewise figure out how to deliver 0% unusable material from our recycling procedure. We are top E-Waste Recycling Company in Mumbai clinets who has dedicated a e-waste collection centre at Mumbai. We have the cooperation with Door to Door accumulation organizations that go to your place and take your electronic scraps free of cost and for some situation even pay you back after assessment of your item at our office. The cash straightforwardly goes to your account provided to us.

    ReplyDelete