Starting the VFO for the Pixie. LCD Screen and Rotary Encoder.

For the Pixie VFO we will be using an Arduino UNO. First we will connect the LCD Screen and Rotary Encoder. To cut down on connections an I2C LCD Screen will be used. The same library is used from past projects. The link to the website with the library and tutorial are .

Rotary Encoder
16×2 LCD Screen

The Rotary Encoder used was purchased off of amazon. These were relatively cheap and came in a 10 pack. It came with a small knob that will work for testing. In the final VFO, a different knob will be used.


The test sketch displays a number on the screen. When the Rotary Encoder is Turned, the number will change. If you open a serial monitor window and turn the encoder, the direction will be indicated in the window. Depending on your rotary encoder, the direction may be backwards. An easy fix for this is to swap the DT and CLK line on the Arduino.


Rotary Encoder and LCD Screen Test Sketch

Rotary Encoder and LCD Screen Test Sketch 8/20/19
Rotary Encoder - library
I2C LCD - download library
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
#include <Rotary.h>

const int W_CLK_PIN = 8;
const int FQ_UD_PIN = 9;
const int DATA_PIN = 10;
const int RESET_PIN = 11;

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address
Rotary r = Rotary(2, 3);
int TurnNum = 100;
long Freq = 14000000;

void setup() {
  PCICR |= (1 << PCIE2);
  PCMSK2 |= (1 << PCINT18) | (1 << PCINT19);

  lcd.setCursor( 3, 0 );                   

void loop() {

  lcd.setCursor( 4, 1 );                   
  lcd.print( Freq ); 

ISR(PCINT2_vect) {
  unsigned char result = r.process();
  if (result == DIR_NONE) {
    // do nothing
  else if (result == DIR_CW) {
    Freq = Freq - TurnNum;
  else if (result == DIR_CCW) {
    Freq = Freq + TurnNum;


Welcome to the Lab


Latest Posts

2 thoughts on “Starting the VFO for the Pixie. LCD Screen and Rotary Encoder.

Leave a Reply

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

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

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close