IT: Computer Controlled Switch (CCS) (158.html)

Keywords: Raspberry, Pi, Pi Pico, CCS, Computer-Controlled-Switch, Computer, USB, LED

Introduction

The Computer Controlled Switch (CCS) has been designed to be inserted in any switched circuit in a building. Some examples of such switches are described in this article. The first example of a switched circuit (where the CCS could be inserted) is a 5v DC Doorbell circuit. (Some doorbell chimes use 12 volts AC, which is a different case.) A second example of a switched circuit (where the CCS could be used) is a 5V DC thermostat that controls a fireplace. A third example is the use of a "solenoid" to turn on-and-off a loud-speaker. Brief descriptions of the second and third applications follow. Then the doorbell application will be described in vivid detail.

Application Case II: 5v DC Thermostat

A thermostat is a special type of switch that is automatically switched On when the temperature is too low. When the thermostat turns On, the heater (e.g. a nearby fireplace) begins to warm up the area. As the area warms up, the thermometer in the thermostat reacts to the increasing temperature. When the temperature is high enough, the thermostat turns Off. This turns off the fireplace. Often there is a manual switch that can be used to turn on/off the fireplace. A CCS can be used to remotely control the fireplace. Instead of using the manual switch, a computer can command the CCS to turn on/off the fireplace.

Application Case III: Controlling the volume of an electronic speaker in a home office.

The author apologises in advance for contriving this application. Consider the situation where a speaker has been installed in room which is now a "home office".This speaker and other speakers play music throughout the whole house from a central music system. The person works at a desk in the middle of the room that is the "home office". The person wishes to turn off this speaker when talking on the phone. Some kind of switch is needed to do this, but the installation of a simple "speaker switch" at the desk would require the installation of unsightly audio wires running across the floor. A Raspberry Pi computer already exists in an adjacent room near the wires driving the speaker. A CCS can be connected to a USB port on the Raspberry. One solution is to buy an inexpensive SSR40 solenoid (Source 04) that is described below under the heading "AC/DC Solenoids From the Orient". One wire of the pair of speaker wires can be connected to pass through the solenoid. The solenoid can be connected to the CCS which is connected to the Raspberry Pi computer via the USB cable. Finally the computer on the desk in the home office can use existing Remote Desktop Connection (RDC) software via the home router to wirelessly control the Raspberry Pi. A "diagram" is shown below:

    Computer
     running    wireless                  wireless     Raspberry    USB    ....CCS....    Wire   ..40 A..    Speaker
      RDC. . . . .  . . . . . router . . . . . . . . . . Pi-USB------------USB TR3/TR4============SSR40==================Speaker
      On       connection                connection    Computer    Cable   ..Switch...    Pair   Solenoid     Wires
    Desk In        to                        to
    Home
    Office

This is a lengthy solution, but most of the equipment already exists today in a modern house. The only thing that needs to be purchased is the 40 Amp SSR40 Solenoid. The Remote Desktop Connection (RDC) software already exists in every Windows computer. RDC can be used to remotely control the Raspberry Pi from the desktop of a Windows Computer.

This CCS in this "speaker" application can be connected to the SSR40 solenoid via the terminals TR3/TR4 of the CCS. But the SSR40 Solenoid differs from the previous applications in that it is NOT a "Powered load". Like many modern solenoids, the SSR40 needs its voltage to be supplied by the device that is controlling it (which is the CCS in this case). Fortunately, the CCS (even the CCS2) can provide a low voltage (2V-5V DC) power source for the SSR40. So the CCS2 can control an "Unpowered Load". Other examples of the CCS2 driving aN "Upowered Load" exist but they might be less familiar to many people.

Another solution is to treat the Speaker as if it were a "Powered Load" which it is. The simpler diagram of this solution is shown below:
                                                                                                Amplifier
    Computer                                                                                       ||
     running    wireless                  wireless     Raspberry    USB    ....CCS....   Speaker   ||
      RDC. . . . .  . . . . . router . . . . . . . . . . Pi-USB------------USB TR3/TR4=============--====Speaker
      On       connection                connection    Computer    Cable   ..Switch...    Wires
    Desk In        to                        to
    Home
    Office

In the diagram above, one of the wires from the Amplifier must be cut. Then another pair of wires must be connected to the CCS. The exact wiring is described in more detail in the Installation Notes. This solution does not need any additional solenoid to be purchased. The CCS2 itself is the whole solution.

Application Case I: 5v DC Doorbell circuit

