Serial port controlled AC power outlet strip

Serial port controlled outlet strip.

Another old project. This is a modified power strip that allows to control each of its six outlets independently via a serial port. The outlets are controlled with TRIACs. There is no heat sinking so it can only handle relatively low power loads. I had no problems using it with 60W lamps, but the original purpose was to automatically turn off my soldering irons (25-50W), which very often I left connected, hot and forgotten for days in some cases.

I've posted the schematics, and firmware source code.

Originally I built this 8051 based circuit during September 2000. This thing has been shelved for a long time. In theory this is a really simple and trivial project but it can be troublesome to package all of its parts inside a common power strip. At the moment I got a cheap power strip that had round and flat prong compatible outlets.

Originally the circuit was directly soldered to a perforated board.

Original control circuit seen from top.

Not that bad, but if you lift the board...

Original control circuit, lifted.

Some of those wires carry 220VAC and some are part of the digital circuit. So I was undestandably concerned about powering it again, after so long a time. So I decided to remove that and make a PCB. Some of the TRIACs were also shorted, so I decided to change them.

Here is how it looked before I reworked it.

Power strip with original control circuit.

I simply copied the old circuit to KiCAD. Next image shows the schematic.


Power strip, KiCAD schematic.

Then I hand routed the PCB.

Power strip, KiCAD PCB.

The finished single sided PCB:

Power strip, finished PCB.

The completed circuit, now much cleaner and safer, not ideally though:

Power strip, new circuit completed.

The power strip completed.

Power strip, all circuits completed.

Fully assembled and working.

Power strip, fully assembled and working.

I later realized that I forgot to put two pullup resistors for the pins P1.0 and P1.1 of the ancient AT89C2051 microcontroller. It was necessary to add those later.

Power strip, KiCAD PCB.



As can be seen the circuit is as simple as RS232 interface, microcontroller, buffers and optoisolators. The optoisolator interconnections shown in the schematics are good for BTA134 sensitive gate TRIACs. As I couldn't find those in local stores I ended up using the BTA136 which are non-sensitive gate TRIACs that require a different circuit. In this case the common connection is removed and each TRIAC is connected directly to an optoisolator. I didn't put any snubber, so it is safe to use with resistive loads only. The transformer is from a cheap 250mA AC to DC converter and the output is selected so at the regulator input it measures 8.5VDC.

Firmware

To turn on an outlet it is necessary to send a 55H followed by the number of the outlet (0 to 5) and to turn off an outlet send a 54H followed by the outlet number. There is no permanent memory in the microcontroller, so whenever it is power cycled or when a reset occurs for any reason, all the outlets are disabled.


$MOD51
$TITLE(SERIAL STRIP)
; ROLANDO CALLA Z/ LPB / 15-9-2000
ORG 0
JMP INIT


;***********SER INT VECTOR***********
ORG 23H
CLR EA
JBC TI,TED
CLR RI

MOV A,SBUF
SUBB A,#52H
MOV B,#4
MUL AB

MOV DPTR,#CMD
JMP @A+DPTR

CMD:
ACALL DEVID
AJMP WAITTI
ACALL LINEV
AJMP WAITTI
ACALL TURNON
AJMP WAITTI
ACALL TURNOFF
AJMP WAITTI
ACALL SETREADY
AJMP WAITTI
ACALL SETNOTREADY
AJMP WAITTI

WAITTI: JNB TI,WAITTI
CLR TI

TED:
SETB EA
RETI
;***********SER INT END***********


INIT:
MOV P1,#07FH
SETB P3.5
MOV TMOD,#00100000B
MOV TH1,#0FDH
MOV TL1,#0FDH
CLR P3.4
SETB TR1
SETB EA
SETB ES
MOV SCON,#01010000B
MOV SBUF,#0A1H
WAITTI2: JNB TI,WAITTI2
CLR TI

LOOP:
MOV R2,#0FFH
MOV R3,#0FFH
WAIT:
DJNZ R2,WAIT
DJNZ R3,WAIT
CPL P3.4
JMP LOOP


;***********ISR***********
DEVID:
MOV SBUF,#0A0H
RET

LINEV:
MOV SBUF,P3
RET

TURNON:
WAITRI: JNB RI, WAITRI
CLR RI
MOV R0,SBUF
MOV A,#0FEH
SETBIT:
RL A
DJNZ R0,SETBIT
ANL P1,A
MOV SBUF,P1
RET

TURNOFF:
WAITRI2: JNB RI, WAITRI2
CLR RI
MOV R0,SBUF
MOV A,#1
SETBIT2:
RL A
DJNZ R0,SETBIT2
ORL P1,A
MOV SBUF,P1
RET

SETREADY:
SETB P1.7
CLR P1.6
MOV SBUF,P1
RET

SETNOTREADY:
SETB P1.6
CLR P1.7
MOV SBUF,P1
RET

END

Windows application

Programmed in Turbo Delphi, a very simple standalone application that detects the strip and sends commands.

Power strip, Windows application.

Power strip, the software settings.



Warning (stern!)

Circuits that control 110-220VAC devices using TRIACs or other components can be very dangerous, if you are not so experienced with this type of circuits, find some knowledgeable person to help you to do it safely.

Bookmark and Share