A relay can be used to switch higher power devices such as motors and solenoids. If desired, the relay can be powered by a separate power supply, so, for instance, 12V solenoids can be controlled by the microcontroller.
Activate a Relay
The following program will activate a FET or Darlington transistor connected to output B.1, which in turn will activate the relay, for a second every five seconds.
A 5V relay may be connected via a BCX38C darlington transistor create module (buzzer connected shown here).
Bill of Materials
|Miniature 6V Relay SPDT||REL001||1||Buy Now|
|BCX38C Darlington driver transistor||TRT002||1||Buy Now|
|1k resistor (pack 100)||RES1K||1||Buy Now|
|1N4001 diode||RES041||1||Buy Now|
Submit Your Own Code!
You must be logged in to submit code examples. Login now.