User avatar
underwhelmd
Posts: 94
Joined: Fri Jul 08, 2016 10:05 pm
Location: East Coast, Canada

Controlling wireless power outlet

Thu Oct 12, 2017 12:20 am

I bought a few of those cheap 433mhz transmitters/receivers for controlling wireless power outlets (etekcity).

Following some instructions posted elsewhere, I got it working fairly quickly. It didn't sniff the signal from the remote at first but did work after "export WIRINGPI_GPIOMEM=1".

I'm hoping to combine this with a PIR sensor to turn a light on, on movement, wirelessly. So far so good. This was fun to make work.

Image

User avatar
underwhelmd
Posts: 94
Joined: Fri Jul 08, 2016 10:05 pm
Location: East Coast, Canada

Re: Controlling wireless power outlet

Sat Oct 14, 2017 5:31 pm

A couple observations:

Antenna length/design is important if you want any range. The straight wire whip cut to 1/4 wave length was ~ok~. A coil loaded antenna works much better. http://www.instructables.com/id/433-MHz ... d-antenna/ I've got it turning on/off the socket from the other end of my house, through walls, no problem. No fails.

I used a Pi3 (5v 2.5a power supply) as a build platform then when it was finished, transferred the works and the SD card to a Zero W in a weatherproof box. So I was trying to run the Zero W, a v2 camera, a ds18b20 temp sensor, and the 433mhz transmitter at 5v2a (well, it's a chinese made power adapter so 2a might have been generous) it would not mount a USB flash drive at boot. And I was seeing less range from the transmitter.
I swapped out the power supply for a Canakit 5v 2.5a power supply and all is well again. I left the USB flash drive out because it was a luxury and not really needed...32gb SD card will do fine. Range of the transmitter is back to normal.

edit: not going to bother with the PIR sensor either. I botched together some code that will turn the socket on when the camera starts recording, and shut it off several minutes later.


power hungry little monster though.

User avatar
underwhelmd
Posts: 94
Joined: Fri Jul 08, 2016 10:05 pm
Location: East Coast, Canada

Re: Controlling wireless power outlet

Sun Oct 22, 2017 5:01 pm

This device is outside now. (Pi Zero W, v2 noir camera, ds18b20, and a 433mhz transmitter) It's running Raspbian Stretch on a 32Gb SD card. Pikrellcam is the software that controls the camera. I used instructions from here https://www.samkear.com/hardware/contro ... spberry-pi to set up the 433mhz transmitter. The receiver is not needed after you get the codes from the etekcity remote.

Image

There are a couple IR led lights in the field of view-
Image

Camera sees this at night-
Image

To the human eye, it's near pitch dark. When my better half takes the dogs out first thing, I'd like the yard to be lit up with visible light for a few minutes, automatically. Yes, I could buy a motion sensing light but what fun would that be? The Pi was there anyway. Pikrellcam has "on_motion_begin" ability in it's .conf to run a script when it starts recording. It's set to run a very simple bash script that turns on a visible light (light is in the back window, plug is inside the house) and then shuts it off again in 5 minutes.

more /home/pi/pikrellcam/scripts/light.sh

Code: Select all

#!/bin/bash

/home/pi/www/rfoutlet/codesend 4474269
sleep 300
/home/pi/www/rfoutlet/codesend 4474278
It is reliable. Range is impressive for something so cheap....Device is outside, outlet is inside...signal has to pass through several walls.
I purposely set it off a number of times while the script was "sleeping" from an initial run to see if there would be multiple instances running and there are not. It shuts off after 5 minutes, no matter how many times the camera begins recording since the initial run.

I am thankful for the folks who did the work with rfoutlet and wiringpi that made it easy and fun to put this together.

Return to “Automation, sensing and robotics”