Driving Solid State Relays

 Solid-state relays that require a DC input voltage to operate may be controlled by ADR interfcaes. The relay must be able to operate with a DC input of 4 volts ( 3-32 Volts is typical) and an input current of under 20mA. The relay must be rated with the proper voltage and current ratings for whatever load is to be controlled. Each relay will require one digital I/O line to operate. In the example below a relay is connected to PA0 and the sample program demonstrates how the relay is turned on. Note that the I/O line is set high before the CPAxxxxxxxx command configures the line as output. This is to ensure the relay is not energized inadvertently when the port is configured and PA0 is low. The sample program uses an ADR101.

 7Ssr.gif (5469 bytes)

10 OPEN "COM1:9600,N,8,1,CS,DS,RS" AS#1
20 REM  SET PA0 SO RELAY DOES NOT ENERGIZE
30 PRINT#1, "SETPA0"
40 REM CONFIGURE I/O LINE AS OUTPUT
50 PRINT#1, "CPA11111110"
60 REM TURN ON RELAY
70 PRINT#1, "RESPA0"
80 REM TURN OFF RELAY
90 PRINT#1, "SETPA0"
100 END

Back to Applications Page