hir_CCS1R_Wiring_F Derivation of the CCS Schematic Ver F by D@CC on 2021CMar07 This is version F of the Wiring Diagram for the Computer Controlled Switch (CCS). The wiring diagram is high-resolution. The purpose or use of this circuit is to permit a Computer to function as an alternate switch for a "Remote Switch". The "Remote Switch" is normally used to control power to a Load via a pair of wires. The power used to control the Load is either beside the "Remote Switch" or beside the "Load". The device called the CCS will be inserted somewhere between the "Remote Switch" and the "Load" after the pair of wires is cut. The CCS has 2 pairs of "screw terminals", one pair on the Left and one pair on the Right. The two "screw terminals" on the Left are called Terminal 1 (TR1) and Terminal 2 (TR2). The "Remote Switch" is connected between TR1 and TR2. The "Load" is connected between TR3 and TR4. The Computer is connected via a USB connector, that also provides +5V. Auxiliary Power is supplied is the form of a "Power Supply" providing 15v of AC power. This Auxiliary Power is connected to screw terminals TR5 and TR6, if necessary. The CCS must be built from the following electronic parts: Power Sense circuit Opto-Isolator circuit Relays and Switches Logic chips of type HC. LEDs, Resistors, Capacitors, Diodes, FWRs. GROUNDS This circuit introduces the reader to the complexity of Grounds. A simple circuit using a battery seldom has more than 1 ground. But when connecting the CCS to the Load, the Load has its Ground. The Load's Ground may be connected to the "True Earth Ground" by the ground prong if it is plugged into the house wiring. The CCS has its own Ground which may be different from the "True Earth Ground". The situation is further complicated by the connection to the Computer via the USB cable. The computer's Ground will probably arrive at the CCS through the wire labeled Gusb. The question is "Can we connect these 3 Grounds together?" The way to answer this question is by using a multi-meter to measure the voltage between each pair of Grounds. If the voltage is less than 1 volt, there is no problem. If it is more than 1 volt, enlist the help of a qualified electrician. The concepts and steps to be followed are: 1. Sense various voltages and convert the results to Logic signals. 2. Use Logic signals to control relays that eventually control the "Load". The "power sense" circuit senses the value of toits p input with respect to (w.r.t.) the bottom input, setting the output logic True or False 3. Suggestions to use when crafting the initial circuitry: A Sense the voltage across TR1-TR2 to decide if the Remote Switch is "ON". Call this logic point RS (i.e. Remote Switch On) B Sense the voltage across Dusb-Gusb (in the USB connector) to decide if the Computer Switch is "ON". Call this logic point CS. (i.e. Computer Switch On) C Decide where the Power Source is. Is it with the "Remote Switch" or the "Load" If it is a " Powered Load" call this logic point "Cpow" and, using software, turn the "LEDpow" LED on to indicate this fact. If it is not a "Powered Load" call this "NOT LEDpow" and turn the LEDpow LED off to indicate this fact. Much more is said about this Cpow and LEDpow logic later in Step 12 below. 4. Sense (Using Power Sense circuit) the voltage at Dusb w.r.t Gusb. If its Rectified value is > 0v, turn on logic Point CS. (i.e. set it True). Connect TR2 to RSsense with a wire. Consider the Case of a "Powered Switch" in Step 5. 5. Sense (Using Power Sense) the voltage at TR2 w.r.t RSsense. If the Remote Switch is Closed, the voltage sensed of the Rectified value is > 0v; this turns ON logic Point RS. If the Remote Switch is Open, the voltage sensed is 0v, this turns OFF logic Point RS. This works correctly in the Case of a "Powered Switch". But there is a problem: If the "Powered Load" is True, then "Powered Switch" is False. This means that the "Pow" beside the "Remote Switch" doesn't exist, it is just a wire. This case of "Powered Load" means that TR2 w.r.t. TR4 is always either 0v or an open circuit, depending upon whether or not the "Remote Switch" is open or closed. Therefore RS is always False. Step 6 needs to remedy this situation for a "Powered Load". 6. If a voltage (e.g. 1.4v) is connected between TR2 and RSsense, one can distinguish between open and closed. If the Remote Switch is open, the Power Sense will sense "Open" which is 0V. If the Remote Switch is Closed, the Power sense will sense 1.4V. So RS is True if Closed and is False when Open. This is the correct result in the case of a "Powered Load". But this should NOT happen in the case of "Powered Switch". Step 7 needs to remedy this situation by allowing for the case of a "Powered Switch". 7. Consider if Switch 7 (side A) is inserted (as in the schematic diagram) between the 1.4v and TR2. If the Upper contacts of Switch 7A are closed in the Case of a "Powered Load", this will cause the 1.4V power to be only included in the "Remote Switch" sensing circuit in the case of a "Powered Load". In the case of a "Powered Switch", the 1.4v will NOT be in the circuit, so the result will be 0v setting RS False.This will solve the problem. But Switch 7A must be set up correctly when the CCS device is installed (see Step 11 much farther down). But more logic is needed to turn on the Load. For this see Step 8. 8. Consider how to turn on the LOAD. If Logic Point Lsw could provide power directly to TR3. The whole CCS device might work correctly. But many other factors must be considered. See Step 9 to consider these other factors. 9. Consider this case. The situation is "Powered Load". Connect Lsw to the coils of a relay called L. Connect the Contacts of L between TR3 and TR4. When Lsw is True, the Load is turned ON. This is the desired result. When T3 is False, the Load is turned OFF; which is also good. But consider the Case of "Powered Switch". Between TR3 and TR4, on the right there is a Load but no Power. So when Lsw is True, the Load will not turn ON. In the case of "Powered Switch", we need to use the CCS power that exists between TR5 and TR6. Step 10 will resolve this issue. 10. Create the following logic circuitry D. Create logic point Lsw = RS OR CS. When Lsw is True, the Load should be turned ON. When Lsw is False, Load is turned OFF. E. A complicated switch will now be used. The switch is a Double Pole Double Throw (DPDT) type of switch. The Double Pole means that the switch is not a simple ON/OFF; each of the two positions (Poles) of the switch connect to a different choice of wires. A switch could have many Poles (e.g. 10) permitting the switch to be connected to 10 different wires. Now consider if you neeeded to have 2 switches, each having 10 Poles. If you "ganged" together 2 switches, both switches would be switched at the same time, if the first switch were switched to Pole 3, the second switch would also be switched to Pole 3, keeping them always "in sync". Of course, there could be any number of "gangs" in a complex switch. In our case, we only need 2 "gangs". Instead of saying "gangs" of switches, the official term is "throws". So we need to use a 2P2T (i.e. DPDT) switch. Consider the first throw as being "side A" and the second throw as being "side B", instead of using the more elusive "gang" or "throw" expressions. Use DPST (side B) of Switch 7 (S7) UP to select "no extra power" for the Remote Switch. Remember in Step 6 that S7B UP means "Powered Load". But some power is necessary for the Load. Therefore DPST (side A) Switch 7 (S7) DOWN must select the Auxiliary power from CCS between TR5 and TR6. So we can call this part of the circuit (between TR5 and TR6) "CCS Power". F. Put the "CCS Power" in series with the LOAD (between TR3 and TR4). This goes to be left of TR3 in the schematic diagram. Now this combined circuit can always have power through the LOAD (depending on the state of S7). S7 is always switched UP when there is a "Powered Load". When S7 is Down, there is a "Powered Switch" but when the Computer will be switching ON the Load, the Power beside the Remote Switch will not be usable.) That is why we need the "CCS Power". Call this longer circuit (that includes the "CCS Power") by the name "Load always with Power". This means that this longer circuit will always turn ON the Load if the two ends of this circuit are "closed" by the pair of relay contacts in the relay "L" G. Turn relay L ON by connecting logic point Lsw through the relay coil then to Logic Ground. When Lsw is True, Relay L will close its set of contacts. This will provide power to the Load (whether or not S7 is UP or DOWN.) 11. This circuit now does exactly what we need. Let's review the 4 cases: switch R-S: OPEN/CLOSED with "Powered Load": TRUE/FALSE. For now, we will ignore the Computer Switch CS by setting CS=False. Remember that the Logic part of the schematic is "Lsw = RS + CS" which means: Lsw = RS OR CS (If either of the logic points, RS or CS, is True, Lsw is True) Case 1 R-S OPEN: Powered Load: TRUE ------------------------- S7A and B are both UP. When Remote Switch is OPEN - RS is FALSE - Lsw is FALSE - Relay L OFF - CCS Power Unused - Load is OFF Case 2 R-S CLOSED: Powered Load: TRUE ------------------------- S7A and B are both UP. When Remote Switch is CLOSED - RS is TRUE - Lsw is TRUE - Relay L ON - CCS Power Unused - Load is ON Case 3 R-S OPEN: Powered Load: FALSE ------------------------- S7A and B are both DOWN. When Remote Switch is OPEN - RS is FALSE - Lsw is FALSE - Relay L OFF - CCS Power Unused - Load is OFF Case 4 R-S CLOSED: Powered Load: FALSE ------------------------- S7A and B are both DOWN. When Remote Switch is CLOSED - RS is TRUE - Lsw is TRUE - Relay L ON - CCS Power Used - Load is ON It is a simple matter to consider what happens when CS is TRUE or FALSE with a "Powered Load" Case 5 CS is TRUE is exactly the same as Case 2 above so: ------------------------- S7A and B are both UP. CS is TRUE - Lsw is TRUE - Relay L ON - CCS Power Unused - Load is ON Case 6 CS is FALSE is exactly the same as Case 1 above so ------------------------- S7A and B are both UP. When CS is FALSE - Lsw is FALSE - Relay L OFF - CCS Power Unused - Load is OFF The other 2 Cases are similar but the "Powered Load" is OFF. But one issue remains. How is Switch S7 initially set Up correctly? Step 12 will addrss and resolve this issue. 12. During Set Up, at installation time, the Remote Switch is OPEN and either there is a "Powered Load" or a "Powered Switch". The following logic is needed. I. the Power is sensed at TR3 w.r.t. TR4 using the "Power Sense" logic. A "Powered Load" will cause some voltage > 0v to appear between TR3 and TR4. J. The results of the Power Sense pass through an Optical Isolator (in case Ground problems exist). A "Powered Load" will turn the logic point LEDpow TRUE. When LEDpow is TRUE, the logic point Cpow will turn True. The software will see this and will turn on the LED that is driven by LEDblu. LEDblu will light up. At installion time this indicates that there is a "Powered Load". Later, during operation, this LED will turn ON and OFF. It is only at installation time that it will tell us for certain whether or not there is a "Powered Load". K. If the LEDblu LED is ON, switch 7 must be set in the UP position which sets both "sides" (side A and side B) of switch S7 in the UP position meaning "Powered Load" during initialization (i.e. during initial set up). If LEDblu is not lit, at installation time, switch S7 must be switched DOWN not UP. S7 DOWN means "Powered Switch" LESS ESSENTIAL LOGIC Some additional logic is needed to make CCS more "user friendly". This logic will be addressed in Step 13. 13. The first addition is a White LED. Then a blink circuit is added to make LEDblu blink whenever a switch turns on the Load. L. A White LED (named LEDwht) has been added. The White LED means "Panel Fully Operational". Some may think of it as an ON/OFF indicator for the CCS. It has been given an additional function. A tiny DIP switch, S6, controls LEDwht. If switch S6 is ON (i.e. closed), logic point Pfull becomes true and LEDwht turns on. If S6 is OFF, the CCS ignores the computer switch, named "CS". The LED LEDwht, is off to indicate that the computer cannot control the LOAD, only the Remote Switch will control the Load. Note that Pfull AND CS must be ON for the computer to control the load. This logic does not require any logic gates; it is done using software logic. K. The blink circuit produce a "square wave" that turns ON for 30 seconds, then OFF for 30 seconds. The output of this circuit is logic point "Blink". It controls the blue LED (named LEDblu), When either the RS or CS switch turns ON the Load, the Blue LED will turn ON, but instead of staying ON, the Blue LED will blink. This occurs because the software logic uses the logic point named Blink and the logic point Lsw to cause the Blue LED to blink. L. One thing that was not explained above is the use of the Blue LED (named LEDblu) to indicate that there is a "Powered Load", by keeping the Blue LED ON to indicate that there is a "Powered Load". This is also accomplished by the software logic. Whenever a switch turns on the Load, the Blue LED blinks, regardless of which type of Power exists ( a "Powered Switch" or a "Powered Load"). CONCLUSION This circuit will handle ALL of the logic cases. It can easily be seen that two Power sources ("CCS Power" and the Power near either of "Load" or "Remote Switch") can never be "fighting" in the circuit at the same time. Furthermore, either the "Remote Switch" or the "Computer Switch" or both can turn on the LOAD because the LOAD can only be driven (ON) when logic T3 is TRUE. Note that the Power Sense of the "Remote Switch" should also go through an Opto-Isolator into RS. It might be simpler to just include the Opto-Isolator logic in the Power Sense logic. One design or manufadturing concern might be the inclusion of the DPDT switch S7. This switch could be replaced by a DPDT solenoid (either internal or external) or a DPDT relay driven by the LEDpow logic point. SIMPLE CASE OF CCS2 The main criteria for the CCS2 will result in the following circuit simplifications: 1. CCS2 is only for a "Powered Load" (NOT a "Powered Switch"). 2. For a non-changing "Powered Load", S7 is always UP, so no CCS Power is needed for this circuit. 3. The "Remote Switch" circuit could use any small voltage in place of 1V4 (1.4 volts) 4. No switch S7 is needed because it is always UP 5. No switch S7 means the Power Sense and Opto-Isolator driving the LEDpow are not necessaryily needed. But if they are in the CCS2, then they will verify whether or not a "Powered Load" exists. 6. The other 2 Power Sense circuits can be replaced by simple non-inverting gates in the CCS2. These HC logic gates can serve as (voltage) level converters where necessary. 7. The gate driving Lsw should be of the type SN74AHC541N described in my Article 156 (Source 07) That article describes the use of the SN74AHC541N gate in much more detail. 8. The TR4 screw terminal shown in the Voltage Sense circuit has been replaced by a logic Ground. 9. Having eliminated S7, CCS Power and the LEDPow circuitry, relay L can be simplified as follows: Relay L (driven by Lsw or Lext) can be replaced by the following connections: Lsw internally connected to TR3 Ground internally connected to TR4. An external relay or solenoid (similar to the SSR40 mentioned earlier) connected between TR3 and TR4 10. Knowledgable Technicians can use the CCS2 to drive the following devices: A the Powered Loads described above. B solenoid that controls higher voltage Powered Loads (e.g. 110V or even 3 phase higher voltage). C relays that can be driven by a 5v signal. In some cases the Power Sense will not be able to sense the voltage of the Powered Load. Indeed, the simple "Remote Switch" driving a "Powered Load" addressed by CCS2 needs a very simple circuit. Fortunately, many of the electrical switch circuits encountered can be handled by the simple CCS2 model of the Computer Controlled Switch. Source 01: hir_CCS1R_Wiring_E.odg Schematic Diagram by this Webmaster Source 07: Article 156 Pi Pico via a Pi uart by this Webmaster Source 09: Ti SN74AHC541N IC Data Sheet /hir_CCS1R_Wiring_F.txt