Search on blog

Follow us on facebook

Top sellers

Information

The Onboard Encoder of the IoT Proto Shield Plus

Published : 03/18/2022 09:55:54
Categories : IoT Proto Shield Plus , Proto Shield Plus


The on-board ENCODER of the IoT Proto Shield Plus


The IoT Proto Shield Plus comes with one on-board rotary ENCODER, it is useful to quickly setup your prototyping environment.


ENCODER Section of the IoT Proto Shield Plus
ENC section of the IoT Proto Shield Plus

ENC section of the IoT Proto Shield Plus


Schematic of the IoT Proto Shield Plus ENCODER Section
Schematic of the ENC section of the IoT Proto Shield Plus


Default connections


Default connection of the ENC section of the IoT Proto Shield Plus

Please note that there are no default connections for the ESP8266. If you need to use the ENCODER with ESP8266 boards, you need to route the signals with jumper wires.

Suggested ESP8266 connections

The sample sketches are made to work with these connections:
ESP8622 GPIO 14 (D5) connected to header J3 ESP32 GPIO33 (ENC_SW)
ESP8622 GPIO 5 (D1) connected to header J3 ESP32 GPIO27 (ENC_A)
ESP8622 GPIO 4 (D2) connected to header J3 ESP32 GPIO35 (ENC_B)

Suggested connections to work with ENCODER and ESP8266


Sample Sketches


The sample sketches are very easy, they let you track and read the ENCODER position.
Download the sample sketches by clicking here.

Location: IoTPSP_Sample_Sketches/IoTPSP_ENC

Open the serial monitor and rotate the encoder knob to see its incremental position changing or press the encoder knob to see the GRN led changing its status.

Use the IoTPSP_ENCODER_Simple_NANO sketch to test the ENCODER with ARDUINO NANO boards.
Use the IoTPSP_ENCODER_Simple_ESP32 sketch to test the ENCODER with ESP32 boards.
Use the IoTPSP_ENCODER_Simple_ESP8266 sketch to test the ENCODER with ESP8266 boards.

A more robust way to manage the A and B signals of the ENCODER is using the interrupts.

Use the IoTPSP_ENCODER_Interrupt_NANO sketch to test the ENCODER with ARDUINO NANO boards using interrupts.
Use the IoTPSP_ENCODER_Interrupt_ESP32 sketch to test the ENCODER with ESP32 boards using interrupts.
Use the IoTPSP_ENCODER_Interrupt_ESP8266 sketch to test the ENCODER with ESP8266 boards using interrupts.


Using the ENCODER with different GPIO pins

According to the above schematics, ENCODER signals are routed to the default GPIO pins by means of JP18, JP19 and JP20.
To disconnect ENCODER signals from their default GPIO pins, you must open JP 18, JP19 and JP20 (cut them in the middle).
Solder a header on J9 and, by means of some jumper wires, connect other GPIO pins according to your needs.
Please check the default signal routing of the IoT Proto Shield Plus to  avoid conflict with other default connections.


Share this content