Monday, June 30, 2014

Home Automation with Raspberry Pi, Programmable Logic Controller (PLC), Android and Wireless




My home automation with raspberry pi for lamp control in the room and outdoor my home. Automation control, especially to lamp control using android phone via wireless. Wireless on android phone connect to router wireless. The router must have a LAN (RJ45) and Wireless. LAN on router connect to raspberry pi via RJ45 cable. And for communication between raspberry pi and PLC using RS232. The function of PLC to turn on or turn off the lamp in my home.
This video about my home automation for lamp control in my room with raspberry pi, PLC and android phone.

1. Hardware required for home automation, especially to lamp control
My Home Automation with Raspberry Pi, PLC and Wireless LAN Router
My Home Automation with Raspberry Pi, PLC and Wireless LAN Router

Hardware of Home Automation with Raspberry Pi
hardware of home automation with raspberry pi

Description of the image above:
1. Raspberry Pi, SD Card, mouse, keyboard, monitor and Adapter.
Note: mouse, keyboard and monitor are only used for the operating system setup
raspberry pi made in china

2. Programmable Logic Controller (PLC) : Siemens S7-200
Programmable Logic Controller PLC Siemens S7-200

3. PLC Cable: RS232-PPI
PLC Cable RS232-PPI

4. UART TTL to RS232 converter module
UART TTL to RS232 converter module with cable

5. RS232 crossover cable
RS232 crossover cable

RS232 crossover cable diagram
RS232 crossover cable diagram

6. Router with RJ45(LAN) and Wireless or Wireless LAN Router
Router with RJ45 LAN and Wireless or Wireless LAN Router

7. RJ45 Cable
RJ45 Cable

8. Adapter for Raspberry Pi and Router
Adapter for Raspberry Pi and Router

2. Step by step to make home automation to lamp control in home
2.A. Preparation and setup in the raspberry pi
1. Download Raspbian (Debian Wheezy): http://downloads.raspberrypi.org/raspbian_latest
2. Download Win32DiskImager: click here
3. Insert sd card into computer with Windows OS
4. Run Win32DiskImager
5. Write Raspbian OS to sd card using Win32DiskImager
6. After write raspbian to sd card, take the sd card and insert it into the raspberry pi (turn off the electrical power)
7. Connect a mouse, keyboard and monitor to the raspberry pi.
8. Raspberry Pi should not be connected to the serial module.
9. Turn on the adapter to the raspberry pi. LOGIN: pi ,PASSWORD: raspberry , USE: startx

10. After Raspberry Pi ready to use with Raspbian OS/Wheezy OS, download project file.
11. Download project file: click here and Save to Flash disk
Download file and Save to Flash disk

12. After download file in flash disk and Insert Flash disk into USB of Raspberry Pi.
13. Copy-Paste all project file to Raspberry Pi in folder: /home/pi

14. Look at this video for Auto Login on Raspberry Pi, Install PySerial on Raspberry Pi, Setup RS232 or UART pins on Raspberry Pi and Auto Run Python Script on Raspberry Pi.




15. Next:
15.1. Logout and shut off the power to the Raspberry Pi
15.2. Connect raspberry pi to serial/rs232 module, and LAN Router with RJ45
15.3. Unplug mouse, keyboard and monitor cables from the Raspberry Pi

3. Wiring and Connection between Raspberry Pi to Programmable Logic Controller (PLC)
3.A. Connect Raspberry Pi to LAN Router with RJ45 Cable
3.B. Connect Raspberry Pi to Serial/RS232 Module
3.C. Connect Serial/RS232 Module to Programmable Logic Controller (PLC) with RS232 crossover cable and PLC Cable
raspberry pi to serial rs232 module and programmable logic controller plc

3.D. Connecting of Programmable Logic Controller (PLC) to Lamp in Home
Programmable Logic Controller PLC to Lamp in Home

4. Install Android Apps
Download APK File and Install to Android Phone, click here
How to use LampOnOff Android Apps:
1. Click LampOnOff
2. Edit IP Target: Ip address for raspberry pi
3. Edit Port Target to 5000
4. Click Connect, waiting until show: Lamp Num or Disconnect Button
5. Click screen for Lamp On or Lamp Off.
Lamp On Off Android Apps

More information about communication between android and computer

5. Communication Test without Lamp in home, just light in PLC


Labels:




Newer Post Older Post Home

You may also like these ebook:

Get Free PLC eBook directly sent to your email,
and email subscription to program-plc.blogspot.com




We hate SPAM. Your information is never sold or shared with anyone.

Your Email Will Be 100% Secured !

Your email is stored safely on Google FeedBurner