Mike Hibbert asked for ideas of projects for the PIC10F200 series. One that I half developed was a battery backup to a Raspberry Pi. It’s well know that power failure can corrupt the SD card in a Pi causing it to fall to restart, so serious Pi applications need the Pi to be battery backed. Same must be true for other similar microcontrollers.
I used a PIC12 series to detect loss of 12V power to a cheap Chinese 12v to 5V converter and powered the Pi from a 9V rechargeable battery for enough time to allow a safe shut down. Bit like this http://homediyelectronics.com/projects/raspberrypi/ups/ but with a PIC added to give the shutdown. Just providing battery backup is not enough as the current the Pi takes is too large for any cost effective battery to keep going for long. The PIC needs to tell the Pi to shut down through its GPOI port. I think the 10 series has enough pins to do the same as only need 3 I/O pins: one to detect loss of supply, one to command the Pi’s shutdown and one optionally to put the DC to DC into standby after shutdown accomplished, until power is restored. If don’t do the latter it completely flattens the battery.
Can also do it with a 5V input and 3.7V Li battery but need to more careful about battery charging. I initially tried using 556 timers etc. but it was much simpler to write a few lines of code than work out complex timing on monostables. Easier to build too.
There are commercial units doing this but they are £40 or so or limited in functionality. In mine the PP3 battery was by far the most expensive item.
I used a PIC12 series to detect loss of 12V power to a cheap Chinese 12v to 5V converter and powered the Pi from a 9V rechargeable battery for enough time to allow a safe shut down. Bit like this http://homediyelectronics.com/projects/raspberrypi/ups/ but with a PIC added to give the shutdown. Just providing battery backup is not enough as the current the Pi takes is too large for any cost effective battery to keep going for long. The PIC needs to tell the Pi to shut down through its GPOI port. I think the 10 series has enough pins to do the same as only need 3 I/O pins: one to detect loss of supply, one to command the Pi’s shutdown and one optionally to put the DC to DC into standby after shutdown accomplished, until power is restored. If don’t do the latter it completely flattens the battery.
Can also do it with a 5V input and 3.7V Li battery but need to more careful about battery charging. I initially tried using 556 timers etc. but it was much simpler to write a few lines of code than work out complex timing on monostables. Easier to build too.
There are commercial units doing this but they are £40 or so or limited in functionality. In mine the PP3 battery was by far the most expensive item.