Controlling the Relay
Please is there anyone that knows the right syntax code to use to switch the poles of a relay. Am using a single pole double throw relay.
This is my code: My input pin is connected to port 11 and the··ground is connected to VSS using a basic stamp board 2·but it is not sending any voltage to the relay to switch the poles so am guessing it is my code.···
Main:
·· HIGH 11
·· pause 500
·· LOW· 11
···Pause 500
·· GOTO Main
··
This is my code: My input pin is connected to port 11 and the··ground is connected to VSS using a basic stamp board 2·but it is not sending any voltage to the relay to switch the poles so am guessing it is my code.···
Main:
·· HIGH 11
·· pause 500
·· LOW· 11
···Pause 500
·· GOTO Main
··
Comments
Most relays require more current than a microcontroller like a Stamp can supply. You need to use a switching transistor and a diode to prevent the relay from damaging the Stamp's I/O pin. Go to the main Parallax page and click on the Resources tab. You'll get a list of links. Click on the "Nuts and Volts Columns" link and locate and download Column #6. That discusses how to use a Stamp to control relays and small motors. The schematic on the last page of the article shows one simple example of what you need.