Quick Navigation All projects Hardware Links Top projectsAlan numitron clock Clapclap 2313/1386 SNES Pi Webserver USB Volume/USB toys Smokey amp Laser cutter WordClock ardReveil v3 SNES Arcade cabinet Game boy projects cameleon Home Presence Detector GitHubAlanFromJapan Contact me![]() Who's Alan?Akizukidenshi Elec-lab Rand Nerd Tut EEVblog SpritesMods AvrFreaks Gameboy Dev FLOZz' blog Switch-science Sparkfun Suzusho Datasheet Lib Reddit Elec Ermicro Carnet du maker (fr) |
raspipowerLast update: Sat Jan 10 23:04:54 2026
Target (following the Raspi GPIO fun) is to be able to turn off a Raspi with a tact switch AND cut the power (for real). This means I use a little uC (ATTiny10) which sends the shutdown signal to the Raspi (like done on the SNES Web server) and then closes the relay to cut the power completely. You will just feed continuously the uC which can be tuned to have a microscopic power consumption.Target is to use that in my Bedside mood companion project but more on that later... PresentationPrincipleAn in place programmable ATTiny10 watches for a button press: on press close the realy (turning on the Raspi) and on another press sends a signal to Raspi (see the Raspberry Pi shutdown python script) then waits for ~30sec to turn off the power for real by opening the relay. Simple as they come.IssuesVersion 1.0I am a f#$&ing idiot, I wired the version 1.0 as the relay closed by default and I used the wrong part for the HK4100F relay so you can't use it with that HK4100F relay. Need to cut some tracks and airwire it to work with the big F4052 relay ... I feel stupid.At least it's fixable and it works fine with the big ass relay now. ![]() Need to do the following: Version 1.2I skipped the v1.1, this one should work with both relays, and I implemented the HK4100F component in my homemade library.ImplementationBill of materials
Schematics![]() VariantsJP1By default it can be left opened. Leave all opened if use the OR resistor pair below. JP3 By default you should close JP3-B to enable simple control of the relay transistor NRELAY. OR Circuit A transistor based OR that drives the relay's transistor by implementing "uC pin PB2 OR GPIO13". GPIO13 is PI_IS_ON and should be HIGH when the Raspi is running. One idea is that if the script makes PI_IS_ON HIGH as long as the Raspi runs, and the uC pin PB2 is high the relay will be closed. And when turning off, the tiny sends DATA-DO_SHUTDN to turn off the Raspi, and keeps the relay on for 30 sec. So as long as the uC consider it should keep the Raspi powered (=until shutdown button pressed and notified +30sec) OR the Raspi says "I'm running" (the PI_IS_ON GPIO) the relay will stay closed. Source codeBoardSource code on my GitHub.ATTiny10 micro-controllerOn my GitHub based on ATTiny10 microcontroller.
Pictures![]() The assembled version with its big ass relay ![]() Top side of the board ![]() Initial circuit for my own version of a PowerBlock ![]() The v1.0 of the board ... with its bug :( LinksHelpful sourcesInspiration |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
All content on this site is shared under the MIT licence (do what u want, don't sue me, hat tip appreciated) electrogeek.tokyo ~ Formerly known as Kalshagar.wikispaces.com and electrogeek.cc (AlanFromJapan [2009 - 2026]) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||