PeterLee
Published © GPL3+

Watering Plants with PHPoC Blue

The plants are watered with the mini water pump. A relay is required because the mini water pump operates DC 8V ~ 12V.

IntermediateShowcase (no instructions)8 hours1,558
Watering Plants with PHPoC Blue

Things used in this project

Hardware components

PHPoC Blue
PHPoC Blue
×1

Story

Read more

Schematics

Connection

Connection

Code

Source Code

PHP
Source Code
<html>
<head>
<title>PHPoC / <?echo system("uname -i")?></title>
<meta name="viewport" content="width=device-width, initial-scale=0.5">
<style> body { text-align: center; }</style>
</head>
<body>
 
<h2>
 
Mini pump<br>
 
<br>
 
<?php
 
include_once "/lib/sd_340.php";
 
define("OUT_PIN", 0);
 
uio_setup(0, OUT_PIN, "out");
 
if(($led0 = _GET("led0")))
{
    if($led0 == "low")
        uio_out(0, OUT_PIN, LOW);
    else
        uio_out(0, OUT_PIN, HIGH);
}
 
if(uio_in(0, OUT_PIN) == LOW)
{
    echo "<a href='index.php?led0=high'><img src='button_push.png'></a><br>\r\n";
    echo "State : OFF\r\n";
}
else
{
    echo "<a href='index.php?led0=low'><img src='button_pop.png'></a><br>\r\n";
    echo "State : ON\r\n";
}
 
?>
 
</h2>
 
</body>
</html>

Credits

PeterLee

PeterLee

2 projects • 11 followers

Comments