Type Here to Get Search Results !

Controlling Of Led Speed & Brightness In Arduino Projects

As you remember we divided our project in few steps. In step one we handled digital input and output and now in step two I would to start using analog input that is equally important as the digital input. So in this section, we will read analog data from a variable resistors that is called potentiometer,, normalized the reading to the relevant range so. we can use it utilizing the serial monitor option for helping us in testing our program and at the end simulate analog output using a technique that is called Pulse Wide Modulation (PWM).




Add Brightness Control & Speed Control Blocks In Project Building Blocks

Looking back to our project building blocks, we already have the Arduino board of course. six LEDs and two digital pushbuttons being used as input to the Arduino. Now we would like to extend the input capability and add two variable resistors as analog input, to control the brightness and speed of the 6 LEDs. now those variable resistors will be connected to the analog inputs in the Arduino. Please watch this video below to better understanding.




How To Use Variable Resistor Or Potentiometer In Arduino Projects


Resistors are one of the most common component we will find in any electric circuit. Mainly because they are really useful and their main function is to limit current flow and set voltage levels within a specific circuit.

We already used fixed size resistors to connect the led to the arduino in a safe way. Now in addition to fixed resistors there are also variable resistors. Or resistors that their resistance can be adjusted by a physical rotation. One common type of variable resistor is the potentiometer. And we can see in the picture on the left side, that there are many types, sizes and shapes  but the function is similar.

Now let’s zoom on one of them. Such potentiometer has three pin connections: one in the center pin and one on each side when someone is turning the shaft of a variable resistor, it actually increase the resistance between one side and the center and decreases the resistance between the center and the opposite side.

So if we will connect such variable resistor as analog input to the arduino we can get different reading when the user manually change it. In our case we can use them to adjust the speed and brightness of the leds. The way to connect it is really straightforward, one side will be connected to the voltage source. It does not matter which side, it is symmetrical. It can be 5v or other voltage level, the other side will be connected to the ground 0v to provide a reference voltage. And the last one, the middle terminal will be connected to the arduino analog input pin.

Let’s see how it is connected in the project circuit design. For practical demonstration, please watch this video.



Post a Comment

0 Comments