Knob G Click
Knob G Click
Share
Featuring highly advanced LED driver IC which features an unparalleled flexibility and uses the I2C communication protocol, 24 individual LEDs which form a LED ring around the encoder, a high-quality rotary encoder with push-button from ALPS, and the debouncing circuitry that contains Schmitt triggers for a high reliability, Knob G click is an ideal solution for building various HMI applications where a precise input is required. Also, it can be used to add various interesting visual effects to any application.
How does it work?
The Knob G click consists of two distinctive sections: the first section is the rotary quadrature encoder which has its outputs routed to the GPIO pins of the mikroBUS. The encoder is supported by a debouncing circuitry, composed of passive elements and a triple inverting Schmitt trigger IC. The second section is the LED driver IC, with accompanying LEDs positioned in a form of a ring around the encoder, which makes them perfectly suited to be used as encoder position indicators.
This Click Board uses the EC12D, a 15-pulse incremental rotary encoder with a push-button, from ALPS. This encoder has very good mechanical specifications: debouncing time for its internal switches ranges down to 2ms, and it can withstand a huge number of switching cycles, up to 30,000. The supporting debouncing circuitry allows the switches to fully settle before the output is triggered: when the encoder contacts are closed, the capacitor will start to discharge through the encoder contacts, and the Schmitt trigger will output a LOW logic level when its low voltage threshold level is reached, and vice versa - when the encoder contacts are open, the capacitor will start to charge through the resistor, and the Schmitt trigger will output a HIGH logic level when its high voltage threshold level is reached. This allows reading the states of two encoder pins and one switch pin directly from the code, with no bulky software debouncing applied. This makes the Knob G click usable directly within the ISRs, with the interrupt-on-change event which allows an absolute accuracy and no skipped pulses (which can occur when a regular software polling technique is used). Encoder pins are labeled as ENA and ENB for the quadrature encoder contacts, and SW for the push-button contact. These pins are routed to the, CS and INT pin of the Mirko BUS, respectively.
LED ring is composed of 24 individual green LEDs which are driven by the PCA9956B, an 8-bit, 24-channel, constant current LED driver, from NXP. This driver IC has many LED driving features, including a constant current sinking capability, which greatly simplifies the design: the maximum current through the LEDs is determined by a single resistor. The structure of this IC is such that it has separate registers for each LED channel, as well as a single register which controls all the LEDs at once. It can use the PWM signal to allow PWM dimming, but it also features current-mode dimming, by scaling down the maximum current through LEDs. The PWM signal can have a low-frequency pulse signal superimposed on a top of it. While the PWM frequency of the driver is 31.25kHz, reducing the LED flickering completely, the low-frequency signal can range from 0 to 122Hz, allowing interesting blinking effects to be produced without using the computing power of the microcontroller (MCU). The LED dimming is very smooth since the PCA9956B supports up to 256 steps for the PWM duty cycle (8-bit). A full list of features can be found in the PCA9956B datasheet, in the download section, below.
The OE pin of the PCA9956B is routed to the PWM pin of the mikroBUS. When the LOW logic level is applied to the OE pin, the LED outputs will be enabled. This pin is pulled to a HIGH logic level by a resistor. Applying a PWM signal at the OE pin will result in the dimming of all LEDs at once. It can be used as another method of dimming, or as the ON-OFF switch for the entire LED ring. The LED driver IC can be reset by pulling the RST pin to a LOW logic level. This pin is pulled to a HIGH level by the pull-up resistor. The pulse can be incredibly short (2.5 µs) but the device will not be ready for another 1.5 ms after the reset pulse. Besides the hardware reset, the PCA9956B supports a software reset, which is necessary after the device is set to operate in the fast I2C mode (including the clock speed above 100 kHz).
The PCA9956B IC uses the 3.3V rail of the mikroBUS so there is no significant voltage drop, which causes thermal dissipation. However, turning on all LEDs at once with the maximum current set can cause the Knob G click to warm up a bit. This is expected, as the thermal dissipation of each channel is adding up to the sum dissipation of the entire IC. The PCA9956B IC features thermal shutdown protection, along with the set of error reporting features: it can report both open-circuit event and short-circuit event for each LED. These errors will be written in the ERR registers, one for each LED channel. The PCA9956B datasheet explains how to interpret the values of these registers.
The I2C address of the PCA9956B can be selected with three SMD jumpers, grouped under the ADDR label. The PCA9956B allows its slave I2C address to be selected from a very wide range of 125 different values. Each of the address pins (A0 to A3) can be left floating, pulled up, pulled down and shorted to VCC or GND. However, some I2C addresses are reserved, so they should be used with care. The datasheet of the PCA9956B offers tables with resistor values for each state of the address pins and reserved I2C addresses. Knob G click uses three 0 ? SMD jumpers to set the states of these address pins.
The logic voltage level can be selected by the SMD jumper labeled as VCCIO. This jumper determines the logic levels for the logic signals from Schmitt triggers, as well as for the I2C communication with the PCA9956B. This allows the click board to be interfaced with a wide range of different MCUs, both compatible with 3.3V and 5V logic voltage levels.
Specifications
Type | Rotary encoder |
Applications | Knob G click is an ideal solution for building various HMI applications, where a precise input is required. Also, it can also be used to add various interesting visual effects to any application. |
On-board modules | PCA9956B, an 8-bit, 24-channel, constant current LED driver, from NXP; 74HC3G14DC, a triple inverting Schmitt trigger IC, from Nexperia |
Key Features | A reliable symmetrical debouncing circuit, a very flexible and powerful PWM LED driver which features several different dimming options, constant current through LEDs can be selected by a single resistor, smooth dimming in 256 steps for each LED channel, 24-segment LED ring that can be used for the visual feedback, etc. |
Interface | I2C,GPIO |
Input Voltage | 3.3V,5V |
Compatibility | mikroBUS |
Click board size | L (57.15 x 25.4 mm) |
Pinout diagram
This table shows how the pinout on the Knob G 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 |
---|---|---|---|
PWR | PWR | - | Power LED indicator |
JP0, JP2 | ADDR | Right | I2C slave address selection: left position GND (0), right position VCC (1) |
JP1 | ADDR | Left | I2C slave address selection: left position GND (0), right position VCC (1) |
JP3 | VCCIO | Left | Logic voltage level selection: left position 3.3V, right position 5V |
Note: please consult the datasheet of the PCA9956B if you need to change the default I2C slave address
Software support
We provide a library for the Knob G 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
The library initializes and defines the I2C bus driver and drivers that offer a choice for writing data in the register and reads data from the register. The library includes the function for reading the Encoder position and sets a new start position. The user also has the functions for full control LEDs.
Key functions:
-
void knobg_setLedState(uint8_t led, uint8_t state)
- Functions for setting the led state
-
void knobg_getEncoderPosition(int32_t *position, uint8_t *dir)
- Functions for getting Encoder position
-
void knobg_encoderNewStartPosition(int32_t position)
- Functions for set new start encoder position
Examples description
The application is composed of the three sections :
- System Initialization - Initializes I2C module, sets INT pin, AN pin and CS pin as INPUT and sets RST pin and PWM pin as OUTPUT
- Application Initialization - Initialization driver init, reset the device, enable led output, set output gain on maximum and sets new start position of the encoder.
- Application Task - (code snippet) - The Task application has 3 test modes: * The first example is setting BRIGHTNESS on all LEDs. * Other examples put the LED in the position read from the encoder. * The third example sets the LED to be read while the encoder registers the clockwise movement and turn off those LEDs that the encoder reads when moving in a counterclockwise direction. * The example is changed by pressing the SW button
void applicationTask() { knobg_getEncoderPosition(&encoder_newPosition, &direction); if(knobg_getSWButtonState() == 0) { SW_State++; if(SW_State >= 3) SW_State = 0; knobg_setBrightness(_KNOBG_BRIGHTNESS_ALL_LED, 0x00); Delay_ms( 300 ); } /* Logs position */ if(encoder_newPosition != encoder_oldPosition) { WordToStr(encoder_newPosition, demoText); mikrobus_logWrite(" EnCoder position : ", _LOG_TEXT); mikrobus_logWrite(demoText, _LOG_LINE); } encoder_oldPosition = encoder_newPosition; switch(SW_State) { /* Brightness */ case 0: { cnt++; if(cnt > 127) cnt = 0; knobg_setBrightness(_KNOBG_BRIGHTNESS_ALL_LED, cnt); Delay_ms( 15 ); break; } /* Encoder with one led*/ case 1: { if(encoder_newPosition > 24) knobg_encoderNewStartPosition( 1 ); if(encoder_newPosition < 1) knobg_encoderNewStartPosition( 24 ); if(direction == 1) { knobg_setLedState(encoder_newPosition, _KNOBG_LED_ON); knobg_setLedState(encoder_newPosition - 1, _KNOBG_LED_OFF); } else { knobg_setLedState(encoder_newPosition, _KNOBG_LED_ON); knobg_setLedState(encoder_newPosition + 1, _KNOBG_LED_OFF); } Delay_1ms(); break; } /* Encoder with all led */ case 2: { if(encoder_newPosition > 24) knobg_encoderNewStartPosition( 1 ); if(encoder_newPosition < 1) knobg_encoderNewStartPosition( 24 ); if(direction == 1) { knobg_setLedState(encoder_newPosition, _KNOBG_LED_ON); } else { knobg_setLedState(encoder_newPosition + 1, _KNOBG_LED_OFF); } Delay_1ms(); break; } } }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
I2C
Additional notes and information
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.
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