How does it work?
Opto Encoder 5 Click is based on the OPB666N, a Photologic® slotted optical switch from TT Electronics. This device integrates an infrared light-emitting diode (LED) operating at 890nm alongside a monolithic integrated circuit. It also combines a photodiode, a linear amplifier, and a Schmitt trigger all on one silicon chip. It operates effectively with a 5V power supply from the 5V mikroBUS™ power rail. It also features an NPN open-collector output configuration accessible through the OUT pin on the mikroBUS™ socket and the ON pin for enabling the optical switch. In addition, compatibility with TTI/LST TL is assured. This Click board™ finds its application in various domains, such as replacing mechanical switches, serving as a speed indicator (tachometer), mechanical limit indicator, and edge sensing, thanks to its swift response times and real-time detection capability.
The OPB666N is an optical sensor designed to make significant impacts across various sectors, pushing the boundaries of optical sensing technology. Its superior capabilities, coupled with a design that emphasizes compactness and durability, make it incredibly versatile. Its slim profile makes its incorporation into areas where space is at a premium, while its robust build guarantees consistent performance in even the most challenging environments. It is designed to resist extreme temperatures, vibrations, and moisture and is the ideal choice for rigorous industrial applications. The high-resolution optics of the OPB666N assure unmatched accuracy and precision. Thanks to the onboard optical switch, the OPB666N, this Click board™ offers numerous advantages, including non-contact switching, improved signal-to-noise ratio, and employs a through-beam sensing technique.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this 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
Optical
Applications
Ideal for replacing mechanical switches, serving as a speed indicator, mechanical limit indicator, and edge sensing in sectors demanding high precision and reliability
On-board modules
OPB666N – Photologic® slotted optical switch from TT Electronics
Key Features
Non-contact switching, enhanced signal-to-noise ration, sensing method through-beam, TTI/LST TL compatible, exceptional performance, ideal for demanding industrial environments, fast response time, and more
Interface
GPIO
Feature
ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Opto Encoder 5 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 |
JP1 | VCC SEL | Left | Logic Voltage Level Selection 3V3/5V: Left position 3V3, Right position 5V |
Opto Encoder 5 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Wavelength | – | 890 | – | nm |
Software Support
We provide a library for the Opto Encoder 5 Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Opto Encoder 5 Click driver.
Key functions
-
optoencoder5_enable
This function enables the slotted optical switch of Opto Encoder 5 click board. -
optoencoder5_disable
This function disables the slotted optical switch of Opto Encoder 5 click board. -
optoencoder5_get_out_state
This function detecting slotted optical switch states of Opto Encoder 5 click board.
Example Description
This example demonstrates the use of the Opto Encoder 5 Click board by detecting eclipse states.
void application_task ( void )
{
out_state = optoencoder5_get_out_state( &optoencoder5 );
if ( cmp_state != out_state )
{
if ( OPTOENCODER5_OUT_STATE_SWITCH_CLOSED == out_state )
{
log_printf( &logger, " Counter: %u rn", cnt );
cnt++;
}
cmp_state = out_state;
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.OptoEncoder5
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. UART terminal is available in all MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE 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.