Rotary Encoder Motor Speed Controller with OLED Feedback

Implemented a single direction DC motor speed controller using a rotary encoder and a 128×64 OLED display for user feedback. The rotary encoder switch was used to turn on/off motor speed control. A CW rotation increased the motor speed by 10% while a CCW rotation decreased the motor speed by 10%. The OLED display provided feedback of the current motor speed/state using text and a progress bar.

A PWM signal was used to control a 2N2222 transistor. The transistor was used as a switch that allowed current flow (<800mA) through the motor when the base is high. A flyback diode was connected across the motor to eliminate back EMF.

The OLED display was attached to the I2C bus and programmed using the Adafruit GFX and SSD1306 libraries. The rotary encoder switch was connected to an interrupt pin on the Arduino Nano to toggle from OFF-ON or ON-OFF. Turning the motor speed controller OFF also set the motor speed back to 0%. While OFF the rotary encoder inputs are ignored.

Motor Speed Controller OFF – Rotary Encoder Inputs are Ignored
Motor Speed Controller ON and at 30%
Motor Speed Controller ON and at 100%

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s