Computer Controlled Switch ver C by D@CC on 2021BFeb28 LEFT RIGHT LEDs LEDs SWITCH ------------------------------------------------------------\ LOAD T1-(upper)-| Red Panel Red >-(upper)-T3 "Powered" / switch wires Yellow --"Switch"---- Panel Yellow | load wires | test | "Powered" | T2-(lower)------Green---- (button) | ----Load-----Green--- (lower)-T4 | | test | Violet | \ (button) Blue [Pow.Load] | |------>------------------------------ White [Locked] Power OFF/ON (upper)-T5 computer S9 USB USB S8 Yellow power source wires cable S4 5v Green Panel S2 Green (lower)-T6 Computer S1 test S0 Violet (button) SWITCH LOAD T1 Red O O Red T3 Yel O S9 O Yel T2 Grn O PB0 S8 PB1 O Grn T4 Vio O S4 O Blue S2 O White U S1 T5 S S0 O Yel 15v AC Connector B Grn O PB2 O Grn T6 O Vio page 1 ****************************************************************************************** Normal LEDs states: ON BLINKING ------------------ ------------------------------------ ------------------------- Powered LOAD BLUE , UPPER RIGHT GREEN (or YELLOW) none BOTTOM LEFT GREEN with AC Power Supply LOWER RIGHT GREEN (OR YELLOW) TOP LEFT GREEN (or Yellow) BOTTOM LEFT GREEN LEFT VIOLET, RIGHT VIOLET without AC Power Supply BOTTOM LEFT GREEN TOP LEFT GREEN (or Yellow) LEFT VIOLET, RIGHT VIOLET, Note 1: The RED LEDs are only lit (meaning bad wiring) during installation. Note 2: The White LED is always lit: to indicate when the control panel is Locked Note 3: The Blue LED is always lit: to indicate when the LOAD is powered. It changes state when the load is turned on/off. Note 4: The other LEDS, Push-Buttons and DIP switches (except S0) are not active (not examined) when the panel is locked. The only DIP switch that is active while the panel is locked is S0. Note 5: status of all the switches, push-buttons, analog-inputs and LEDs are controlled and be examined by the software in the Pi Pico. The CCS software is Micro-Python software that resides in the computer that is connected to the CCS via the USB cable. ******************************************************************************************** Variants of the CCS The CCS System has 3 types of software: a) the config environment which is a data file defining the CCS functionality b) the CCS micro-python code that is resident in the Pi Pico. c) the CSC python code that runs in the host computer (such as a Raspberry Pi) Note that the CCS device is designed to run independently of the any host computer, not needing the attention of its host computer. But at any time, the host computer can interrogate the CCS and can control its "computer switch". The host computer can even modify the set-up and software in any CCS. A log of limited length is maintained by the CCS. This log file can be requested for upload by the host computer. Neither the format of the log nor the host computer software yet been designed nor written as of 2021BFeb28. CCS-1 the full=featured CCS with all LEDs, push-buttons, switches & external 15v ACPower Supply. When in panel-LOCK mode, its software displays the "CCS panel" by simulating the LEDs, push-buttons etc. In panel-LOCK mode the CCS-1 functions exactly as a CCS-3. In panel-LOCK mode, the CCS-1 can function exactly like a CCS-2, but only if it has a "powered LOAD" driven by 5v. Every CCS model (1,2 and 3) are designed to continuously run unattended. Although a host computer can communicate with the CCS at any time. The CCS cannot initiate any action in the host computer. It is a complete slave to the host computer. Page 2 CCS-2 the blue minimum CCS with 2 leds (Blue, White), no push-buttons, no DIP switches, No AC Power Supply, using only 5v USB Power. It only controls "5v powered LOADs". The software and setup for this CCS is preprogrammed. Its software displays the "CCS panel" by simulating the LEDs, push-buttons etc. The USB cable must provide 5V and bi-directional data. CCS-3 the black full-featured CCS has the full functionality of the CCS-1, including both "powered Switches" and "powered Loads", but only with 2 LEDs (Blue and White), all 6 DIP switches and the 15v AC Power Supply. All it is missing is the control panel. Its computer software displays the "CCS panel" by simulating the LEDs, push-buttons etc. One can install the CCS-1, fully defining its set-up. Then the CCS-1 can be replaced with the CCS-3. Installation Instructions (You might need a licensed electrician to do the PREREQUITE for you) NOTE Electronics technitians should note that each Blink of the Violet LEDs is not exactly 1 volt. But to provide compatibility with the "double-diode" totem pole, each blink is 1.4 volts, which is the value of 2 silicon diode when conducting. 15 "double diodes" provides a voltage range of 15 x 1.4v = 21v. This means that the existing CCS desing could make use of a 21v AC Power Supply. However 15v is probably more cost-effective. PREREQUISITE: Use a voltmeter to test the voltages on both the SWITCH and LOAD wires. If the voltage is higher than 15v on any of these wires, you need help. If it is arount 110v AC it is a dangerous situation, you really need help. To eliminate the 110v situation, an an AC solenoid driven by a low DC voltage eg 5V should be installed. Such a solenoid could coast as low as $20.00 . You probably should NOT do this wiring yourself. The switch wiring and the switch might even need to be changed. If the voltages are 15v or less, you can safely continue. Starting Point for set-up. . . 0. Turn OFF switches S0,S1,S2,S4,S8 and S9, Disconnect any AC voltage source from terminals T5 and T6. 00. Use the USB cable to connect the CCS USB port to your laptop or remote computer with 5V. 1. Connect the remote SWITCH wires to terminals T1 and T2 If one of the LEFT Red, Yellow or Green LEDs lights up You have probably mixed up the SWITCH and LOAD pairs. So redo Step 1 with the other pair of wires. If any LEDs still light up, get help. . . the wiring is strange If all the LEFT Red, Yellow and Green LEDs are not lit; continue page 3 2. Have an assistant press (or turn ON/OFF the remote switch If one of the LEFT Red, Yellow or Green LEDs might lights up This indicates that power comes from the remote switch, continue to Step 3 If none of the LEFT Red, Yellow or Green LEDs light up You have probably mixed up the SWITCH and LOAD pairs. If you keep "going in circles" in these steps, get help. . . the wiring is strange If not, redo Step 1 with the other pair of wires. 3. Count the blinks on the LEFT Violet LED. The number of blinks is the voltage from the SWITCH If the LEFT Red LED is lit, interchange the two SWITCH wires on T1 and T2 to change their polarity The LEFT green LED should now be lit If only the yellow LED is lit, the power from the switch is alternating voltage, not DC. 4. If none of the LEFT LEDs is on, this indicates a powered LOAD. Connect the LOAD wires to terminals T3 and T4 One of the RIGHT Red, Yellow or Green LEDs might light up This indicates that power comes from the LOAD side Count the blinks on the Right Violet LED. The number of blinks is the voltage from the LOAD If the RIGHT Red LED is lit, interchange the two LOAD wires on T3 and T4 The RIGHT green LED should now be lit If the yellow LED is lit, the power from the LOAD is alternating AC voltage. ***** The SWITCH and LOAD wires are now properly connected to terminals T1,T2,T3 and T4. ************* 5. Turn OFF switches S1,S2,S4,S8 and S9, Disconnect any AC voltage source from terminals T5 and T6. ***** If the Blue LED and the Upper right Yellow or Green LED is lit, the LOAD is powered ********* If the LOAD is powered, no Power Source is needed, no USB power is needed: Disconnect any Power Supply from terminals T5 and T6 and Turn OFF switch S9 (USB power), Then Go to Step 12 6. If DC and (under 6v): no AC power source is needed, but USB power is needed: Turn ON switch S9 (USB power) If (6v DC or more) or any AC voltage: Turn off switch S9 (USB Power) Furthermore, the AC power source is needed. If an AC power source is needed, connect the AC power source to terminals T5 and T6 If no AC Power Source is needed disconnect all wires from terminals T5 and T6 7. If the Blue LED is OFF, the SWITCH is powered, so the correct voltage must be set. Count the blinks of the LEFT Violet, this is the voltage of the power source that needs to be set. Three cases might exist, either A all the Power is supplied from the USB, so USB switch (S9) is ON Go To Step 11 or B all the Power is from the Power Supply so USB switch (S9) is OFF Go to Step 8 or C the Blue LED is ON (The LOAD is self powered) In this latter case, setup is complete. Goto Step 15 page 4 8. If either the upper LEFT Green or Yellow LEDs is lit, the AC power source is necessary and its voltage must be set. Goto Step 11 If upper LEFT GREEN is ON and voltage blinks under 6v, no power source is needed Otherwise a 12v AC Power source is needed 9. Connect the appropriate Power Source, if needed. 10. The Red, Yellow and Green LEDs on the BOTTOM RIGHT should match those on the TOP LEFT after the Remote Switch has been pressed. If not, redo all the previous steps correctly. 11. The voltage level must be set. This is done by resetting the CCS. The CCS is reset by disconnecting and reconnecting it's cable. 12. The SWITCH is powered. Ask someone to turn ON / OFF the Remote Switch The (LEFT) Violet LED blink count is the voltage of a Powered Switch. To make the LEFT Violet LED start blinking, Turn the Remote switch briefly ON then OFF The (RIGHT) Violet LED blink count is the voltage of the CCS Power for the LOAD To make the RIGHT Violet LED start blinking, either the AC Power Supply must be connected or the USB Power Switch must be turned ON 13. If both Violet blink counts agree, Setup is complete. . . goto Step 15 If they both do not agree, the voltage of the USB or Power Supply must be set. 14. Begin by setting the voltage Supply to its highest voltage, To do this, turn OFF swithes S1, S2, S4 and S8 Count the blinks of the RIGHT Violet led. This is the voltage being supplied by either the USB or the power supply. If it is not higher than the voltage being supplied by the powered Remote Switch Then the CCS cannot supply enough Power! Buy a different device instead of the CCS. If the voltage of the AC Power Supply is higher than the voltage supplied by the Switch, Do each of the following steps to reduce the voltage of the AC Power Supply: Turn S8 On (to drop it by 8 volts), if it matches the powered Remote Switch, Go to Step 15 If it is too low, Turn S8 off again Turn S4 On (to drop it by 4 volts), if it matches the powered Remote Switch, Go to Step 15 If it is too low, Turn S4 off again Turn S2 On (to drop it by 2 volts), if it matches the powered Remote Switch, Go to Step 15 If it is too low, Turn S2 off again Turn S1 On (to drop it by 1 volt), it should match the powered Remote Switch, Go to Step 15 The above steps ensure that voltage of the Power Source agrees with the Remote Switch. Now, the number of blinks of the LEFT Violet LED should match the RIGHT Violet LED 15. Set Up is Complete. page 5 TESTING THE CCS To test the properly configured CCS: A. Reset the CCS by disconnecting and reconnecting its USB cable. B1. If the Blue LED is ON and the Green LED near it are ON. (This means that the LOAD IS POWERED) B2. Press & release the Panel Test Button near the RIGHT Green LED that is LIT; The LOAD should turn ON and the Blue LED should turn OFF. B3. Press & release the Computer Panel Test Button. The LOAD should turn ON and the Blue LED should turn OFF. B4. Press & release the Remote Switch The LOAD should turn ON and the Blue LED should turn OFF. C1. If the Blue LED is OFF and the LEFT Green LED is BLINKING, (This means that the SWITCH IS POWERED) C2. The RYG LEDs in the top left should match either those in the bottom LEFT or those in the bottom RIGHT If they match those in the bottom RIGHT, the AC Power Supply should be connected. If they ONLY match those in the bottom LEFT, the USB Power switch (S9) should be ON C3. Press & release the Remote Switch Button The LOAD should turn ON and the Blue LED should turn ON. C4. Examine the two Violet LEDs. They should both be blinking the same number of times. C5. Press & release the Panel Test Button near the LEFT Green BLINKING LED. The LOAD should turn ON and the Blue LED should turn ON. C6. Press & release the Computer Panel Test Button. The LOAD should turn ON and the Blue LED should turn ON. Finally: To LOCK the console, Set S0 to ON. This turns off all of the LEDS, and prevents the CCS from sensing any of the other DIP Switches, and prevents the CCS from sensing any of the 3 push buttons (PB0, PB1 and PB2.) The MicroPython CCS software can still read any of these inputs and can control all of the LEDs. MATERIALS NEEDED FOR CCS Installation - A Violet or blue Computer Controlled Switch is needed - A 110v AC 15 Amp solenoid might be needed. (from: BC-Robotics:SSR-40DA) Get one turned ON by +5V DC. - A power supply might be needed. If so, it will be a 12v-20v AC power supply - A laptop or computer is needed but only for installation - A USB cable is neeed for computer control. - CCS software from MCM180R2 needed for a Raspberry, PC, or Mac - A screwdriver page 6 MATERIALS NEEDED TO MANUFACTURE A CCS 1 Pi Pico 2 SN74AHC541N High Speed AHC octal Non-Inverting Line Drivers 2 octal 360 ohm resistors 15 LEDs (2-red 3 yellow, 4 green, 2 Violet, 1 blue, 1 white) 3 photo-cells. These photo-cells use digLight drivers providing only 0/1 output data 3 7K5 resitors for the photo-cells 30 Diodes for the totem-pole double-diode voltage droppers 1 hex DIP switch 1 normal size USB connector 4 "screw" terminals to attach wires 1 full-wave rectifier 1 connector for 15v AC 5 amp power supply with 110v plug 1 pre-designed PCB NOTE INTERNAL PI PICO RESOURCES USED (21 of the 26 Pi Pico GPIO Pins) 3 GPIO analog input sensors (all 3 Pi Pico ADC lines are used by the CCS) 3 GPIO Pins as Digital inputs (push-buttons) 13 GPIO Pins as Digital outputs (Driving LEDs) 2 GPIO DIP switches as Digital inputs --- 21 Total GPIO pins (leaving 5 for future use) It also uses 4 additional DIP switches to control the double diode voltage-reducing AC totem pole. /ComputerControlledSwitch_C.txt page 7