In the loop function, the current value of slide knob is read, and then, printed out to the serial monitor. Moreover, the analog input A0 is set to input-mode. In the setup function, the serial connection is started to print the values on the serial monitor. The slide pot’s signal pin is wired to the Arduino’s analog pin A0. For GND and VCC, the Arduino’s GND and 5V pins are used. The following wiring picture shows the most basic wiring for the slide pot modules. The digital values range from 0 (for 0V at analog pin) to 1023 (for 5V at analog pin). As a result, the analog value will be available as digital values in the Arduino program. The Arduino’s analog pins are able to read voltage levels up to 5V by a so-called analog-to-digital converter. So, the most outer right position is always equal to the voltage level of VCC. DTB = 5V on the most outer right position.DTB = 0V on the most outer left position.For example, if VCC has 5V, the voltage levels look like this: The signal pin DTB has a voltage level that corresponds to the slider knob position and depends on the voltage level of VCC. Keep in mind, working with voltage levels of higher than 5V might damage your Arduino permanently if a wrong wiring is applied. I would be careful with higher voltage levels. However, voltage levels of 3.3V and 5V are possible for sure. My slide pot does not indicate which voltage levels are supported on VCC. The goal is to retrieve the slide knob position and to print it out on the serial monitor of the Arduino IDE.Īn output of the slide pot has three pins: GND, VCC and DTB. The first part of the tutorial explains some basic aspects about the slide pot. If you plan to use LED rings, have a look at my WS2813 LED ring tutorial. With the knowledge you gain by this tutorial, it should be easily possible to control also other LED chips or LED components, such as LED rings. ![]() I already made a tutorial on how to use WS2812B-based LED strips. Moreover, the color is also fully controllable as the WS2812B is a so-called “RGB LED” chip. These LED strips are fully controllable: Every single LED on the strip can be switched on or off. In this tutorial we make use of WS2812B LED strips. There exist tons of different types of LED strips. WS2812B LED strip (IP67 variant with 30 LEDs per meter).Īs the name suggests LED strips / stripes are strips with a specific number of LEDs on them. Therefore, the use of the second signal output is not addressed at all in this tutorial! LED strip (WS2812B) In this tutorial, we need only one signal from the slider. ![]() Other variants have two different labels for the signal pins: ‘DTA’ and ‘DTB’ (Data A and Data B). Both of my signal pins are labeled with ‘DTB’ (Data B). This is indicated by the pin labels of my slide pot. ![]() As a result, it is not possible to ‘configure’ two different types of output signals with my variant. My variant has also two data outputs but they are on the same wire. The slide pot is available in different variants. Typically, the slide pot module comes with a red PCB, a slider/fader knob that adjusts a potentiometer, and pins for two data outputs. The typical use case for a slide pot is 1) to position the slide knob, 2) use an Arduino to retrieve a signal that corresponds to the knob position, and then, 3) let the Arduino control something. Slide Pot is the name of a very common module that can easily be used with an Arduino. This signal can be used by the analog-to-digital converters of an Arduino (=analog pins) to use the position in an Arduino program. Then, the potentiometer changes a voltage level of the signal that is bound to an output pin. From a technical perspective, slide potentiometers are just slide knobs that adjust a potentiometer by changing the knobs position. Slide potentiometers come with many names: potentiometer sliders, volume sliders, mixer, fader, and so on. Let’s check out the analogRead() command to get a feel for it.Slide pot module with two (coupled) outputs (2x DTB).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |