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 !
- those clocks must be corrected to the real time once and a while,
- they don't know about daylight savings time,
- they don't know days become longer in summer nd shorter in winter
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).
| Titel | Lamp is OFF |
| Date | 2007: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).
| Titel | Remote control 220Volt |
| Onderwerp | Elektronika |
| Locatie | Pijnacker |
| Date | 2007: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.
| Titel | Remote control 220V |
| Onderwerp | Elektronika |
| Locatie | Pijnacker |
| Date | 2007: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 1 | Colom 2 |
| Row a | Chan 1 ON | Chan 3 ON |
| Row b | Chan 1 OFF | Chan 3 OFF |
| Row c | Chan 2 ON | Chan 4 ON |
| Row d | Chan 2 OFF | Chan 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:
- The numbers on the left are the pins numbers of the 'mouse' connector
on the GPIO port.
- The resistors protect the LED's from high curent:
270 Ohm.
- In the black box are four opto-couplers.
- On the right are 8 switches of the remote control (to switch 4 channels on and off),
configured in 2 rows of 4 columns.
They are connected with diodes to the chip.
- The red wires enable the light sensitive transistors to simulate the original buttons.
- Finally, the 9 Volt stabilizer is at the bottom.
Remark: only 4 buttons are used, so only 2 channels.
That means half of the remote control !
| Titel | Remote control 220V |
| Onderwerp | Elektronika |
| Locatie | Pijnacker |
| Date | 2007: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.
| Titel | Remote control 220V |
| Onderwerp | Elektronika |
| Locatie | P.v.Geens |
| Date | 2007: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.
| Titel | Remote control 220V |
| Onderwerp | Elektronika |
| Locatie | Pijnacker |
| Date | 2007: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.
| Titel | Remote control 220V |
| Onderwerp | Elektronika |
| Locatie | Pijnacker |
| Date | 2007: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.
| Titel | Remote control 220V |
| Onderwerp | Elektronika |
| Locatie | Pijnacker |
| Date | 2007: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