logo elektroda
logo elektroda
X
logo elektroda

PIC10F200 as Battery Backup Controller for Raspberry Pi Safe Shutdown via GPIO

384 11
Best answers LABEL_AI_GENERATED

How can a PIC10F200 be used to detect mains loss, trigger a Raspberry Pi safe shutdown over GPIO, and then cut battery power to avoid flattening the battery?

A PIC10F200 can be used as the control logic for a Raspberry Pi battery-backup UPS: detect loss of the main supply, assert a GPIO line for a safe shutdown, and optionally disable the DC-DC converter after shutdown so the battery is not drained [#21682179][#21682186] One reply notes that this approach can replace most of the parts in a discrete safe-shutdown circuit and may also solve the problem of power returning while the Pi is still shutting down [#21682179] Another suggestion is to keep the PIC asleep during normal operation and wake it only when mains/power changes, reducing quiescent current enough that the battery can remain connected [#21682186] For a compact retrofit, put the DC-DC converter on the PCB and use a 5 V input with a Li cell or small NiCd/Ni-MH battery, but make sure the converter has an accessible enable pin so the PIC can switch it off after shutdown [#21682186] If more analogue capability is needed, the comparator-equipped PIC10F204 is suggested as a better choice than the plain 10F200, while remaining code-compatible [#21682188]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
  • PIC-controlled battery backup for safe Pi shutdown

    #1 21682178
    Edward Chase
    Anonymous  
  • ADVERTISEMENT
  • #3 21682180
    Mike Hibbett
    Anonymous  
  • PIC10F200 and PIC12F1822 application examples

    #4 21682181
    Ian Stedman
    Anonymous  
  • ADVERTISEMENT
  • PIC10F200 interrupt wakeup in commercial use

    #5 21682182
    Mike Hibbett
    Anonymous  
  • ADVERTISEMENT
  • PIC10F200 used for easily reconfigurable blink pattern

    #6 21682183
    Rick Curl
    Anonymous  
  • PIC10F204 sensor and gas alarm ideas

    #7 21682184
    Ian Stedman
    Anonymous  
  • #8 21682185
    Mike Hibbett
    Anonymous  
  • ADVERTISEMENT
  • Sleep mode to reduce battery drain in Pi backup controller

    #9 21682186
    Edward Chase
    Anonymous  
  • Micro USB power input and boost converter suggestion

    #10 21682187
    Edward Chase
    Anonymous  
  • #11 21682188
    Mike Hibbett
    Anonymous  
  • #12 21682189
    Simon M
    Anonymous  

Topic summary

LABEL_AI_GENERATED
The discussion centers on using the PIC10F200 microcontroller series as a battery backup controller for Raspberry Pi to enable safe shutdown via GPIO during power failures, addressing the common issue of SD card corruption caused by abrupt power loss. The proposed solution involves detecting loss of main power (e.g., 12V supply) and switching to a rechargeable battery (such as 9V) to provide enough runtime for the Pi to shut down safely. The PIC10F200's limited I/O pins (three needed: power loss detection, shutdown command, and optional status) make it suitable for this compact control task. Comparisons are made to existing designs using PIC12 series and discrete components, with the PIC10F200 offering a more integrated and simplified approach. Challenges include managing current draw to avoid battery drain when mains power is present, achievable by utilizing the PIC's sleep mode and wake-on-pin-change features. Additional suggestions include incorporating micro USB connectors for power input/output and using DC-DC boost converters capable of handling both battery and PSU voltages. The discussion also touches on the PIC10F200's limitations such as lack of interrupts, and alternative PIC models like PIC12F1822 and PIC10F204 with added features like analog comparators. Various project ideas for PIC10F series are shared, including LED flashers, battery testers, and sensor interfaces, highlighting the microcontroller's versatility despite its constraints.
AI summary based on the discussion. May contain errors.
ADVERTISEMENT