<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									General Projects - CrackedConsole Community				            </title>
            <link>https://www.crackedconsole.com/community/raspberrypi-general/</link>
            <description>CrackedConsole Discussion Board</description>
            <language>en</language>
            <lastBuildDate>Mon, 25 May 2026 16:58:02 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Raspberry Pi Zero W controlled Server power monitor with TXT message alerting.</title>
                        <link>https://www.crackedconsole.com/community/raspberrypi-general/raspberry-pi-zero-w-controlled-server-power-monitor-with-txt-message-alerting/</link>
                        <pubDate>Fri, 18 Jan 2019 04:19:32 +0000</pubDate>
                        <description><![CDATA[I&#039;ve started working on a small side project for work, a power monitor for a offsite location and or server site location.The idea of it is, it will run a Raspberry Pi Zero W with a battery ...]]></description>
                        <content:encoded><![CDATA[<p>I've started working on a small side project for work, a power monitor for a offsite location and or server site location.</p><p>The idea of it is, it will run a Raspberry Pi Zero W with a battery backup, charging module, GSM module and utilize the on board GPIO pins for triggering.</p><ul><li><a href="https://amzn.to/2FO8IOe" target="true">Raspberry Pi Zero W</a></li><li><a href="https://amzn.to/2VZMFKh" target="true">5v to 3.3v Voltage Regulator</a></li><li>2x<a href="https://amzn.to/2svVX38" target="true">10uf Capacitor</a></li><li><a href="https://www.gearbest.com/other-accessories/pp_1191573.html?wid=1433363" target="true">SIM800L GSM Module</a></li></ul><p> </p><p>Basically, we hook a standard 5v wall plug into the box that is then split into 2 legs.</p><p>1 goes to the battery charger/battery and powers the Raspberry Pi</p><p>1 goes to a voltage regulator (and capacitors) to drop the voltage down to 3.3v, this is now safe and low enough to be read as in input on the raspberry pi GPIO pins.</p><p>The system has power, the pi runs off the 1st 5v leg thats also maintaining the battery, and providing 3.3v via leg 2. This tells the Pi that its getting power from the wallwart.</p><p>Power drops, the charge circuit swaps to using battery, leg 2 is no longer live and pulls the Pin on the Pi GPIO to LOW thus executing a script on the Pi OS to send a text msg that it is down.</p><p>Theres a couple small wiring diagram issues, ie power out from the charging IC goes to the bottom of the pi for power in, not to the GPIO pins 5v power. I still have to test this and make sure a diode isn't needed on the power in to assure theres no reverse voltage back fed from the 5v Input that ends up pulling the GPIO pin back to HIGH when running on battery</p><p> </p><p><img src="http://www.crackedconsole.com/wp-content/uploads/2019/01/Schematic.png" width="50%" height="50%" border="0" /></p><p>And a generic MS Paint early draft, this wiring is till not tested (same as above), as I plan on building it this weekend.<br />The GPIO wiring for sure is not correct in this image, and do not use it as golden as it was an initial quick brainstorm</p><p><img src="http://www.crackedconsole.com/wp-content/uploads/2019/01/Diagram.png" width="50%" height="50%" border="0" /></p><p><strong>Installing Python Dev tools</strong></p><pre>sudo apt-get update<br />sudo apt-get install python-dev python-pip<br />sudo pip install --upgrade distribute<br />sudo pip install ipython<br /><br /></pre><p><strong>Installing Raspberry Pi GPIO and serial</strong></p><pre>sudo pip install --upgrade RPi.GPIO<br />sudo apt-get install python-serial<br /><br /></pre><p>3</p><p> </p><p><strong>Python Code for sending a TXT message</strong></p><pre>import serial<br />import RPi.GPIO as GPIO <br />import os, time<br /><br />GPIO.setmode(GPIO.BOARD)<br /><br /># Enable Serial Communication<br />port = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=1)<br /><br /># Transmitting AT Commands to the Modem<br /># '\r\n' indicates the Enter key<br /><br />port.write('AT'+'\r\n')<br />rcv = port.read(10)<br />print rcv<br />time.sleep(1)<br /><br />port.write('ATE0'+'\r\n') # Disable the Echo<br />rcv = port.read(10)<br />print rcv<br />time.sleep(1)<br /><br />port.write('AT+CMGF=1'+'\r\n') # Select Message format as Text mode<br />rcv = port.read(10)<br />print rcv<br />time.sleep(1)<br /><br />port.write('AT+CNMI=2,1,0,0,0'+'\r\n') # New SMS Message Indications<br />rcv = port.read(10)<br />print rcv<br />time.sleep(1)<br /><br /># Sending a message to a particular Number<br /><br />port.write('AT+CMGS="+6xxxxxxxxx68"'+'\r\n')<br />rcv = port.read(10)<br />print rcv<br />time.sleep(1)<br /><br />port.write('Hello User'+'\r\n') # Message<br />rcv = port.read(10)<br />print rcv<br /><br />port.write("\x1A") # Enable to send SMS<br />for i in range(10):<br />rcv = port.read(10)<br />print rcv</pre><p> </p>]]></content:encoded>
						                            <category domain="https://www.crackedconsole.com/community/raspberrypi-general/">General Projects</category>                        <dc:creator>CrackedConsole</dc:creator>
                        <guid isPermaLink="true">https://www.crackedconsole.com/community/raspberrypi-general/raspberry-pi-zero-w-controlled-server-power-monitor-with-txt-message-alerting/</guid>
                    </item>
							        </channel>
        </rss>
		