
Adding a relay interface shield to the ColorMax
In part 1 it was mentioned that the ColorMax is a great (modern design) retrocomputer for interfacing to the real world. Using the Arduino Shield area on top of the ColorMax, it is easy to interface to a relay module shield.

Pictured are two relay shields that I pulled from my collection. They both control 4 relays and they both use the same lines to do so. I had really hoped that they would use different lines so that I could stack them and control 8 (or even 16) relays total. It would have been great if the design of the relay board could have included some option to select other control lines.
The front board uses “D4 through D7” (Arduino nomenclature) to turn the relays on and off. Translating to the ColorMax pin numbers, the control lines are 25, 26, 27, and 28. The “translation” from Arduino numbering to ColorMax numbering is here: http://circuitgizmos.com/documentation/hardware-datasheets/cgcolormax2-technical-information/cgcolormax2-pin-outs-and-functions/

So here is my setup for this article. A VGA monitor and a small PS2 keyboard attached to a ColorMax (on an anti-static platform). The Arduino Shield footprint on the ColorMax is populated with headers to accept the Relay Shield. The ColorMax is powered by a 12V supply and connected to a PC via USB.

With the ColorMax bare naked, the relay board is installed onto the headers. That leaves the relay board ready for control by BASIC.
The simplest way to check out the operation of the relays is to use the immediate mode of basic (and the VGA display with PS2 keyboard) to set the control line direction to output and then write a 1 to turn the relay on and 0 to turn it off. At the basic prompt on the VGA
1 |
SETPIN 25,8 |
The relay turned on with:
1 |
PIN(25) = 1 |
And turned off with:
1 |
PIN(25) = 0 |
Next blog: PC control.