Easily create a remote switch that can turn things ON and OFF, like lights or motors, in your projects
A
A
Hardware Overview
How does it work?
RELAY Click is based on two G6D1AASIDC5s, slim miniature relays from OMRON. Despite its size, the G6D-1A-ASI DC5 relay can withstand up to 5A and 220V AC/30V DC. It can endure up to 300,000 operations, with 30V DC and 2A. This relay has a single pole only - when the coil is energized, it will attract the internal switching elements and close the circuit, similarly to a switch. These relays are designed so relatively low currents and voltages
can easily activate their coils. For the G6D-1A-ASI DC5 relay operated at 5V, the coil current is 40mA. This makes them a perfect choice for activating them by an MCU. RELAY Click uses GPIO pins RL1 and RL2 to be controlled by the host MCU. Since RELAY Click uses an NPN RET and resistors, the host MCU is safe from the current spikes driving the relay's coils. In addition, there is an LED for every relay, each of a different color,
representing the relays' status. This Click board™ can be operated only with a 5V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Features overview
Development board
UNI Clicker is a compact development board designed as a complete solution that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It supports a wide range of microcontrollers, such as different ARM, PIC32, dsPIC, PIC, and AVR from various vendors like Microchip, ST, NXP, and TI (regardless of their number of pins), four mikroBUS™ sockets for Click board™ connectivity, a USB connector, LED indicators, buttons, a debugger/programmer connector, and two 26-pin headers for interfacing with external electronics. Thanks to innovative manufacturing technology, it allows you to build
gadgets with unique functionalities and features quickly. Each part of the UNI Clicker development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the UNI Clicker programming method, using a third-party programmer or CODEGRIP/mikroProg connected to onboard JTAG/SWD header, the UNI Clicker board also includes a clean and regulated power supply module for the development kit. It provides two ways of board-powering; through the USB Type-C (USB-C) connector, where onboard voltage regulators provide the appropriate voltage levels to each component on the board, or using a Li-Po/Li
Ion battery via an onboard battery connector. All communication methods that mikroBUS™ itself supports are on this board (plus USB HOST/DEVICE), including the well-established mikroBUS™ socket, a standardized socket for the MCU card (SiBRAIN standard), and several user-configurable buttons and LED indicators. UNI Clicker is an integral part of the Mikroe ecosystem, allowing you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU
Type
8th Generation
Architecture
PIC32
MCU Memory (KB)
512
Silicon Vendor
Microchip
Pin count
100
RAM (Bytes)
65536
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
Step by step
Project assembly
Track your results in real time
Application Output
After loading the code example, pressing the "DEBUG" button builds and programs it on the selected setup.
After programming is completed, a header with buttons for various actions available in the IDE appears. By clicking the green "PLAY "button, we start reading the results achieved with Click board™.
Upon completion of programming, the Application Output tab is automatically opened, where the achieved result can be read. In case of an inability to perform the Debug function, check if a proper connection between the MCU used by the setup and the CODEGRIP programmer has been established. A detailed explanation of the CODEGRIP-board connection can be found in the CODEGRIP User Manual. Please find it in the RESOURCES section.
Software Support
Library Description
This library contains API for RELAY Click driver.
Key functions:
relay_set_state
- Relay set state
Open Source
Code example
This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.
/*!
* \file
* \brief Relay Click example
*
* # Description
* Demo application is used to shows basic controls Relay click
*
* The demo application is composed of two sections :
*
* ## Application Init
* Configuring clicks and log objects.
* Settings the click in the default configuration.
*
* ## Application Task
* Alternately sets relays to ON-OFF state...
*
* \author Katarina Perendic
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "relay.h"
// ------------------------------------------------------------------ VARIABLES
static relay_t relay;
static log_t logger;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
relay_cfg_t cfg;
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info(&logger, "---- Application Init ----");
// Click initialization.
relay_cfg_setup( &cfg );
RELAY_MAP_MIKROBUS( cfg, MIKROBUS_1 );
relay_init( &relay, &cfg );
relay_default_cfg ( &relay );
Delay_ms( 1500 );
}
void application_task ( void )
{
uint8_t cnt;
// Task implementation.
for ( cnt = 1; cnt <= 2; cnt++)
{
log_info( &logger, "*** Relay %d state is ON \r\n", (uint16_t)cnt);
relay_set_state( &relay, cnt, RELAY_STATE_ON );
Delay_ms ( 1000 );
log_info( &logger, "*** Relay %d state is OFF \r\n", (uint16_t)cnt);
relay_set_state( &relay, cnt, RELAY_STATE_OFF );
Delay_ms ( 200 );
}
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END