How does it work?
Tilt 3 Click as its foundation uses the DSBA1P, a PCB mount tilt switch sensor with ammonia-resistant terminals from NKK Switches. This switch is a non-contact switch with an embedded photo interrupter, which rather than contacts, ensures high reliability. It has sealed DSB construction for protection from environmental elements, including hydrogen sulfide, sulfur dioxide, and nitrogen hydroxide. These switch series are well suited to meet product safety concerns due to normally-closed (ON) status and can be used for many applications where orientation or inclination detection is crucial.
This tilt sensor works by detecting changes in angle from a pre-set “zero” state. They are set with a maximum and minimum threshold in which the application will work (from ±30° to ±60°) or be safe to operate based on the specific application’s needs. If the tilt or inclination exceeds these threshold values in either direction, a relay will be engaged, and the switch closed.
Tilt 3 Click communicates with MCU using two GPIO pins. The Enable pin, labeled as EN and routed to the CS pin of the mikroBUS™ socket, optimizes power consumption and is used for power ON/OFF purposes (driver operation permission). It also has an additional LED for exceeded angle threshold indication. In that case, such a condition is indicated by a red LED marked as TILT, which is also connected to the interrupt INT pin through which the user can receive the information, which, in addition to a LED, indicates unsafe or non-working conditions.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VCC SEL jumper. This way, it is allowed for 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
Motion
Applications
Can be used for many applications where orientation or inclination detection is a crucial factor
On-board modules
DSBA1P – PCB mount tilt switch sensor with ammonia-resistant terminals from NKK Switches
Key Features
Low power consumption, operation angle from ±30° to ±60°, 1 million operation minimum, very durable, sealed in the DSB construction for protection from environmental elements, possesses exceeded angle threshold indication, and more
Interface
GPIO
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Tilt 3 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
LD2 | TILT | – | Tilt LED Indicator |
JP1 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
Tilt 3 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Operating Angle Range | ±30 | – | ±60 | deg |
Return Angle | – | 10 | – | deg |
Mechanical/Electrical Life Cycle | 1.000.000 | – | – | operations |
Operating Temperature Range | -25 | +25 | +85 | °C |
Software Support
We provide a library for the Tilt 3 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
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 Tilt 3 Click driver.
Key functions:
tilt3_cfg_setup
– Config Object Initialization function.tilt3_init
– Initialization function.
Examples description
This example demonstrates the use of Tilt 3 Click board™.
void application_task ( void ) { uint8_t state = tilt3_get_switch_state ( &tilt3 ); if ( tilt3_switch_state != state ) { tilt3_switch_state = state; if ( TILT3_SWITCH_ON == tilt3_switch_state ) { log_printf( &logger, " Tilt switch ON!rnn" ); } else { log_printf( &logger, " Tilt switch OFF!rnn" ); } Delay_ms( 500 ); } }
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.Tilt3
Additional notes and informations
Depending on the development board you are using, you may need 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.
For more information about mikroSDK, visit the official page.