Of the 3 models of the CCS, the simplest one, the CCS2 is usually inserted in a circuit that uses 5v DC. Furthermore, the circuit must have the 5V Power Supply beside the load (the chimes), not beside the doorbell switch. The former is called a "Powered Load". The latter is called a "Powered Switch". Many Doorbell chimes serve a front door and a back door. Such Chimes are always powered by a "Powered Chime" which is a "Powered Load". A question arises: "Why use a CCS if the doorbells function just fine "as is"? The CCS permits a computer to also be used to turn on the doorbell chimes.

The PURPOSE of the CCS is to permit computer control of an electrical switch.

The Panel of the CCS can be set in fully operational model or not. When switch S6 of the CCS is Off, the CCS is not in fully operational mode. In this mode the CCS obeys the Remote Switch, just as if the CCS were not installed. In this mode, the computer switch is ignored.

The CCS2 will only power "Unpowerd Loads" that need 5 volts (5v0). The CCS1 and CCS3 will handle a range of AC and DC voltages. Much more is said later about how the CCS devices address the myriad Load Voltages that one encounters in a building's switches. For more information, see the heading: Measuring the Load's Voltage.

SAFETY FIRST

The only type of switched circuit that the CCS cannot easily handle is a case of AC line voltages of 110v AC or as high as 240v AC. These voltages can easily be deadly. In these cases, you are advised to hire a professional electrician. Please do this for safety's sake. Voltages under 25 volts are much less dangerous. The CCS devices can handle the high voltages, but an electrician should do the installation.

AC/DC Solenoids From the Orient

Many computer controlled switches (like the CCS devices) for AC line voltages (such as 110V AC) use an external solenoid that is controlled by 5v dc. Any of the 3 CCS switches can drive most of these solenoids with 5v DC. This is because 5v-driven solenoids are very compatible with all 3 CCS devices, even the CCS2. BC-Robotics (Source 03) provides a small range of solenoids such as the 40 A solenoid, shown below, (at a cost of CAD$15.95) which is described in Source 04. A full range of inexpensive solenoids are available from SparkFun. A datasheet describing such solenoids can be seen at Source 05. Even 3 Phase 240v AC solenoids (controlled by 5v dc) can be seen in Source 05. This same Datasheet is locally stored on the WebMaster's website at Source 06, in case the Datasheet at SparkFun is moved to a different website location by them.

(To enlarge .....Click it)
thumb: ssr-40-300x300.jpg
ssr-40 40 A solenoid

The CCS2 model of the Computer Controlled Switch

The CCS2 is the most common version of the CCS. It is the least expensive to buy and is the simplest to install. The CCS has been designed with the Raspberry Pi computer in mind. But a Windows, Apple or Linux PC can also be used to control a CCS. A USB port on any of these PCs can be used to control a CCS. The prerequisites of the situation (to use a CCS2) are:

Computer Controlled Switch (CCS)

The schematic drawing (shown below) is included to show other electronics designers how the CCS has been designed. It is not necessary to read nor understand this schematic drawing in order to use the CCS devices.

Note that the drawing below (on the left) has deprecated (replaced) an older schematic (the older one was dated 2021CMar7) for the CCS (shown next).

(To enlarge .....Click it)
thumb: hir_CCS_Load_Power_J.jpg
hir_CCS_Load_Power_J.odg Power Schematic for the CCS


(To enlarge .....Click it)
thumb: hir_CCS2wAnlg_H.jpg
hir_CCS2wAnlg_H.odg CCS2 Schematic


The drawing below illustrates how the CCS switch is connected to the Remote Switch and the Load. It is a generic drawing that includes all of the cases: Powered Switch, Powered Load and even the CCS2 that operates without a power supply. In the case of the CCS2, Relay A is not included and Relay C is replaced by a simpler relay with only 1 set of contacts (i.e. only one line is switched).

To make use of the generic schematic below, simply ignore or cross out either the Powered Switch or the Powered Load to make the drawing agree with your situation. If you are using the CCS2, ignore or cross out the power supply circuitry (leaving only the top set of points of relay B.) The schematic should now agree with your electric circuit and the model of CCS that you are using.

(To enlarge .....Click it)
thumb: hir_CCS1R_Wiring_F.jpg
CCS Schematic


Source 08 "Derivation of the CCS Schematic Ver F" is a text document that describes in detail the thought process that resulted in the above schematic for the CCS. It also describes the evolution of the greatly simplified CCS2 model.

Panel of the CCS

