{"id":537,"date":"2014-09-30T22:29:33","date_gmt":"2014-09-30T22:29:33","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?page_id=537"},"modified":"2014-11-11T20:11:37","modified_gmt":"2014-11-11T20:11:37","slug":"ip-watt-meter","status":"publish","type":"page","link":"https:\/\/www.incredigeek.com\/home\/projects\/ip-watt-meter\/","title":{"rendered":"IP Watt Meter"},"content":{"rendered":"<p><strong>Goal:<\/strong><\/p>\n<p>The goal of the project is to create an internet connected device, that can monitor a batteries voltage, AH, WH, and amperage, at a remote site and have the ability to log data, and be able to send alerts based on the data collected.<\/p>\n<p><strong>\u00a0How it Works<\/strong><\/p>\n<p>The IP Watt Meter has two main components a Raspberry Pi and an Arduino.\u00a0 The Arduino uses a voltage divider to calculate the voltage on the battery and an ACS712 voltage sensor to detect the amperage.\u00a0 It then prints it out the data to a serial connection.\u00a0 The Raspberry Pi connects to the Arduino on the serial connection and stores the data inside a MySQL database.\u00a0 It can then take this data and display it on a webpage.\u00a0 The Pi also provides the IP watt meter with an internet connection so the voltage of the battery can be monitored from anywhere and notifications can be sent when something like the voltage is low.<\/p>\n<h1><\/h1>\n<p><strong>Parts List<\/strong><\/p>\n<ol>\n<li>Raspberry Pi\u00a0 with SD card\u00a0 &#8211;\u00a0 $40<\/li>\n<li><a title=\"Arduino Mini\" href=\"https:\/\/www.sparkfun.com\/products\/11114\">Arduino Mini<\/a>\u00a0 &#8211;\u00a0 $9.95<\/li>\n<li><a title=\"ACS712 Voltage Sensor\" href=\"https:\/\/www.sparkfun.com\/products\/8882\">ACS712 voltage sensor<\/a>\u00a0 &#8211;\u00a0 $7.95<\/li>\n<li><a title=\"LED's\" href=\"https:\/\/www.sparkfun.com\/products\/12062\">Red, Yellow, and Green LED&#8217;s\u00a0 <\/a>&#8211;\u00a0 $2.95<\/li>\n<li>2x 2.2k Resistor<\/li>\n<li>1x 4.7k Resistor<\/li>\n<li>1x 1k Resistor<\/li>\n<li>2x 220 Capacitors<\/li>\n<li><a title=\"Wire Terminals\" href=\"https:\/\/www.sparkfun.com\/products\/8432\">Wire screw down terminals\u00a0 <\/a>&#8211;\u00a0 $1.90<\/li>\n<li><a title=\"Headers\" href=\"https:\/\/www.sparkfun.com\/products\/115\">Female Headers\u00a0 <\/a>&#8211;\u00a0 $1.50<\/li>\n<li><a title=\"Headers\" href=\"https:\/\/www.sparkfun.com\/products\/116\">Break Away Headers\u00a0 <\/a>&#8211;\u00a0 $1.50<\/li>\n<li><a title=\"Breadboard\" href=\"https:\/\/www.sparkfun.com\/products\/12702\">Solder-able Breadboard\u00a0 <\/a>&#8211;\u00a0 $2.95<\/li>\n<li><a title=\"Wire Kit\" href=\"https:\/\/www.sparkfun.com\/products\/124\">Jumper Wire Kit<\/a>\u00a0 &#8211;\u00a0 $6.95<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p><strong>Building:<\/strong><br \/>\nHere are some pictures that were taken during the build process.<\/p>\n<p>Parts used<\/p>\n<p><a href=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Parts1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-655 size-full\" src=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Parts1-e1415724574630.jpg\" alt=\"Parts1\" width=\"3264\" height=\"2448\" srcset=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Parts1-e1415724574630.jpg 3264w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Parts1-e1415724574630-300x225.jpg 300w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Parts1-e1415724574630-1024x768.jpg 1024w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Parts1-e1415724574630-400x300.jpg 400w\" sizes=\"auto, (max-width: 3264px) 100vw, 3264px\" \/><\/a><\/p>\n<p>ACS712 Sensor with headers soldered in.<\/p>\n<p><a href=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Parts2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-656\" src=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Parts2.jpg\" alt=\"Parts2\" width=\"2258\" height=\"1973\" srcset=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Parts2.jpg 2258w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Parts2-300x262.jpg 300w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Parts2-1024x894.jpg 1024w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Parts2-343x300.jpg 343w\" sizes=\"auto, (max-width: 2258px) 100vw, 2258px\" \/><\/a><\/p>\n<p>Wire Terminals soldered on board.\u00a0 The two terminals on the right side are the input.\u00a0 The other two are output.\u00a0 The positive wires go in the middle two terminals.\u00a0 The ground connects to the two on the outside.\u00a0 See last picture.<\/p>\n<p><a href=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-647\" src=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building1-1024x594.jpg\" alt=\"Building1\" width=\"584\" height=\"338\" srcset=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building1-1024x594.jpg 1024w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building1-300x174.jpg 300w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building1-500x290.jpg 500w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p>These headers are where the ACS712 Sensor is going to go.<a href=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-648\" src=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building2.jpg\" alt=\"Building2\" width=\"3036\" height=\"1956\" srcset=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building2.jpg 3036w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building2-300x193.jpg 300w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building2-1024x659.jpg 1024w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building2-465x300.jpg 465w\" sizes=\"auto, (max-width: 3036px) 100vw, 3036px\" \/><\/a><\/p>\n<p>Voltage divider with 2 resistors.<a href=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-649\" src=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building3.jpg\" alt=\"Building3\" width=\"2994\" height=\"2050\" srcset=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building3.jpg 2994w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building3-300x205.jpg 300w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building3-1024x701.jpg 1024w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building3-438x300.jpg 438w\" sizes=\"auto, (max-width: 2994px) 100vw, 2994px\" \/><\/a><\/p>\n<p>This wire connects the Arduino to the voltage divider so the Arduino can read the voltage.<a href=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building4.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-650\" src=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building4.jpg\" alt=\"Building4\" width=\"2703\" height=\"2169\" srcset=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building4.jpg 2703w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building4-300x240.jpg 300w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building4-1024x821.jpg 1024w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building4-373x300.jpg 373w\" sizes=\"auto, (max-width: 2703px) 100vw, 2703px\" \/><\/a><\/p>\n<p>Added some headers for the Arduino.\u00a0 The yellow wire will connect to the second analog port(A2) on the Arduino.<a href=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building5.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-651\" src=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building5.jpg\" alt=\"Building5\" width=\"2700\" height=\"1862\" srcset=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building5.jpg 2700w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building5-300x206.jpg 300w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building5-1024x706.jpg 1024w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building5-435x300.jpg 435w\" sizes=\"auto, (max-width: 2700px) 100vw, 2700px\" \/><\/a><\/p>\n<p>The brown wire is connecting analog 3(A3) of the Arduino to the Vout on the ACS712 Sensor.<a href=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building6.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-652\" src=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building6.jpg\" alt=\"Building6\" width=\"2407\" height=\"1852\" srcset=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building6.jpg 2407w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building6-300x230.jpg 300w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building6-1024x787.jpg 1024w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building6-389x300.jpg 389w\" sizes=\"auto, (max-width: 2407px) 100vw, 2407px\" \/><\/a><\/p>\n<p>The second brown wire connects the Arduino&#8217;s VCC to the sensor.\u00a0 The bottom capacitor connects the sensors FILT to ground and the top capacitor connects VCC to ground<a href=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building7.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-653\" src=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building7.jpg\" alt=\"Building7\" width=\"2421\" height=\"1792\" srcset=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building7.jpg 2421w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building7-300x222.jpg 300w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building7-1024x757.jpg 1024w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Building7-405x300.jpg 405w\" sizes=\"auto, (max-width: 2421px) 100vw, 2421px\" \/><br \/>\n<\/a><\/p>\n<p>The Arduino being programmed with the code that is at the end of this post.<\/p>\n<p><a href=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Finished.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-654\" src=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Finished.jpg\" alt=\"Finished\" width=\"3264\" height=\"2448\" srcset=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Finished.jpg 3264w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Finished-300x225.jpg 300w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Finished-1024x768.jpg 1024w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/Finished-400x300.jpg 400w\" sizes=\"auto, (max-width: 3264px) 100vw, 3264px\" \/><\/a><\/p>\n<p>The finished device.<\/p>\n<p><a href=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/IMG_20140930_190316_115.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-658\" src=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/IMG_20140930_190316_115-1024x768.jpg\" alt=\"IMG_20140930_190316_115\" width=\"584\" height=\"438\" srcset=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/IMG_20140930_190316_115-1024x768.jpg 1024w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/IMG_20140930_190316_115-300x225.jpg 300w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/IMG_20140930_190316_115-400x300.jpg 400w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p>I added some headers on the board for the wires that go between the Arduino and Pi.\u00a0 The red wire &#8220;5V&#8221; goes from the 5V out on the Pi to the Raw input on the Arduino.\u00a0 The Black wire &#8220;ground&#8221; connects the ground on both components.\u00a0 The yellow wire is connected to the RX Serial GPIO pin on the Pi to the Arduino&#8217;s TXO pin.\u00a0 Since the Arduino operates at 3.3V we don&#8217;t need any kind of Logic Converter or step down.\u00a0 The serial pins can be connected directly.<\/p>\n<h1><\/h1>\n<h1><strong>Setting up the Raspberry Pi:<\/strong><\/h1>\n<p>&nbsp;<\/p>\n<p><strong>Pre-built image<\/strong><\/p>\n<p>Download the image form <a title=\"IPWM image\" href=\"http:\/\/www.incredigeek.com\/home\/downloads\/ipwm\/ipwm.img.gz\">here<\/a>.<\/p>\n<p>Unzip it and use dd to write it to your SD Card<\/p>\n<pre>sudo dd if=IPWM.img of=\/dev\/mmcblk0 bs=4M<\/pre>\n<p>You can probable use Win32 Disk Imager, although it has not been tested.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Manual Installation<\/strong><\/p>\n<p>Here are the instructions if you want to start from scratch.<\/p>\n<p>Prerequisites<\/p>\n<ol>\n<li>Raspbian Installed<\/li>\n<li>Access to the Pi, i.e., ssh<\/li>\n<\/ol>\n<p><strong>Enabling ssh login for root<\/strong><\/p>\n<p>By default the root user does not have a password, so you can not login to the Pi via ssh with the root account.\u00a0 To change this we need to login to the pi as the default user &#8220;pi&#8221; with the password &#8220;raspberry&#8221;<\/p>\n<p>Once your logged in switch to the root user with the sudo command.<\/p>\n<pre>sudo su<\/pre>\n<p>Once your logged in as root, add a password for root using the passwd command<\/p>\n<pre>passwd<\/pre>\n<p>Follow the prompts to add a new password.\u00a0 You should now be able to login as root over ssh.<\/p>\n<p><strong>Enabling GPIO Serial Connection:<\/strong><\/p>\n<p>To enable the serial connection between the Arduino and Pi you&#8217;ll need to enable the serial connection on the Raspberry Pi.\u00a0 To do this we will need to edit the \/boot\/cmdline.txt file.\u00a0 First it&#8217;s a good idea to make a backup of the file.<\/p>\n<pre>sudo cp \/boot\/cmdline.txt \/boot\/cmdline.txt.old<\/pre>\n<p>Now edit the file with your favorite text editor.<\/p>\n<pre>vi \/boot\/cmdline.txt<\/pre>\n<p>and delete any instances of &#8220;ttyAMA0&#8221;<\/p>\n<p>Here is what my file looked like originally.<\/p>\n<pre>dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=\/dev\/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait<\/pre>\n<p>When your finished the file should look something like this.<\/p>\n<pre>dwc_otg.lpm_enable=0 console=tty1 root=\/dev\/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait<\/pre>\n<p>Save and exit,<\/p>\n<pre>:wq<\/pre>\n<h2><\/h2>\n<h2>Installing Prerequisites:<\/h2>\n<ol>\n<li>Raspbian<\/li>\n<li>MySQL<\/li>\n<li>PHP5<\/li>\n<li>php5-mysql<\/li>\n<li>Apache<\/li>\n<li>minicom<\/li>\n<li>RRDTool<\/li>\n<\/ol>\n<pre>apt-get upgrade\r\napt-get update\r\napt-get -y install apache2 mysql-server php5 php5-mysql minicom sendmail sendmail-bin rrdtool snmp snmpd snmp-mibs-downloader<\/pre>\n<p><strong>Installing the IPWM files<\/strong><\/p>\n<p>The IPWM files include all of the files necessary for the Pi to collect and display the data acquired by the Arduino.\u00a0 Inside the archive are the web files, scripts for emailing, collecting data, creating graphs, the MySQL database, and an init.d file.<\/p>\n<p>You can download the IPWM files from <a title=\"IPWM\" href=\"http:\/\/www.incredigeek.com\/home\/downloads\/ipwm\/ipwm-1.0.tar.gz\" target=\"_blank\">here<\/a> or you can download them with wget.<\/p>\n<p>Setting up the IPWM files<\/p>\n<pre>cd \/root\r\nwget http:\/\/www.incredigeek.com\/home\/downloads\/ipwm\/ipwm-1.0.tar.gz\r\ntar zxvf ipwm-1.0.tar.gz\r\ncd ipwm-1.0\r\nmv home\/ \/var\/www\/\r\nmv ipwm\/ \/\r\nmv ipwmd \/etc\/init.d\r\nchmod +x \/etc\/init.d\/ipwmd\r\nchmod +x \/ipwm\/scripts\/*.sh\r\nchmod +x \/ipwm\/email\/*.sh\r\nchmod +x \/var\/www\/home\/*.sh<\/pre>\n<p>Now edit \/etc\/rc.local<\/p>\n<pre>vi \/etc\/rc.local<\/pre>\n<p>and add the following line to the file so the ipwmd service starts on system boot.\u00a0 Make sure that it is above the line that says &#8220;exit 0&#8221;.<\/p>\n<pre>\/etc\/init.d\/ipwmd start\r\n<\/pre>\n<p>Save and exit<\/p>\n<pre>:wq\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Setting up MySQL<\/strong><\/p>\n<p>Lets create the MySQL database now.<\/p>\n<p>login to MySQL as root<\/p>\n<pre>mysql -u root -p<\/pre>\n<p>and create a new database called wmdb.<\/p>\n<pre>create DATABASE wmdb;<\/pre>\n<p>Now create a new user &#8220;ipwm&#8221; who has privileges to the new database.<\/p>\n<pre>GRANT ALL ON wmdb.* TO ipwm@localhost ;<\/pre>\n<p>And close MySQL with ctrl+d.<\/p>\n<p>Now we can import the sql file into our new database.<\/p>\n<pre>mysql -u root -p wmdb &lt; wmdb.sql<\/pre>\n<p>You can test it by loging into MySQL with the new user.<\/p>\n<pre>mysql -u ipwm wmdb<\/pre>\n<p>and list the tables.<\/p>\n<pre>show tables;<\/pre>\n<p>You should see the following<\/p>\n<pre>mysql&gt; show tables;\r\n+----------------+\r\n| Tables_in_wmdb |\r\n+----------------+\r\n| email\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\r\n| settings\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\r\n| unpw\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\r\n| wm_data\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\r\n+----------------+\r\n4 rows in set (0.00 sec)\r\nmysql&gt;<\/pre>\n<p><strong>Configuring and Setting up SNMP<\/strong><\/p>\n<p>The RRDtool uses SNMP to create the voltage graph.<\/p>\n<p>Edit the snmpd.conf file in \/etc\/snmp<\/p>\n<pre>vi \/etc\/snmp\/snmpd.conf<\/pre>\n<p>and add the following to the bottom of the file.<\/p>\n<pre>extend volt \/ipwm\/scripts\/volt.sh<\/pre>\n<p><strong>Setting up RRDtool<\/strong><\/p>\n<p>Create the directory for the RRDtool database.<\/p>\n<pre>mkdir \/root\/rrdtool \r\nmkdir \/root\/rrdtool\/volt  \r\ncd \/root\/rrdtool\/volt<\/pre>\n<p>Now create the database with<\/p>\n<pre class=\"code\">rrdtool create volt.rrd \\\r\n--step 60 \\\r\nDS:voltage:GAUGE:120:0:10000000 \\\r\nRRA:MAX:0.5:1:1500 \\<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Final Steps<\/strong><\/p>\n<p>You should be all ready to go.<\/p>\n<p>Go ahead and reboot your pi with<\/p>\n<pre>reboot<\/pre>\n<p>When it comes back up you can see if the services are running by using the ps command<\/p>\n<pre>ps aux | grep ipwm<\/pre>\n<p>You should also be able to access the webpage by going to ipaddressofpi\/home<\/p>\n<p>Screenshots<\/p>\n\n\t\t<style type=\"text\/css\">\n\t\t\t#gallery-1 {\n\t\t\t\tmargin: auto;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-item {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-top: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: 33%;\n\t\t\t}\n\t\t\t#gallery-1 img {\n\t\t\t\tborder: 2px solid #cfcfcf;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-caption {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t\t\/* see gallery_shortcode() in wp-includes\/media.php *\/\n\t\t<\/style>\n\t\t<div id='gallery-1' class='gallery galleryid-537 gallery-columns-3 gallery-size-thumbnail'><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.incredigeek.com\/home\/projects\/ip-watt-meter\/ipwm-3\/'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/IPWM-150x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" \/><\/a>\n\t\t\t<\/dt><\/dl><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.incredigeek.com\/home\/projects\/ip-watt-meter\/ipwm-dashboard-3\/'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2014\/09\/IPWM-Dashboard-150x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" \/><\/a>\n\t\t\t<\/dt><\/dl>\n\t\t\t<br style='clear: both' \/>\n\t\t<\/div>\n\n<h1><\/h1>\n<h1>Arduino Programing<\/h1>\n<p><strong><br \/>\n<\/strong>Arduino code.<\/p>\n<pre>\/* \r\n* Reads the voltage divider to calculate a battery voltage\r\n* This software has no warranty, real or implied and is free to distribute and modify\r\n*\/\r\n\r\n\/*\u00a0 The following code was used on an Arduino Pro Mini 3.3V from Sparkfun\r\nNotice the ratio is 2.83 on a 3.3 volt arduino with a 3.3k and 1k resistors\r\n*\/\r\n\r\nint led = 4;\u00a0  \/\/ Red\r\nint led1 = 3;  \/\/ Yellow\r\nint led2 = 5;\u00a0 \/\/ Green\r\n\r\nint batMonPin = A2;\u00a0\u00a0 \/\/ input pin for the divider\r\nint val = 0;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0    \/\/ variable for the A\/D value\r\nfloat pinVoltage = 0; \/\/ variable to hold the calculated voltage\r\nfloat batteryVoltage = 0;\r\nfloat ratio = 2.83;\u00a0 \/\/ Change this to match the MEASURED ration of the circuit\r\n\/\/ the ratio should be higher for a 5 volt Arduino\r\n\r\n\r\nvoid setup() {\r\n\r\nSerial.begin(9600);\u00a0\u00a0\u00a0\u00a0\u00a0 \r\npinMode(led, OUTPUT);\r\npinMode(led1, OUTPUT);\r\npinMode(led2, OUTPUT);\r\n\r\n}\r\n\r\nvoid loop() {\r\nval = analogRead(batMonPin);\u00a0\u00a0\u00a0 \/\/ read the voltage on the divider\r\n\r\npinVoltage = val * 0.00488;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/\u00a0 Calculate the voltage on the A\/D pin\r\n\/\/\u00a0 A reading of 1 for the A\/D = 0.0048mV\r\n\/\/\u00a0 if we multiply the A\/D reading by 0.00488 then\r\n\/\/\u00a0 we get the voltage on the pin.\r\n\r\nfloat average = 0;\r\nfor(int i = 0; i &lt; 1000; i++) {\r\naverage = average + (.0264 * analogRead(A3) -13.51) \/ 1000;\r\n\r\n\r\ndelay(1);\r\n}\r\nSerial.print(\"Amperage: \");\r\nSerial.println(average);\r\nSerial.print(analogRead(A3));\r\nSerial.println(\"Amp\");\r\n\r\nbatteryVoltage = pinVoltage * ratio;\u00a0\u00a0\u00a0 \/\/\u00a0 Use the ratio calculated for the voltage divider\r\n\/\/\u00a0 to calculate the battery voltage\r\nSerial.print(\"Voltage: \");\r\nSerial.println(batteryVoltage);\r\n\r\n\/\/------- Watts -------\r\nSerial.print(\"Watts: \");\r\nSerial.println(average * batteryVoltage);\r\n\r\n\/\/WH AH -- To be continued\r\n\r\n\/\/ LED's\r\nif ( batteryVoltage &lt;= 11.7 )\r\n{\r\ndigitalWrite(led, HIGH);\r\ndigitalWrite(led1, LOW);\r\ndigitalWrite(led2, LOW);\r\n\r\n}\r\nif (batteryVoltage &gt;= 11.7 &amp;&amp; batteryVoltage &lt; 12.10){\r\ndigitalWrite(led1, HIGH);\r\ndigitalWrite(led2, LOW);\r\ndigitalWrite(led, LOW);\r\n}\r\nif (batteryVoltage &gt;= 12.10){\r\ndigitalWrite(led2, HIGH);\r\ndigitalWrite(led, LOW);\r\ndigitalWrite(led1, LOW);\r\n}\r\n\r\ndelay(1000);\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\n}\r\n\r\n<\/pre>\n<p>\u03a9<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Goal: The goal of the project is to create an internet connected device, that can monitor a batteries voltage, AH, WH, and amperage, at a remote site and have the ability to log data, and be able to send alerts &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/projects\/ip-watt-meter\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":350,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-537","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/pages\/537","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=537"}],"version-history":[{"count":64,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/pages\/537\/revisions"}],"predecessor-version":[{"id":5351,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/pages\/537\/revisions\/5351"}],"up":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/pages\/350"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}