Grove - Encoder

Introduction

3.3V 5.0V Digital

This module is an incremental rotary encoder. It encodes the rotation signal from the axis and output the signal by electronic pulse. The Grove – Encoder is one of the Grove series and has a standard Grove interface. When you need to add a rotary knob to your project, for example a volume knob for a speaker, a selection panel or a digital input, this will be your first choice.

Features

  • Incremental encoder.
  • Grove Interface.
  • 360 degree rotary.

Tip

More details about Grove modules please refer to Grove System

Specifications

Item Min Typical Max Unit
Voltage 4.5 5 5.5 V
Current 10 20 30 mA
Dimension 20x 20 mm
Net Weight 12 g

Platforms Supported

Intel Edison (with the seeedstudio library) Arduino101 (with the community library)

Getting Started

This Grove-Encoder is very easy to use with the seeedstudio Encoder Lib, or the community GroveEncoder library. Simply connect this module to a Digital pin on the Base Shield and you can start using it.

Circular LED bar demo

The following is a introduction of how to make a Circular LED bar.

  • This Circular LED bar consists of an Encoder and a Grove-CircularLED module. Connect the two modules to Base shield as the following picture:

  • In the project, the TimerOne Lib and Encoder Lib and CircularLED Library are needed. Download all the librarys and install them to your Arduino IDE.

  • Restart the Arduino IDE and open the example by the path: File->Examples->Encoder->EncodeCircuiBar.

#include <CircularLED.h>
#include <Encoder.h>
#include <TimerOne.h>
CircularLED circularLED;
unsigned int LED[24];
int index_LED;
void setup()
{
  encoder.Timer_init();
}
void loop()
{
    if (encoder.rotate_flag ==1)
  {
    if (encoder.direct==1)
    {
      index_LED++;
      if (index_LED>23)
      index_LED=24;
      SenttocircularBar(index_LED);
    }
     else
     {
      index_LED--;
      if(index_LED<0)
      index_LED=0;
      SenttocircularBar(index_LED);
     }
    encoder.rotate_flag =0;
  }
}
void SenttocircularBar(int index)
{
  for (int i=0;i<24;i++)
  {
    if (i<index)
    {
      LED[i]=0xff;
    }
    else
    LED[i]=0;
  }
  circularLED.CircularLEDWrite(LED);
}
  • Upload it to your Arduino/Seeeduino. You can see:

Note

It is able to generate another signal when it is being pressed down. However due to the limitation of the number of Grove signal cables, the module is made without output of this signal.

Resources


ArduinoWioBeagleBoneRaspberry PiLinkIt ONE

Caution

The platforms mentioned above as supported is/are an indication of the module's hardware or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.

Techsupport

For any technical issue, you are most welcome to contact techsupport@seeed.cc, our techsupport engineers will help you. Thank you!

Help us make it better

Welcome to the new documentation system of Seeed Studio. We have made a lot of progress comparing to the old wiki system and will continue to improve it to make it more user friendly and helpful. The improvement can't be done without your kindly feedback. If you have any suggestions or findings, you are most welcome to submit the amended version as our contributor via Github or give us suggestions in the survey below, it would be more appreciated if you could leave your email so that we can reply to you. Happy Hacking!