animositygamers
Posts: 4
Joined: Fri Oct 30, 2015 9:40 pm

Home automation Question

Mon Aug 01, 2016 7:04 pm

So, I'm new to using raspberry pi or coding in general but home automation is the reason I bought a Raspberry Pi. I intend to learn as I go and try to piece together wirelessly controlled relay's controlled from my Raspberry pi with my phone or computer on ip address. I'm a electrician by trade and have no problem messing with my main power but if anyone is going to try to replicate things I'm going to try to do I warn that playing with main power is potentially life threatening and you should do so with that risk in mind.

Alright, I started this project about 3 months ago before I had to leave for work (in which I forgot alot of what I learned on my PI :( ). I succeeded in controlling my kettle with SSH with my android phone using Python commands directed towards my PI.
http://imgur.com/a/Jt56J (Project as it stands when I left for work)

I now wish to eliminate the wires from my PI to the relay that switches the power, make it smaller (not much bigger than the relay itself and if possible I'd like to control multiple relays with the same Rasp PI so I can add or remove home automation items at my leisure. I'm thinking this could possibly be accomplish with RF receivers/transmitter? but I'm having a bit of a hard time finding material that I can learn from.

Here is some Code I used for the kettle project...

Python

Code: Select all

import RPi.GPIO as gpio
import sys
gpio.setwarnings(False)
gpio.setmode(gpio.BOARD)
gpio.setup(22,gpio.OUT)
k=int(sys.argv[1])
if k==1:
    gpio.output(22,1)
elif k==0:
    gpio.output(22,0)
I would also love it if I could eliminate the SSH Putty input with my phone and make it a website that I could simple label different buttons and they would change color (green on and red off).

Would appreciate any help on this project if anyone has done it already.

Kagetaze
Posts: 86
Joined: Sat Jan 24, 2015 12:01 pm

Re: Home automation Question

Tue Aug 02, 2016 6:52 am

I don't think this is going to be possible. At least, I've never heard of something like this.

You can get RF chips, but they will still need to process the information they get, this is what a RPi is for.

Alternatively, you could get a RPI0, considering they are so cheap and small you can have it fitted in there and probably at the same price as a RF chip?

ghans
Posts: 7867
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Home automation Question

Tue Aug 02, 2016 7:27 am

Use a multi-relay board and a Pi Zero (+ WiFi dongle) ?
You cannot eliminate the wires between the Pi and the Relays.

As for adding a web interface :
https://github.com/dddomodossola/remi

Alternatively look into remote-controlled sockets and see
if you can replay the signals with a Pi. You might be able
to literally record/replay them via Audacity , an RF transciever ,
an USB soundcard and some passive components.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Tue Aug 02, 2016 7:57 am

ghans wrote:Alternatively look into remote-controlled sockets and see
if you can replay the signals with a Pi. You might be able
to literally record/replay them via Audacity , an RF transciever ,
an USB soundcard and some passive components.
I'm using this method with HomeEasy socket adpters and an RFXtrx USB transceiver all conrolled with http://www.fhem.de on a Pi

animositygamers
Posts: 4
Joined: Fri Oct 30, 2015 9:40 pm

Re: Home automation Question

Tue Aug 02, 2016 10:20 am

Thanks for all the replies, I checked out github and its exactly what I was looking for for the web part. I also found this video guide that looks to be doing what I want https://www.youtube.com/watch?v=ecnxMOie7PM This is above my head in terms of small electronic components but I'll learn it after I watch it a bunch. If someone who is well versed in these small electronic components could take a quick look at it and let me know if this is plausible solution to my question I'd greatly appreciate it.

If this works i'll eliminate the battery packs he has to run his circuits by most likely splicing in a step down AC to DC converter (cell phone charger most likely because it takes 120v AC and outputs 5V DC) in parallel to the circuit before the relay. That would make sure the electronic circuit is powered as the first side of the relay is powered. Of course this is all providing that the parts would work with the output amperage as well and that this would even work for what I want to use it for.

EDIT: I looked at getting some Rasp PI Zero's but cant find a good source to buy them from at a decent price that ships to Canada. Any suggestions if i need to go that route?

EDIT 2: So i started to dapple in OpenHab and managed to get my PI to host a nice webpage that I can access with my phone or PC that has a toggle button that activates or deactivates a Gpio pin that causes my relay to open or close. Im sadly no closer to understanding how to eliminate a raspberry pi at the actual location of the item i wish to switch with a relay but have seen some projects that combine a central PI with the pre programmed arduino to do what seems to be exactly that.

I'm still trying to understand the video I posted but i think it's exactly what I was looking for. Im just to dense to understand it xD

EDIT 3: I've found a way to do what I want to do and have it available to use anywhere but it doesn't include the Raspberry pi because its just simpler this way for the time being anyways. If anyone wants to try it out i'll be using IO adafruit (Open beta and free atm) to control the devices over the internet on my cell phone and this is the parts ill be using...
- ESP8266 E12
- 5V Relay Module
- AMS1117 Low Drop Out Regulator
- 1K Resistor (1/4w)
- Cell phone charger block with 5v output
- 14 gauge NMD wire
- Jumper wires
- replacement 15amp plug male head
- Duplex Outlet
- Deep PVC electrical box & Single gang electrical wall plate
- FTDI Usb to Serial Converter (3.3V version and its only to program the ESP8266)

Here's the plans for the plug http://imgur.com/a/gkdOc and i'd like to thank HariFun for helping me put this together. End result will be a plug in a box that is plugged into a wall outlet for power. One side of said plug will always be on and the other will be switched via the relay with the IO Adafruit program.

This project is HariFun's idea i'm just adding to it with different wire and i'll probably swap to a 2 channel Relay. Here is a link to his instructables on how to do this project http://www.instructables.com/id/DIY-WiF ... /?ALLSTEPS

Return to “Automation, sensing and robotics”