Home
For this site:
Site-info & copyright
Change your settings,
Setup
links to related subjects on this site:
webserver manual
mailserver manual
links to other subjects on this site:
Bird pictures
Insect pictures

Remote Lichtswitch

Remote wallplug switches becrome more available and affordable.
Most of them are conected as piggy-back in the wall-plug. Some can be built inside the wall instead of normal switches.


Why .....?

I used to connect lights on a timer .. a disaster ! so they are usually doing reasonable, but not right.

However, the Edimaxh does know the exact date and time from a time-server on the Internet. You never have to compensate for drift.
The Edimax lso knows about daylight savings time.
And the Edimax can compute (if its position on earth is provided) the times of sunset, dawn, twilight, on each day of theyear.

So: get rid of those timers, let Edimax do the work.

Additional advantage: you can control your lamps (or other equipment: computers, coffee-machines, ...) control with a WEB-page, even remote ! Try it yourself in the demo below.


Demonstration

(thanks to J. de Bruyn for offering is lamp to Science).

Click on the picture to start the demonstration.

(please do not switch it on and off for a long time, so Jelle can finally finish his book).

click for lager picture TitelLamp is OFF Date2007:04:15 12:29:18 click here to switch the lamp ON


Start

First the GPIO wires must be made available on a common mouse connector. See here to make that modification in the Edimax.
Then we attack the remote control box of the remote light-switch set. (center).

click for lager picture TitelRemote control 220Volt OnderwerpElektronika LocatiePijnacker Date2007:04:11 21:17:57 Remote control set with piggy-back wall-plugs.


If you have some old mouse with a ball: do NOT throw it in the bin ! The wire and (molded) connector is very usefull for connecting the GPIO ports on the Edimax. (a real mouse has infra-red eyees these days).
By acceident I found an old ICL mouse with a wire with the following olours:


And of course the last part ... the Edimax !


Power supply

The 9 Volt battery is replaced by a 78L09, getting its power from the 12 Volt adapter of the Edimax. Thus saving an extra adapter, and freeing the space inside the remote control box for some electronics. And, of course, batteries wear out.

The remote control box gets a male and female connector, so you can it put in-between the Edimax and its original power adapter.

The optocouplers can be mounted on a piece of printed circuit-board for experimental usage, and will fit into the battery compartment easily.

click for lager picture TitelRemote control 220V OnderwerpElektronika LocatiePijnacker Date2007:04:11 19:17:45 Power supply is 'patched through': the adapter-plug in the right, and the wire for the Edimax on the left.


Control

The version I own has a multiplexed keyboard with 4 on-switches and 4 off-switches to switch 4 independant channels on and off.
That means, some wires have more than one function. Electrically the buttons are in 4 rows and 2 columns (different from the layout of the buttons in the box !):
Column 1Colom 2
Row aChan 1 ONChan 3 ON
Row bChan 1 OFFChan 3 OFF
Row cChan 2 ONChan 4 ON
Row dChan 2 OFFChan 4 OFF

A PC817 is an optocoupler: a LED and a light sensitive transistor in a black box. The LED can be controlled by the Edimax. The transistor replaces the button on the remote control.
In a PC847 are four optocouplers. We can connect them to 4 LED's of the Edimax, and so switch 2 independant channels.
More wall switches can be adjusted to a single channel, making them all switch on and off at the same time.


Description:

Remark: only 4 buttons are used, so only 2 channels. That means half of the remote control !

click for lager picture TitelRemote control 220V OnderwerpElektronika LocatiePijnacker Date2007:04:11 19:17:20 The mouse-connector wire goes to the LED's inside the 4 opto-couplers (all in 1 chip). The transistors of the opto-couplers ae parallel to the buttons.


Assembly

Make a hole in the side for the power-bus, and 2 more for the wires.
Solder de parts on a piece of experimenting cuircuit board, with the size of a 9 Volt battery.
Solder the Led's (anode, at the dot) with a resistor to the '+', and the other side to the GPIO ports.
The light sensitive transistors are on the otger side of the chip. Connect each of them parallel to a button. ('+' and '-' sensitive, and choose corresponding buttons).
Then close the lid again.

click for lager picture TitelRemote control 220V OnderwerpElektronika LocatieP.v.Geens Date2007:04:11 19:59:07 The new electronic fit in the battery compartment, and deliver 9 Volts as well !
Clearly can be seen: the chip with the 4 optocouplers on the left, with wires to the keybord left of it, and wires to the12 Volt bus connector on th eright.

Closed again

All parts assembled ... the one screw that is left-over: thow it away. Apparently you didn't need it.

On the left is the 12 Volt connector for the adapter. iAttached is the blach 12 Volt wire for a patch-through connection to the Edimax.

The grey wire is inherited from a deceised mouse, and now connected to the opto-couplers.

click for lager picture TitelRemote control 220V OnderwerpElektronika LocatiePijnacker Date2007:04:11 20:35:18 Done ! Looks professional.


Almost attached

Disconnect the power supply from the Edimax, and connect it to the remote control.
Connect the remaining power connector back into the Edimax.

click for lager picture TitelRemote control 220V OnderwerpElektronika LocatiePijnacker Date2007:04:11 20:36:05 Take out the 12 Volt from the Edimax ...

Connected

After connecting the power, put the mouse-plug in the GPIO chassis-part of the Edimax.

click for lager picture TitelRemote control 220V OnderwerpElektronika LocatiePijnacker Date2007:04:11 20:37:29 ... adapter in the bus of the remote crontrol, and the 12 Volt wire back in the Edimax again.

And the mouse-connector too.


Software

To control the buttons, each button must be 'pushed' for a second alone (without pushung other buttons at the same time).
Do so by switching a GPIO port 'on' for a second:
	echo  1 > /dev/GPIO_n
	sleep 1
	echo  0 > /dev/GPIO_n
	sleep 1
In this example channels 2 nd 4 of the remote control are connected as follows:
channel 3 on
echo  0 > /dev/GPIO_1
sleep 1
echo  1 > /dev/GPIO_1
sleep 1
channel 3 off
echo  0 > /dev/GPIO_3
sleep 1
echo  1 > /dev/GPIO_3
sleep 1
channel 4 on
echo  1 > /dev/GPIO_10
sleep 1
echo  0 > /dev/GPIO_10
sleep 1
channel 4 off
echo  1 > /dev/GPIO_11
sleep 1
echo  0 > /dev/GPIO_11
sleep 1

Remark: The GPIO-ports 1 and 3 are inverted, so '0' and '1' are interchanged.


Meaning of the colours:New or changed text since last visit (see user settings at top of page).
Edimax stands for the BR-6104KP with USB
Sweex means LB000021 and compatibles without USB.
white text is part of a file on disk.
For remarks please click Here email: philip@geens.nl