Potentiometer (knob) with TinkerPie
Turn the knob to set a value: volume, speed, colour.
| Type | Analog sensors |
|---|---|
| Connect to | P10-P13 |
| Gives | 0-100 % |
| Simulator | Yes: a control appears under the simulated board |
How it works
A potentiometer is a resistor with a sliding contact. Turning the knob moves the contact, which divides the voltage, so the board reads a smooth value from 0 to 100 %.
How to wire it
Plug the module's A0 / OUT into P10 (or P11-P13 when Wi-Fi is off), VCC to 3.3 V, GND to GND.
Code
In blocks: Accessories category in TinkerPie Studio. As code:
// JavaScript
sensors.potentiometer(Pin.P10)
// Arduino C++
sensors::potentiometer(Pin::P10) Good to know
- The most common value is 10 kΩ.
- Perfect for setting speed, volume, brightness or a threshold.
- Connect the middle pin to an analog pin.
Projects with the Potentiometer (knob)
Similar modules
- Soil moisture sensor
- Light sensor module (LDR)
- Sound sensor module
- Gas / smoke sensor MQ-2
- Air quality sensor MQ-135
- Rain drop sensor
- Water level sensor
- Force sensor (FSR)
More projects to try
Questions
Can I try the Potentiometer (knob) without buying one?
Yes. In TinkerPie Studio the simulator shows a control for it under the board, so you can test your program before you build it.
Why does my knob work backwards?
Swap the two outer pins (3V3 and GND), or use 100 - value in your code.