Remote Power Control Unit
(exercise extreme caution if creating one of these units due to direct connection to the power line)
This device controls the power to 8 individual outlets. There are 16 power levels available for each one.
Connection is made via 9600 baud serial using a din-5 connector. A single byte sets the power level for any of the 8 channels. Also, a global command sets all the power levels at once.
A device like this is effectively the 'back end' for many projects. By using different 'front end' systems, it could be a color organ, theatrical lighting device, home mood lighting controller, or anything else you like it to do.
As you see from the schematic , it receives its power using transformerless circuitry floating directly on the power line. You need a 1:1 isolation transformer at a minimum to build one of these devices. Often, using a 60 volt isolation transformer is desirable: you get enough power to test the circuit without exposing yourself to full line voltage while testing and construction.
The data connection is made via opto coupler using a standard 5 pin DIN connector. Since this is an optically coupled, balanced line, it is wired identically to a MIDI connector (but at a different data rate). It connects directly to either rs-232 or TTL serial at 9600 baud. (See hookup diagram on schematic).
Commands are all singe bytes as follows (this supersedes any notes in the file):
Bit 7 Global if set Bit 4-6 Select channel 0-7 Bit 0-3 Set power level 0-15
Bit 7 is normally cleared and the channel number and power levels are set at the same time for a single channel. If bit 7 is set, the power level is applied to all channels at once (a nice way to turn everything off).