The panel of the CCS1 is shown below. It is the most sophisticated model of CCS. The CCS2 has a much simpler panel (shown after the CCS1).
      SWITCH		   S11	     LOAD
      				 
   TR1	Red O  	      S9	O Red    TR3
	Yel O	      S8	O Yel
   TR2	Grn O	PB0   S7   PB1	O Grn    TR4
	Vio O	      S6   	O Blue
		      S5        O White  Lext
   		      S4
   U		      S3
   S		      S2	O Yel	 TR5
   B	Grn O	PB2   S1	O Grn	15v AC Connector
				O Vio	 TR6

    The CCS1 Panel
************************************************
      SWITCH			     LOAD      *
      		      S9		               *
   TR1    	      S8	         TR3   *
	   	      S7 na                    *
   TR2	 	      S6   	         TR4   *
	 	      S5   	O Blue         *
		      S4        O White  Lext  *
   U		      S3
   S		      S2	    	       *
   B		      S1	   	       *

************************************************
    The CCS2 Panel                             *
************************************************
The various terminals, connectors and LEDs of the CCS2 are explained below: One switch is noticeably missing on the CCS2 is switch S11. The S11 switch is needed in the non-CCS2 models because the power to the load is either AC or DC in these models. Furthermore the switching of the load is different whether the Load is powered or not. Switch S11 must be set according to whether the Load is Powered or Not. It would be easier and less expensive to provide two models, an AC model and a DC model of the CCS. But the problem is that many people installing the CCS would not know which one to buy. This is because a CCS is needed to determine (figure out) which one to buy. Perhaps the cost of manufacturing the CCS will be the deciding factor. The author of this design doesn't want to tell the future owners that they should first buy an AC model and a DC model. Then just return the one that wasn't needed. That decision will be put off to another day.

For any technicians who have examined the above schematic, the "Open SW Sensor" and the "Blink Circuit" are not needed and are not included (or an ultra-simple version is included) in the CCS2.

CCS switches

In all models of the CCS there are 8 tiny DIP switches that must be set up correctly at installation time. DIP switch # 7 is unused. This is because models CCS1 and CCS3 deal with DC voltages higher than 5V and all AC voltages. These models keep the switched voltages separate from the logic voltages. A more complex switch (not a tiny DIP switch) is needed for S7 in the cases of CCS1 and CCS3.
Switch Usage
S1,S2, S4 and S8 are all used to drop a number of volts going to the Load. S1 drops 1.4v, S4 drops 5.6v etc
S3 is used only by the CCS2 model. It must be Closed if the "Load is Powered". Close S3 to pass 1.4 volts (from Vusb) at .1 mA to the Power Sensor of the Remote Switch.
S5 is closed when POWdc is needed by the Load, so the CCS2 can provide power to an Unpowered Load.
S6 is closed (Pfull is True) when the Panel is fully operational (CS is active and can turn on the Load)
S7 is used to tell the CCS that the Load must be powered by a DC Voltage (Not an AC voltage)
S11 must have it's contacts shorting together when it is a "Powered Load". On the schematic, this is shown by the "lever" of the switch being Down.

CCS2 Schematic

(To enlarge .....Click it)
thumb: hir_CCS2_E.jpg
hir_CCS2_E.odg Schematic for the CCS2


Pico Logic in CCS2

To use the CCS, you don't need to understand any of the computer logic described below. Feel free to skip these logic paragraphs. The names and meanings of each logic element in the CC2 are shown below:


Name	Meaning of Logic Element of this Name
------  ---------------------------------------------
Blink	Blinks on/off at about 1 Blink/Sec (but might be always On [True] in CCS2)
CS	Computer Switch is ON
Dusb	Computer Data USB requests to switch On the Load
Gnd	All Logic is measured wrt Gnd [False]
Gusb	Ground in the USB cable
LSW	(A switch is On) i.e. (Remote switch is On) or (Pfull and Computer Switch [i.e. Dusb] is On)
	    The Load should be truly On [Remote Switch, Computer Switch and Pfull all agree that the Load should be On]
