Relay 3 Click Board
Relay 3 Click Board
The Relay 3 Click Board™ is a dual relay Click Board™, featuring two single-pole double-throw relays which can be operated by output pins of the host microcontroller (MCU). It offers an elegant and easy solution for controlling a wide range of power applications. Two SRD-5VDC-SL-C relays used on this Click Board™ are hermetically sealed relays that require 5V across their coils while consuming about 0.4W while active. They allow up to 28VDC across the connected load, while conducting up to 7A.
Relay 3 Click Board™ can be used in various PLC-based systems, as a remote ON/OFF switch, and other similar applications.
Software Support
We provide a library for the Relay 3 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library contains functions for turning on/off relays 1 and 2. The library contains functions for turning on/off relays 1 and 2 after a defined period of time.
Key Functions
void relay3_relayOn( uint8_t relay_ )
- Turns selected relay on.void relay3_relayOff( uint8_t relay_ )
- Turns selected relay off.void relay3_onDelay( uint8_t relay_, uint8_t units_, uint16_t time_ )
- Turns selected relay on after a defined period of time in selected units of time.void relay3_offDelay( uint8_t relay_, uint8_t units_, uint16_t time_ )
- Turns selected relay off after a defined period of time in selected units of time.
Example Description
The application is composed of three sections :
- System Initialization - Initializes LOG functionality, initializes RST and CS pins as OUTPUTs.
- Application Initialization - Initializes GPIO driver.
- Application Task - Activates relays 1 and/or 2 based on user input.
void applicationTask( ) { dataReady = UART_Rdy_Ptr( ); if (dataReady != 0) { receivedData = UART_Rd_Ptr( ); switch (receivedData) { case '1' : { relay3_case1( ); break; } case '2' : { relay3_case2( ); break; } case '3' : { relay3_case3( ); break; } default : { mikrobus_logWrite( "wrong command", _LOG_LINE ); break; } } } }
Additional Functions
void relay3_case1()
- Turns relay 1 on/offvoid relay3_case2()
- Turns relay 2 on/offvoid relay3_case3()
- Turns relay 3 on/off
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
UART
Additional Notes and Information
Depending on the development board you are using, you may need a USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
Relay 3 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.