Wednesday, January 11, 2017

Internet Relay Using ESP8266 220V 10A DC 7-30V Network Relay WIFI Board Module



Summary
Latest: The board has been removed as it randomly clicks the relay.

 Using the ESP8266 220V 10A DC 7-30V Network Relay WIFI Board Module, I was able to setup an internet Relay to control an auto-gate.

Step 1.
  Configure the ESP8266 relay to automatically connect to home wifi.
  ESP8226 now becomes a local wifi relay.
  Control is via web page.
  Install ESP8266 into the auto-gate control, connect up 12VDC and the gate control relay input.

Step 2.
   Pulse the relay on a local linux box to open/close the gate using curl.

>cat pulserelay
#!/bin/csh -f
curl --data "open_relay='x'" http://192.168.1.7
sleep 1
curl --data "close_relay='x'" http://192.168.1.7

Above csh script can now open / close the autogate

Step 3: Set up URL on another remote fixed IP server

3a:    Setup a cgi on a remote linux fixed IP server

>cat opengate.cgi
#!/bin/csh -f
echo "Content-type: text/html"
echo
echo "<pre>"
echo "opening gate"
rsh raidserv /root/pulserelay
echo "gate opened"
echo "</html>"

Point "raiderv" to dynamic ip in /etc/hosts

Above opengate.cgi will rsh into local linux box "raidserv'

3b. Setup rsa keys
       ssh-keygen -t rsa
       Copy key for same user to raidserv authorized_keys.

Done.

Reference

https://ucexperiment.wordpress.com/

http://www.ebay.com/itm/ESP8266-220V-10A-DC-7-30V-Network-Relay-WIFI-Module-/182150587112



Wednesday, January 20, 2016

Simple Plant Irrigation Using Solenoid Valve

Pets and plants always makes it difficult to be away for extended periods.
Hence have always tinkered with irrigation systems.
Bought some battery operated timer irrigation system online but they break down way too quickly.

Here's my simple solenoid solution.


The key of the system is the 12VDC electric solenoid valve which will control when to water.

Electric Solenoid 12VDC

The controller is a simple timer switch. Its good to purchase a timer with 1 minute resolution.
Timer with 12VDC Power Adaptor

The pvc pipe runs across the front yard and sprays jets to the potted plants.


Pipe with holes to spray into pots below


Power is from an existing outlet
Existing Wall Power Outlet
Waterproof Box













Solenoid valves can be gotten from Ebay
http://www.ebay.com/itm/1-2-New-Electric-Solenoid-Valve-For-Water-Air-N-C-Normally-Closed-DC-12V-/400809593518?hash=item5d521d0aae:g:8LYAAOSw0vBUaxI1

Timers and 12VDC power adapter can be gotten from Sim Lim Tower

Fittings can be purchased from shop at blk 151 Serrangoon North.

Tuesday, December 30, 2014

Smart Home Automation Singapore

THIS IS WORK IN PROGRESS
=======================
Door Sensor housed in pvc box for weatherproofing
3M Outdoors VHB double-side tape



Get a set of photos each time my dad's house main door is opened :)

Emails a set of images from selected IP Cameras upon sensor
Saves motion detect images on Linux Server

The 433Mhz Door, Rain and PIR sensors are all wireless and runs on batteries.
Should last several months at least. Will arm them as necessary.
Will run power for the critical sensors.

The IP Cameras are wired using network over power lines. 
Network over power lines are NOT reliable :( may have to use wifi or wire cat6.

Will be trying out wireless IP Cameras, used to have bad experience with these.

Will be trying out actuators ( 433mhz relays), sound alarm, photo transistors.


Linux Server
Static IP
Image Archival
SMTP Server 
FTP Server
Dynamic IP Mgmt
MySQL server
Rsync server
Samba server
SSHD server


Keywords: smart nation home automation ip camera linux 14.04 email beaglebone black ninjablocks c shell script 433mhz rain door pir sensor rtsp nvr