LEDwht	white LED is ON: CCS Panel is fully operational.  When Off, the Computer Switch is ignored).
LEDblu	blue  LED is ON: (Constant On: Load is not powered) or Blinking: (Load is visibly On (Lb) AND (Not Powered Load)
Pload	Load type is "Powered Load"
Pfull	True if DIP switch S6 is On [Panel is fully operational].  If S6 is Off, the Computer Switch is ignored.
RS	Remote Switch is ON
Vusb	always True (source of True logic) in the USB Connector.  It is also the Source of Power when the Computer
	Switch is On and the Load needs DC power to function.

The logic in the CCS2 is performed by the Pico Processor as shown below:
Blink  Square Wave: Blinks on/off at about 1 Blink/Sec (but might be always On [True] in CCS2)
Dusb   is either in the state that the Computer Switch is requesting or
		the computer has sent a command to the Pico that the Computer Switch is On.
Gusb   is  Ground in the USB cable
Pload   is the state of DIP switch S9 showing that the Load is Powered
Pfull  is the state of DIP switch S6 showing that the Computer Switch should NOT be ignored.
RS     is the state of the Remote switch
Vusb   always True (a source of Power and True logic) in the USB Connector
************** Logic "Above" is CCS2 Logic,     Logic "Below" is Pico Logic **************
CS       Computer Switch is ON (derived from Dusb)
LSW    = RS + ( Pfull . CS )
LSWdc  = LSW . POWdc
LSWac  = LSW . Not(Powdc)
FILLblu = LSW . Pload . Not(Blink)
LEDblu = BLink . LSW + FILLblue + ??(was Cpow) . Not(LSW)
LEDwht = Pfull

******************************************************************************************
NB Shouldn't use DC relay to switch an AC load *******************************************
******************************************************************************************

Measuring the Load's Voltage

A new concept used in the CCS is measuring the Load's Voltage in "blinks". The more expensive CCS models measure the Load's voltage and display it to the operator, on the CCS Panel, by making a LED blink a certain number of times. You just count the blinks.

One might think that "1 blink" means "1 volt". This is almost true. Actually "1 blink" means "1.4 volts" which is quite close to "1 volt". Lets say that the LED blinks 10 times. This means the Load's Voltage is actually 14 volts. But the CCS suggests that the voltage is said to be "10 blinks" instead of 14 volts. One might ask "Who cares what the Load's Voltage is". Well, when the computer provides the Voltage, it must provide nearly the exact correct voltage to the Load. This is alsolutely necessary when the Load is Powered by the Remote Switch. The problem is that the Power Supply accompanying the CCS1 (and CCS3) will be a 14 (or 15) volt AC Power Supply. This AC Power Supply can provide up to "10 Blinks" of Voltage. This will probably be too high a voltage for the Load. So you must know your Load's required Voltage.

During installation, the CCS1 and CCS3 will measure the Load's Voltage. . . Perhaps your Load's Voltage is "6 Blinks" (which is actually 8.4 Volts). So the Maximum Voltage from the CCS AC Power Supply is "4 Blinks" too high. This is because 10 - 6 = 4. The purpose of the TOTEM POLE switches is to reduce the voltage. This is done in increments of 1.4V (which is in groups of "1 Blink".) The CCS "AC Supply Voltage" can be reduced by "4 Blinks" by closing the switch S4. Yes S4 will drop the voltage by "4 Blinks" which is the required voltage reduction of 8.4V (because 14v - 5.6v = 8.4v). After closing S4, this reduced voltage is exactly the required Load Voltage of your switched circuit. Don't worry if you don't completely understand this. The CCS Installation Procedure simplifies it.

The four diodes that are used to drop 1.4 volts are normally used as a full-wave rectifier (FWR) as shown below on the left. The Totem "diamond" (shown on the right) is simply a normal FWR "diamond" (shown on the left) after its bottom part (the lower 2 diodes) has been rotated 180 degrees on a vertical axis. Note: after changing its bottom half, each unit of the totem device cannot be wired incorrectly. LOL

(To enlarge .....Click it)
thumb: FWR_Out_Across.jpg
FWR AC In vertically

(To enlarge .....Click it)
thumb: FWR_Out_AcrossTT.jpg
FWR Totem Top-In Bottom-Out


In fact, to install the CCS2, there is not any need to reduce any voltage, because the CCS2 only furnishes 5V DC to the LOAD (An AC Load is not supported). For Loads needing voltages other than 5V DC, install the CCS1 or CCS3.
The CCS installation instructions will show you how to hook up the SWITCH and LOAD wires correctly (with the correct polarity). This ensures that the CCS supplies the correct type of voltage (AC or DC) as well as the correct number of volts. It even helps you correct cases of wrong polarity. When using a CCS1 or CCS3, one other thing that you don't need to worry about is whether your Load's Voltage is AC or DC.

The instructions that come with the CCS even show you how the CCS1 or CCS3 can detect wrong polarity. Then it will show you how to connect the wires to the terminals to correct any polarity issues.

Pi Pico

The Pi Pico shown below is the tiny inexpensive microComputer (in the CCS) that "talks" to the computer. It also is the brains of the CCS. It examines the switches and controls all the LEDs and relays in the CCS. After installation, it does all the work for you.

(To enlarge .....Click it)
thumb: PiPico.jpg
PiPico.jpg

Buffers for the Pi Pico

The text under this heading is only for electronics technicians. The Pi Pico is very sophisticated, but has some serious electronic shortcomings. One shortcoming is its poor ability to drive any electronic devices other than logic gates. To overcome this weakness, buffer gates need to be used to drive electronic devices such as LEDs or relays. The article 156 in Source 07 by this Webmaster recommends the use of the ...AHC541N gate as a 541 AHC buffer for the Pi Pico outputs. Furthermore the input pins of the Pi Pico must never "see" voltages higher than Vpico (i.e. 3v3 which is the Vcc for the Pi Pico) plus delta. When 3v0 is the Vcc for the ...AHC541, a True (i.e. 1 = high) input is any voltage over 2.1v; a False (i.e. 0 =low) input is any voltage under 0.9v . How to guarantee that the input levels are kept within tolerance? The outputs driving ...AHC541 gates (using a Vcc =3v0) should be protected with output clamps as follows:
        clamp an excessively high input by passing current through a diode towards + 2v1.
        	the input gate won't see a voltage higher than 2v8
        clamp an excessively low input by passing current through a diode from  + 0v9
        	the input gate won't see a voltage lower than 0v2

        These diode clamps guard against voltage extremes (but not against high frequency transients).

         NOTE that the diode clamps shown below protect for Vcc=3v3 as well

          HC Input 3v0 Protection          Vcc=3v0
                                                  |
                                     max          |
            high protection level    2v8__________|      high
                                                  |      high
                                                  |      high
                                                  |      high    high
                          2v1        2v1----------|--------------threshold
                         __|__                    |        ?
                           ^                    __|__      ?
                          / \                   |    \_    ?
                         -----                  |      \   ?
           unprotected     |      protected     |       |  ?
           ----------   ---|--------------------|  Gate |-----------output
            input	 __|__      input       |       |  ?
                 	   ^                    |     _/   ?
                          / \                   |____/     ?
                         -----                    |        ?
                           |                      |        ?     low         
                          0v9        0v9----------|--------------threshold
                                                  |      low
                                                  |      low
                                     min          |      low
             low protection level    0v2__________|      low
                                                  |       
                                            0v0___|___
                                                _____
                                                 ___
                                                  v

How to provide the 1V4 for the "Remote Switch" Power Sense circuit?

The solution is up to the electronics technician who first creates a prototype of this circuit.

Installation of the CCS2

The installation instructions have not yet been well-documented. Furthermore, none of the software has been written. Source 02 by the Webmaster shows some of the initial considerations and some initial thoughts about the installation of an earlier version of the CCS1. Beware that some of the circuitry and names of logic elements have been deprecated.

References

Books/Newspapers

Books/Newspapers 01: none

YouTube Videos

Source V01: ....Pico Reading Temperature ..... by "LearnElectronics" seen on 2021CMar10 (thanks to M. Asper)

Web Sites

Web Source S158:01: Raspberry Pi Pico BOARD Datasheet by Raspberry Pi Association
Web Source S158:02: Computer Controlled Switch ver C by D@CC on 2021BFeb28
Web Source S158:03: Solenoid Supplier: BC-Robotics by D@CC on 2021BFeb28
Web Source S158:04: 40 A 380V AC Solenoid SSR40 from BC-Robotics perused by D@CC on 2021CMar03
Web Source S158:05: Solenoid DataSheet from SparkFun perused by D@CC on 2021CMar03
Web Source S158:06: Solenoid DataSheet from SparkFun (local copy) perused by D@CC on 2021CMar03
Web Source S158:07: Article 156 Pi Pico via a Pi uart by D@CC on 2021CMar03
Web Source S158:08: Derivation of the CCS Schematic Ver F by D@CC on 2021CMar03
Web Source S158:09: Ti SN74AHC541N IC Data Sheet revised by ti on 2015ISep
Web Source S158:10: PI: Monitor Freezer Temperatures (and other similar) 11th Mar 2021 by Ashley Whittaker
Web Source S158:11: Airmeter on GitHub (Monitor Remote Temperature) by Camden 12th March 2021
Web Source S158:12: PIO on the RP2040: Bit Banging Click "What is PIO" by Alex Bate 2021C Mar 09
Web Source S158:13: PIO on the Pico: Bit Banging from HackSpace by Ben Everard Jan 2021
Web Source S158:14: (Non-Pico) RP2040 Boards from Raspberry Pi Foundation on Mar 2021

WebMaster: Ye Old King Cole

Click here to return to ePC Articles by Old King Cole

Created 2021 C Mar 02
Updated 2021 D Apr 16
(c) ICH180R2 Corp

/158.html