SEN0156

SEN0156 Datasheet


Rotary Switch Module V1 SKU:SEN0156

Part Datasheet
SEN0156 SEN0156 SEN0156 (pdf)
PDF Datasheet Preview
Rotary Switch Module V1 SKU:SEN0156

Contents
• 1 Introduction
• 2 Specifications
• 3 How to Change Position Number
• 4 Wiring Diagram
• 5 Sample Code 1
• 6 Sample Code 2

Introduction

A rotary switch is a switch operated by rotation. These are often chosen when more than 2 positions are needed, such as multi-speed control. The Rotary Switch uses an analog input to read the 12 state which saves IO resource for the Arduino. This Rotary Switch Module has most 12 position. Each position has the approprite indicator.You can also adjust metal buckle inside the switch to change position number.So, it's very flexible for you to use. A rotary switch consists of a spindle or "rotor" that has a contact arm or "spoke" which projects from its surface like a cam. It has an array of terminals, arranged in a circle around the rotor, each of which serves as a contact for the "spoke" through which any one of a number of different electrical circuits can be connected to the rotor. Thus a rotary switch provides greater pole and throw capabilities than simpler switches do.

Specifications
• Supply voltage 3.3-12V
• Interface Analog
• Size 43mm*38mm

How to Change Position Number

Regulating metal buckle among differrnt fixing hole can change position number.

Wiring Diagram

Sample Code 1
int sensorvalue;
void Serial.begin 9600 ;
void
sensorvalue = analogRead 0 tion

Serial.println sensorvalue delay 200 ;
// read value from different posi

Sample Code 2

The same position value of each switch is different.So, by sample code 1, the each position value can be read, and modify the appropriate reference value in the following code.
# This Sample code is reading Switch position.
int adc_key_val[12]
int NUM_KEYS = 12;
int adc_key_in;
int key=-1;
int oldkey=-1;
void setup

Serial.begin 9600 ;
// 9600 bps
void loop
adc_key_in = analogRead 0 ;
// read the value from the sensor
key = get_key adc_key_in ;
// convert into position
if key != oldkey
// if a position is detected
delay 50 // wait for debounce time
adc_key_in = analogRead 0 ;
// read the value from the sensor
key = get_key adc_key_in ;
//convert into position
if key != oldkey
More datasheets: GPFM115-5G | GPFM115-28G | GPFM115-48 | GPFM115-5 | GPFM115-15 | GPFM115-24 | GPFM115-28 | GPFM115-15G | GPFM115-24CG | GPFM115-12


Notice: we do not provide any warranties that information, datasheets, application notes, circuit diagrams, or software stored on this website are up-to-date or error free. The archived SEN0156 Datasheet file may be downloaded here without warranties.

Datasheet ID: SEN0156 509079