I've got an RPi running my OpenRemote2 Controller and want to add some more devices to my arsenal of remote control. These devices are a set of 3 mains switches (for lamps) and a projector screen which are both radio controlled and come with a blipper/sender. I popped the PCB out of the case and it was easy to work out which contacts to connect on the PCB as the micro-switches are on the opposite side of the board. Heres an image...
So figured all I need to do now is connect up those contacts using something like the GPIO. It doesnt need any power but just a connection as the PCB holds its own battery. I suppose it would be good not to use a battery but my understanding is the RPi output is 3.3v whereas the battery is 12v and reads 11.45v across the connections. Possibly the remote would work with less but designed for 12v.
Okay I've bought a few bits and pieces and could do with a bit of guidance. I can solder, understand what components do, and can follow instructions - i dont do design though :-/ I'm happy that I've got the right relay board. Just need to confirm I'm going down the right route. This is a very useful tutorial on YouTube
Here is the kit...
By the way - a suitable enclosure will be courtesy of my kit 3d printer ;-)
Okay here is the prototype. I've hooked up some commands from OpenRemote2 and have the RPi operating the relay board. Each pair of relays will operate an on and off switch on the remote control. I'm using some software called wiringPi but getting some strange effects - the switch parameters I'm using in the commands don't seem to correspond with the pins out on the GPIO. Not a biggy but can only use 7 of the 8 connected. Can you see any connection problems? (theres a jumper on VCC/JD-VCC)
Got it! The wiringPi software includes zero so I now have 8 working relays. The valid parameters for activating GPIO using gpio.sh are 0,2,3,7,8,9,12,13. I'm guessing its to do with the conections I've used which are all on one side.
Heres the working prototype on YouTube
Assuming you are familiar with OR2 and creating commands:- The OR2 command protocol is Shell Execution Protocol The Path - Ive set this to \usr\local\bin\gpio.sh The Command Parameter relates to each of the pin pairs - they are bit of a peculiar order but sure there is some logic behind them.
gpio.sh should read somethng like this:
\#!/bin/sh PIN=$1 /usr/local/bin/gpio mode $PIN out /usr/local/bin/gpio writeb$PIN 0 sleep 0.5 /usr/local/bin/gpio writeb$PIN 1
This is telling RPI to close the circuit, sleep 0.5 seconds, then open again I was using 0.3 but failed to activate the remote - might be the remote control battery tho!