Skip to main content

Arduino Circuit to Dim LED with Potentiometer





In placing the LED into the circuit, remember that you must always put the longer leg towards the positive voltage. In the case above, the longer leg should be connected to the resistor, and the shorter leg connected to ground. Also remember that we are using a 330 ohm resistor in the circuit to limit the current through the LED.

The goal now is to use what you learned in the last three lessons. You will want to read a value from the potentiometer, and then write a voltage to the LED based on the reading from the potentiometer. Remember that when you read an analog voltage between 0 and 5 volts, the arduino will report a number between 0 and 1023, with 0 representing 0 volts, and 1023 representing 5 volts.

Similarly, when you are writing an analog voltage between 0 and 5 volts, you must write a number between 0 and 255. If you write a “0” value, that corresponds to 0 volts. If you write a value of 255, that will output 5 volts. So, you must scale your write values between 0 and 255 to get voltages between 0 and 5 volts.


The tricky thing now is that we want to dim the LED based on what value we read from the potentiometer. If we read a 0 value from the potentiometer, we want to write a value of 0, which corresponds to a voltage of 0. If we read a value of 1023 from the potentiometer, then we will want to write our maximum voltage of 5 volts, which means we need to write a value of 255. Basically, we need to scale our read values, which will be between 0 and 1023 to suitable write values, which should be between 0 and 255.

coad 

















more detail visit 
http://www.toptechboy.com/arduino/lesson-11-arduino-circuit-to-dim-led-with-potentiometer/

Popular posts from this blog

Automobile Engineering:-----What does LXI, VXI, ZXI mean in cars?

Almost all car manufacturers have different variants available for the same car.

The car looks the same but will have different features inside and outside.

Maruthi uses L, V, Z alphabets. and their petrol and diesel variants are identified by XI and DI respectively.

Maruthi: LXI, VXI, ZXI or LDI, VDI, ZDI




Honda: EMT, SMT, SVMT, VMT, VXMT, SAT, VAT, SCVT, VCVT 
In Honda, E, S, SV, V, VX are the variants and AT means the automatic transmission and CVT means continuous variable transmission. so if a model says VCVT that means that the variant is and it has a CVT transmission in it. In Honda cars, petrol and diesel is identified by the separate markings iVTECand iDTECrespectively
These are the different trim levels which are found in Maruti Suzuki vehicles.
Trim refers to the items that can be added to the interior and exterior of an automobile to increase its appeal.



XI denotes petrol engine
LXI is for lower variant cars
VXI includes basic features like ac, power steering  etc
ZXI includes all th…

WATER LEVEL INDICATOR

Prepared by… Name: -                  Kumawat ajay kumar sureshbhai College: -               S. & SS Gandhi Polytechnic college University: -           Gujarat Technical University Enrollenment: -     1360120324017 
INDEX Sr. no. Name 1 Introduction 2 Use of water level indicator 3 Different type of water level indicator 4

HOW TO MAKE LDR SENSOR AT HOME

HOW TO MAKE LDR SENSOR AT HOME Prepared by Name: - Kumawat ajay kumar
College: - S&S.S. Gandhi Polytechnic college, Surat
IntroductionA photo resistor or light-dependent resistor (LDR) or photocell is a light-controlled variable resistor. The resistance of a photo resistor decreases with increasing incident light intensity; in other words, it exhibits photoconductivity.
A photo resistor can be applied in light-sensitive detector circuits, and light- and dark-activated switching circuits.
A photo resistor is made of a high resistance semiconductor. In the dark, a photo resistor can have a resistance as high as a few mega ohms (MΩ), while in the light, a photo resistor can have a resistance as low as a few hundred ohms. If incident light on a photo resistor exceeds a certain frequency, photons absorbed by the semiconductor give bound electrons enough energy to jump into the conduction band. The resulting free electrons and hole conduct electricity, thereby lowering resistance.
The resista…

PIEZO ELECTRICITY GENERATOR

PIEZO ELECTRICITY GENERATOR 

INDEX
Sr. no. Name 1 introduction 2 What is piezoelectricity generation 3 How it works 4 Application of piezoelectricity 5

Astable Multivibrator using 555