User Tools

Site Tools


raspberrypi:blackoutdetector

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
raspberrypi:blackoutdetector [2022/12/02 21:02] – external edit 127.0.0.1raspberrypi:blackoutdetector [2024/10/05 17:02] (current) – removed rlunaro
Line 1: Line 1:
-====== A blackout detector for the Raspberry PI ====== 
- 
-===== Intro ===== 
- 
-This are my first steps into electronics. I have power problems at my current home,  
-with random blackouts that are driving me crazy. These are specially annoying when  
-you are out of home (vacation) and there is nobody there to put the big  
-switch again on. 
- 
-Instead of complaing to the gods for my misfortune, I tried to workaround this  
-problem in the nerd's way: I have constructed a blackout detector that sends  
-me a message to my phone when the power goes off at home. So, if I am outside,  
-at least I will know it.  
- 
-===== The idea ===== 
- 
-I one of those fortunate guys who have an UPS at home. It is not a powerfull one,  
-but at least is enough to save your data and prevent a disaster. Having this and  
-a Raspberry PI, the only thing is a power detector to wire it to the GPIO bus and  
-I will have my blackout detector.  
- 
-I did this by stabilizing a spare power source from an old phone and tame its output 
-to 3.3V, the voltage needed by the input pins of the GPIO bus.  
- 
- 
-==== Ladies and gentlemen, the power source ==== 
- 
-{{ :00.jpg?direct&200 |}} 
- 
-I've started with this power source, and my initial idea was to use a simple  
-resitor to lower the voltage to 3.3V, but when I went to measure the output  
-given, I received a big surprise: the output was 8V, very far from the 4.5  
-expected.  
- 
-I've asked around and I found out that you can lower this value in a safe  
-way by connecting it to an voltage stabilizer. It is a circuit that outputs  
-some voltage regardless of the input voltage you have.  
- 
-In essence, this is made by an integrated cirtuit called LM317, a pair of  
-resistors and two capacitors. Here is the schematics: 
- 
-{{ :raspberrypi:03.png?direct&500 |}} 
- 
-Picking the values of the resistors is the most complicated thing. To ease  
-it, I've selected one fixed and the other a variable resistor: by trimming  
-it afterwars you can fix the voltage to a very precise value. Moreover, I've  
-discovered how handy is it when the output voltage changed when I've  
-enlarged the output cable. 
- 
-Here is a picture of the resulting circuit: 
- 
-{{ :01.jpg?direct&200 |}} 
- 
-I've bought a box to protect it. Here is the final product:  
- 
-{{ :02.jpg?direct&200 |}} 
- 
-==== References ==== 
- 
- 
-http://www.learningaboutelectronics.com/Articles/LM317-voltage-regulator 
- 
- 
  
raspberrypi/blackoutdetector.1670014949.txt.gz · Last modified: 2022/12/02 21:02 by 127.0.0.1