Opto Encoder 2 click
Opto Encoder 2 click
Share
Opto Encoder 2 click is a linear incremental optical sensor/encoder click which can be used for the movement or rotation encoding. Encoders of this type are widely used for many applications, which involve precise detection of the position, speed, or rotational angle of an object. Rotary encoders are often used for various types of controllers on many different devices. Whether it be a rotary encoder knob controller or an angle encoder on a motor shaft, the principle is the same - it includes an optical sensor, just like the one found on Opto Encoder 2 click.
Opto Encoder 2 click is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click board™ comes as a fully tested product, ready to be used on a system equipped with the mikroBUS™ socket.
This Click board™ features a very small optical encoder employing reflective technology for motion control purposes. The encoder houses an LED light source and a photo-detecting circuitry in a single package. It can be used as an optical sensor in automotive applications, motion, speed, and direction sensor, for precise motor shaft positioning applications, knob encoder applications, and similar applications, where dual channel optical sensing can be utilized.
HOW DOES IT WORK?
The optical sensor used on the Opto Encoder 2 click is the AEDR-8300, reflective Surface Mount Optical Encoder from Avago Technologies. This sensor combines an emitter and a detector in a single surface mount leadless package. the AEDR-8300 consists of three major components: a light emitting diode (LED) light source, a detector IC consisting photodiodes and lens to focus light beam from the emitter as well as light falling on the detector. The operation of the encoder is based on the principle of optics where the detector photodiodes sense the absence and presence of light. In this case, the rotary/linear motion of an object being monitored is converted to equivalent light pattern via the use of codewheel/codestrip.
Opto Encoder 2 click offers options of either single channel or two-channel quadrature digital outputs. Being TTL compatible, the outputs of the AEDR-8300 series can be interfaced directly with MCU. Hence the Opto Encoder 2 click provides great design-in flexibility and easy integration into existing systems. A and B pins are routed to the routed to the mikroBUS™ PWM and INT pins, thus providing the quadrature digital signal.
Signal encoding itself is done by the host MCU. Having two optical sensing channels, Opto Encoder 2 click has the ability of both speed and direction encoding. The most common usage is encoding of the step motor position: a cylinder with slits is physically mounted above the sensor so that the LED can illuminate the photodiodes only when light hits the reflective surface of the codewheel. By rotating this cylinder, the light beam will be blocked periodically. The single sensor output will be a pulse train, while the cylinder is rotating. Having two photo sensors physically distanced by a small amount, allows the pulse signal of the first sensor to be either delayed or expedited with respect to the pulse on the second sensor, depending on the rotational direction.
Since the sensors recomended operating voltage is 5V, the Opto Encoder 2 click uses the 5V rail for power supply. The other pins it utilizes are the, before mentioned, Interrupt and PWM pins on mikroBUS™ socket. This click also has a Power LED indicator.
This Click Board™ is designed to be operated only with 5V logic level. A proper logic voltage level conversion should be performed before the Click board™ is used with MCUs with logic levels of 3.3V.
SPECIFICATIONS
Type | Optical |
Applications | Automotive optical sensors, accurate position sensor for encoder, sensor for motion, speed, and direction, etc. |
On-board modules | Reflective Surface Mount Optical Encoder from Avago Technologies |
Key Features | The Opto Encoder 2 click features a precise detection of the position, speed, or rotational angle of an object. It is able to detect the direction of the movement since it features two photo-sensing elements. |
Interface | GPIO |
Click board size | S (28.6 x 25.4 mm) |
Input Voltage | 5V |
PINOUT DIAGRAM
This table shows how the pinout on Opto Encoder 2 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
OPTO ENCODER 2 CLICK SPECIFICATIONS
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 4.5 | 5 | 5.5 | V |
LED Current | 13 | 15 | 18 | µs |
Count Frequency | - | - | 30 | kHZ |
Resolution | - | 75 | - | LPI |
ONBOARD SETTINGS AND INDICATORS
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | - | Power LED Indicator |
SOFTWARE SUPPORT
We provide a library for the Opto Encoder 2 click 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
Library contains functions for getting INT(Channel A) and PWM(Channel B) pin states Library contains function for incrementing/decrementing encoder position Library contains function for reseting encoder position counter to 0(zero) Library contains function for getting current encoder position
Key functions:
-
int32_t optoencoder2_getPosition(void)
- returns current encoder position. -
void optoencoder2_zeroCounter(void)
- resets encoder counter to 0(zero). -
uint8_t optoencoder2_isr( uint8_t n_cycles )
- checks for rising edge on Channel A (INT pin), within specified number of cycles (n_cycles), and increments or decrements encoder position.
Examples Description
The application is composed of three sections :
- System Initialization - Initializes LOG, initializes PWM and INT pins.
- Application Initialization - Initializes GPIO driver and resets encoder counter to 0(zero) .
- Application Task - If encoder is moving - increments or decrements encoder position on every rising edge on Channel A (INT pin) and logs encoder position .
void applicationTask( ) { stop_flag = optoencoder2_isr(100); encoderPosition = optoencoder2_getPosition( ); if (stop_flag == 0) { LongToStr( encoderPosition, text ); mikrobus_logWrite( "> pos : ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_LINE ); } }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- UART
- Conversions
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.
New Products
-
Sold out
Pixhawk 6X Pro FC
Vendor:Regular price Rs. 53,499.00Regular priceUnit price / perSold out -
Pixhawk 6X (ICM-45686) FC
Vendor:Regular price Rs. 15,999.00Regular priceUnit price / per -
Pixhawk Jetson Baseboard
Vendor:Regular price Rs. 44,999.00Regular priceUnit price / per -
EZO-HUM™ Embedded Humidity Probe – Plastic Body
Vendor:Regular price Rs. 6,049.00Regular priceUnit price / per -
EZO Complete-Dissolved Oxygen™
Vendor:Regular price Rs. 14,799.00Regular priceUnit price / per -
EZO-O2™ Embedded Oxygen Sensor – Plastic Body
Vendor:Regular price Rs. 10,999.00Regular priceUnit price / per -
Crazyflie 2.1 Brushless
Vendor:Regular price Rs. 53,399.00Regular priceUnit price / per -
Propeller 47-17 (4CCW+4CW) (black)
Vendor:Regular price Rs. 699.00Regular priceUnit price / per -
Crazyflie 2.1+
Vendor:Regular price Rs. 26,499.00Regular priceUnit price / per -
Sold out
WidowX Aloha Leader Arm
Vendor:Regular price From Rs. 524,999.00Regular priceUnit price / perSold out -
ViperX Aloha Follower Arm
Vendor:Regular price From Rs. 749,999.00Regular priceUnit price / per -
Aloha Stationary
Vendor:Regular price From Rs. 3,149,999.00Regular priceUnit price / per -
4P JST Expansion Board
Vendor:Regular price Rs. 749.00Regular priceUnit price / per -
Kakute H7 v1.3 Stacks +Tekko32 F4 4in1 50A ESC
Vendor:Regular price Rs. 18,029.00Regular priceUnit price / perSold out -
Kakute H7 v1.3 (MPU6000)
Vendor:Regular price Rs. 10,279.00Regular priceUnit price / per -
Pixhawk 6C (Aluminum Case) + PM02 +M10 GPS
Vendor:Regular price Rs. 37,269.00Regular priceUnit price / per -
Pixhawk 6C (Aluminium Case) +PM02+M9N GPS
Vendor:Regular price Rs. 40,539.00Regular priceUnit price / perSold out -
PM02 V3 Power Module (12S)
Vendor:Regular price Rs. 2,299.00Regular priceUnit price / per -
Pixhawk 6C (Aluminium Case)
Vendor:Regular price Rs. 31,099.00Regular priceUnit price / per -
Holybro Pixhawk 6X - Standard set + M9N(GPS V1.7)
Vendor:Regular price Rs. 46,469.00Regular priceUnit price / perSold out -
Holybro Pixhawk 6X - Standard Set + M10(GPS V1.7)
Vendor:Regular price Rs. 42,999.00Regular priceUnit price / perRs. 43,099.00Sale price Rs. 42,999.00Sale -
Analog Discovery Pro ADP2230: Mixed Signal USB Oscilloscope, Waveform Generator, Logic Analyzer, and Variable Power Supply
Vendor:Regular price Rs. 74,999.00Regular priceUnit price / perSold out -
2x12 Flywires: Signal Cable Assembly for the Analog Discovery Pro 3000 Series
Vendor:Regular price Rs. 999.00Regular priceUnit price / perSold out