Sunday, June 14, 2020

Building control system for the DSKY, based on an Arduino

REQUIREMENTS TO SET OR UNSET RELAYS IN THE DSKY MODULE

The relays in the Relay Module are wired into an array, with seven rows and five columns of relays. In addition there are another column of relays used for other purposes such as lighting the sign segments For our purposes, we will use just six rows of five to light up the two PROG digits, two VERB digits and two NOUN digits. We will also make use of two relays to control the sign in front of the R1 row on the display, and use the flashing relay to make VERB and NOUN flash on and off. 

These are organized so that we select a column by pulling its control line to ground. Overly simply, select a row by feeding +14V. The relay coil at the coincidence of the energized row and column will activate. 

These are latching relays, meaning that they have both a SET and an UNSET control line for the row. To turn on a specific relay, we select its column by grounding the line and provide +14V to the SET line for the row. If we later want to turn it off, we ground the column line and provide +14V to the UNSET line for the row. 

Although each digit on the display has seven segments, the Relay Module uses only five relays to control them. There are eleven valid five bit codes that can be set into a row of relays, for the ten numeric digits and for an unlit condition. The wiring inside the relay contacts converts those five bit codes into seven discrete segment connections. 

USING TRANSISTORS TO SWITCH +14V AND GROUND TO THE RELAY COILS

I want to use an Arduino to programmatically set and unset the relays, forming digits to display on the Electroluminescent Panel module. That microcontroller won't tolerate 14V levels, so I need some method to control the higher voltage by sending signals at +5V. I could have set up 20 relays to drive the +14 and ground requirements for the Relay Module but decided that, due to the low current of these relays, I could use common low cost transistors. 

WIRING UP ARDUINO TO THE TRANSISTORS AND TESTING

I set up 8 NPN and 24 PNP transistors with their bases biased to be off by default. I used a set of breadboards for convenience. Six of the NPN are used to select the six rows for the digit displays, while two are used to select the relays for the horizontal and vertical lines of the sign character. Five pairs of NPN-PNP set the bits of a display code, another five NPN-PNP pairs unset those bits, and there are two NPN-PNP pairs to set and unset the relays for the horizontal and vertical sign segments. 

The reason for using pairs of transistors with the NPN-PNP circuit is that I am switching high side +14V with an input that can't go above +5. I need a first NPN transistor with emitter at ground, biasing the base down to ground so it is by default off. When the first conducts, it pulls the base of the second (PNP) transistor down to ground, causing it to conduct. Normally the base of the second transistor is pulled up to +14V, the same as the emitter. 

I used an LED plus resistor as a load to verify that my circuit is by default off but will conduct to light the LED when +5V is delivered to the base. Similarly, I used the LED and resistor for the PNP circuits to verify that it is off by default but provides voltage to light the LED when ground is hooked to the base. 

WIRING UP TRANSISTORS TO THE DSKY RELAY MODULE AND TESTING

Fortunately, one can faintly hear a click as the relays in the module are switched from set to unset or vice versa. That allowed me to check out all the control lines from my Arduino. I temporarily wired in one row with a column set and unset, verifying the sound of the relay latching and unlatching. 

Next I took some hours to carefully wire up all 32 transistors and their associated resistors and power connections. I finally had all the parts and wires set down on the breadboard, ready to begin testing.

No comments:

Post a Comment