Mikroelektronika d.o.o.
Hall Switch 2 Click Board
Hall Switch 2 Click Board
Couldn't load pickup availability
The Hall Switch 2 Click Board™-activated dual-relay Click Board™. This board features the MHA100KN, a high-performance, low-power Hall-Effect sensor from MEMSIC. This Hall switch is a fully integrated CMOS IC that outputs a high-low signal following magnetic field changing. It works with a magnet and detects the magnet's close/away position. Two high-quality compact relays allow switching of high voltages and can cut or establish a connection on the mains power side of the circuit.
The Hall Switch 2 Click Board™ is suitable for various applications activated by the magnetic field, such as contactless switches, lids or tray position detecting switches, or other similar applications that require contactless switching of the relay contacts.
![Mikroelektronika d.o.o. MIKROE-4788 Hall Switch 2 Click Board - The Debug Store UK](http://thedebugstore.com/cdn/shop/products/mikroelektronika-d-o-o-click-board-hall-switch-2-click-board-29914883915965.jpg?v=1685091887&width=1445)
![Mikroelektronika d.o.o. MIKROE-4788 Hall Switch 2 Click Board - The Debug Store UK](http://thedebugstore.com/cdn/shop/products/mikroelektronika-d-o-o-click-board-hall-switch-2-click-board-29914883621053.jpg?v=1685091884&width=1445)
![Mikroelektronika d.o.o. MIKROE-4788 Hall Switch 2 Click Board - The Debug Store UK](http://thedebugstore.com/cdn/shop/products/mikroelektronika-d-o-o-click-board-hall-switch-2-click-board-29914883457213.jpg?v=1685091719&width=1445)
![Mikroelektronika d.o.o. MIKROE-4788 Hall Switch 2 Click Board - The Debug Store UK](http://thedebugstore.com/cdn/shop/products/mikroelektronika-d-o-o-click-board-hall-switch-2-click-board-29914883784893.jpg?v=1685091890&width=1445)
![Mikroelektronika d.o.o. MIKROE-4788 Hall Switch 2 Click Board - The Debug Store UK](http://thedebugstore.com/cdn/shop/products/mikroelektronika-d-o-o-click-board-hall-switch-2-click-board-29914883555517.jpg?v=1684972014&width=1445)
![Mikroelektronika d.o.o. MIKROE-4788 Hall Switch 2 Click Board - The Debug Store UK](http://thedebugstore.com/cdn/shop/products/mikroelektronika-d-o-o-click-board-hall-switch-2-click-board-29914883883197.jpg?v=1685091723&width=1445)
![Mikroelektronika d.o.o. MIKROE-4788 Hall Switch 2 Click Board - The Debug Store UK](http://thedebugstore.com/cdn/shop/products/mikroelektronika-d-o-o-click-board-hall-switch-2-click-board-29914883522749.jpg?v=1684972013&width=1445)
How Does The Hall Switch 2 Click Board™ Work?
The Hall Switch 2 Click Board™ as its foundation uses the MHA100KN, a high-performance, low-power Hall-Effect sensor from MEMSIC. This Click board™ detects the presence and magnitude of a magnetic field using the Hall effect. It consists of two high-quality relays, which the MHA100KN activates. When the north pole magnetic field is introduced to the sensor, one of the relays will be activated; otherwise, the other relay will be activated.
The outputs of the MHA100KN are routed to the LM358 operational amplifier, which works as the inverting comparators. When the output of the MHA100KN is activated, pulled to a low logic level, the output from the comparator will be set to 5V, which will cause biasing of the BJTs, allowing current flow through the relay coil and thus forming a magnetic field necessary for closing the relay contacts. A Schottky diode across the relay coils prevents the reverse kickback voltage, which forms due to the inert nature of the coils.
Hall Switch 2 Click communicates with MCU using two GPIO pins labelled S and N. The north pole output is routed to the CS pin, while the south pole output is routed to the INT pin of the mikroBUS™ socket so that the MCU can monitor the status of the MHA100KN. Activation of the relay coils is also visually indicated by the yellow and red LEDs, respectively.
Two varistors VR1 and VR2, are used to prevent voltage peaks when the load is connected or disconnected on the relay output contacts. However, the relays allow up to 5A for 250VAC / 30VDC, so the connected load should not exceed these power ratings.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VCC SEL jumper. This way, it allows both 3.3V and 5V capable MCUs to use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Specifications
Type | Magnetic |
Applications | Can be used for various applications activated by the magnetic field, such as contactless switches, lids or tray position detecting switches, or other similar applications that require contactless switching of the relay contacts |
On-board modules | MHA100KN - high-performance, low-power Hall-Effect sensor from MEMSIC |
Key Features | Low power consumption, reliable contactless switching by the magnetic field, separate sensors for both south and north pole magnetic fields, high-quality compact relays, and more |
Interface | GPIO |
Compatibility | mikroBUS |
Click board size | L (57.15 x 25.4 mm) |
Input Voltage | 3.3V or 5V |
Pinout diagram
This table shows how the pinout on Hall Switch 2 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes | Pin | ![]() |
Pin | Notes | |||
---|---|---|---|---|---|---|---|
NC | 1 | AN | PWM | 16 | NC | ||
NC | 2 | RST | INT | 15 | S | South Pole | |
North Pole | N | 3 | CS | RX | 14 | NC | |
NC | 4 | SCK | TX | 13 | NC | ||
NC | 5 | MISO | SCL | 12 | NC | ||
NC | 6 | MOSI | SDA | 11 | NC | ||
Power Supply | 3.3V | 7 | 3.3V | 5V | 10 | 5V | Power Supply |
Ground | GND | 8 | GND | GND | 9 | GND | Ground |
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | - | Power LED Indicator |
LD2 | S | - | Magnet South Pole LED Indicator |
LD3 | N | - | Magnet North Pole LED Indicator |
JP1 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
Hall Switch 2 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | - | 5 | V |
Maximum Output Current | - | - | 5 | A |
Operating Temperature Range | -40 | +25 | +85 | °C |
Software Support
We provide a library for the Hall Switch 2 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
The package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe GitHub account.
Library Description
This library contains API for Hall Switch 2 Click driver.
Key Functions
hallswitch2_cfg_setup
- Config Object Initialization function.hallswitch2_init
- Initialization function.- - .
Example Description
This example demonstrates the use of the Hall Switch 2 Click board.
void application_task ( void ) { switch ( hallswitch2_check_state( &hallswitch2 ) ) { case HALLSWITCH2_NO_MAGNET_DETECTED: { if ( HALLSWITCH2_NO_MAGNET_DETECTED != print_state ) { log_printf( &logger, " No magnet detectedrn" ); log_printf( &logger, " Switches - disabledrnrn" ); print_state = HALLSWITCH2_NO_MAGNET_DETECTED; } break; } case HALLSWITCH2_S_POLE_DETECTED: { if ( HALLSWITCH2_S_POLE_DETECTED != print_state ) { log_printf( &logger, " South pole detectedrn" ); log_printf( &logger, " Switch 1 - enabledrnrn" ); print_state = HALLSWITCH2_S_POLE_DETECTED; } break; } case HALLSWITCH2_N_POLE_DETECTED: { if ( HALLSWITCH2_N_POLE_DETECTED != print_state ) { log_printf( &logger, " North pole detectedrn" ); log_printf( &logger, " Switch 2 - enabledrnrn" ); print_state = HALLSWITCH2_N_POLE_DETECTED; } break; } default: { break; } } }
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe GitHub account.
Other mikroE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.HallSwitch2
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.
mikroSDK
This Click board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
Hall Switch 2 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.
![banner Image](http://thedebugstore.com/cdn/shopifycloud/shopify/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_medium.gif)