Home Automation Raspberry and Phidgets part 2


In the previous tutorial we saw how you can drive the digital outputs of the Phidgets 1018
remotely, in this tutorial instead we will check the status of the digital inputs, which can be connected to magnetic contacts, push buttons, switches, etc.

You need:

a Raspberry Pi B or B+, with installed Web Server and the Phidgets library or you can use our Raspberry Pi – SBC, MODEL B+, 512M MicroSD 8GB Phidgets ready

a 1018_2 – PhidgetInterfaceKit 8/8/8

some switch

Connect the 1018 to a USB port on Raspberry and the switch to digital input and ground.Home Automation Raspberry and Phidgets part 2

Step 1: The code

The code

Create a new folder that will contain all the files

Create a new file input.html

with this content

Create a new file input-emmeshop.js

with this content

Create a new file action.php

with this content

Make a link of domo-emmeshop from /home/pi/domo-emmeshop to /var/www/domo-emmeshop .

Finally, create a python file input-emmeshop.py

with this contentHome Automation Raspberry and Phidgets part 2 schematich

Step 2: How it work

How it work
The input.html file creates a web page based on HTML, jQuery and AJAX with 8 toggle switch that show digital inputs state.

When the page is loaded asks the status of the digital inputs at 1018 and displays it using the toggle switches

We have used a switch and a key switch, but you can connect magnetic contacts ( to see if doors and windows are closed ) or the Current Status Switch to see if an appliance is turned on ( I turned off the iron !!? )

Follow us on social to stay informed.

 

For more detail: Home Automation Raspberry and Phidgets part 2




© 2015 Powered By Engineering Projects Team, Raspberry Pi Projects

Scroll to top