EXAMPLE USE OF THE PPIO

Figure 5 shows a simple use of the PPIO to create an automatic Heating and Air Conditioning system. The top relay controls the Air Conditioning system. The other relay controls the heating system. The top thermostat controls the Air and the bottom one controls the Heat. On the PPIO I/O two and three are outputs to control the relays. PPIO I/O zero and one are inputs that are controlled by the thermostats. The way the automatic system should work is that if the temperature is above 78 degrees the Air should be on. When the temperature is below 72 degrees the Heat should be on. When the temperature is between 72 and 78 both the Heat and the Air should be off.

Each PPIO output can handle up to 500 mA. This means that the relays have to take less current than that at 12 volts. You also should not exceed 2.25 watts of dissipation in the PPIO. To measure this turn on a relay with the PPIO and measure the voltage from the PPIO I/O pin to your power supply ground. You should get a voltage around 1.5 volts. If you multiply the voltage you read above by the current the relay draws you will have the dissipation of that PPIO I/O pin. For example, if you measure 1.65 volts and your relay draws 100 mA then 1.65*0.1 equals 0.165 watts. If you add up all of the PPIO loads THAT CAN ALL BE ON AT THE SAME TIME you should not have more that 2.25 watts. In our example you should not have both relays on at the same time (you would have the Heat and Air both on at the same time!) so you only need to worry about the dissipation of one relay.

Figure 6 shows some GWBASIC code for a simple way to control the Heat/Air system. Line 100 was explained before. Line 120 forces all the PPIO outputs HIGH (or OFF) so that when you start the program both relays will be OFF. It is also needed so that PPIO I/O zero and one can be used as inputs. Lines 160-180 input the data on all eight PPIO I/O points and puts it in variable IB. Line 190 forces all bits except the first two to ZERO. This leaves only the status of the two thermostats.

At this point IB can only be equal to zero, one, two, or three. If it is ZERO then both PPIO I/O inputs are HIGH and both thermostats are open. This means that the temperature must be below 72 degrees and we want the heat ON - see line 210. The only way IB can equal one is if PPIO I/O bit zero is ON (LOW) and bit one is OFF (HIGH). If bit zero is closed the temperature should be above 78 degrees and the other thermostat should be on also. If we get this condition something must be broken so we turn off both the

PPIO2899 Manual

29

B&B Electronics Mfg Co Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104

Page 30
Image 30
B&B Electronics PPIO manual Example USE of the Ppio