A receiver built into a box with an outlet

This receiver was originally used in conjunction with a box which provided a constant current to illuminate ornaments. The box was controlled by a cable plugged into phone jack. This setup became obsolete; see the Display Cabinet Receiver.

The second output is a relay driver which controls one side of the duplex outlet. The other side is not switched. The power supply is plugged into it.

Originally the hanging lamp was plugged into the controlled outlet, but this lamp is now controlled by the Display Cabinet Receiver, so this device is shelved.

Picaxe Program

#rem  Hanging lamp.bas This is the single outlet in the wood box

Use 9200N power supply 

Use with 7-position rotary transmitter CCW position

John Saunders 1/5/2015 Added phone jack output for LED current source ; phone jack 5V

#endrem


#picaxe 08M2


'Output Ports

symbol Relay        = C.1

symbol Eggs         = C.2


'Input ports

symbol Rcvr_In     = C.4


'Variables

symbol Lamp_on     = bit0

symbol Eggs_on     = bit1

symbol Rcvr_Val    = b1


init:

SETFREQ m8

LOW Relay

LET Lamp_on   = 0                      

SETINT  %00001000,%00001000    'Interrupt when C,3 high


main:

IF Lamp_On = 1 THEN

    HIGH Relay

ELSE

    LOW Relay

ENDIF     

IF Eggs_On = 1 THEN

    HIGH Eggs

ELSE

    LOW Eggs

ENDIF     

GOTO main


Interrupt:

PAUSE 10    'There is a 10 ms gap before the code to allow the serin to execute

LET Rcvr_Val = "Z"

SERIN [100,NoAscii],Rcvr_In,N2400_8,("14L1776"),Rcvr_Val

IF Rcvr_Val = "C" THEN

    LET Lamp_on = 0

ENDIF

IF Rcvr_Val = "I" THEN

    LET Lamp_on = 1

ENDIF

IF Rcvr_Val = "9" THEN

    LET Eggs_on = 0

ENDIF

IF Rcvr_Val = "d" THEN

    LET Eggs_on = 1

ENDIF

PAUSE 300

NoAscii:

SETINT  %00001000,%00001000    'Interrupt when C,3 high

RETURN