Automated Display Brightness For Motorcycles
Automated Display Brightness For Motorcycles
The display in motorcycle indicates several parameters like fuel level, speed, distance traveled,
present gear, engine temperature etc. Overall functioning of the bike can be monitored on the
display.
A constant brightness is maintained in the display throughout the day, which results in wastage of
battery power. The display brightness is automated such that the light intensity of display changes
with respect to surrounding brightness and hence saves power.
The display brightness increases when the outside light intensity increases and display brightness
reduces when outside light intensity decreases.
Outside light intensity Display brightness outside light intensity Display brightness
Components required –
Arduino UNO
LDR
Resistor (470, 100k ohm)
Capacitor (0.1uF)
Transistor 2N2222
1 watt Power LED
Connecting wires
Breadboard
LDR - A light dependent resistor works on the principle of photo conductivity. Photo
Conductivity is an optical phenomenon in which the materials conductivity is increased
when light is absorbed by the material. When light falls i.e. when the photons fall on the
device, the electrons in the valence band of the semiconductor material are excited to the
conduction band. These photons in the incident light should have energy greater than the
band gap of the semiconductor material to make the electrons jump from the valence band to
the conduction band. When a light dependent resistor is kept in dark, its resistance is very
high. This resistance is called as dark resistance. It can be as high as 1012 Ω.
Transistor (2N2222A) - The 2N2222A is a common NPN bipolar junction transistor commonly
used in general purpose low-power amplifying or switching applications. Featuring low to
medium current needs.
Arduino Uno - Arduino consists of both a physical programmable circuit board (often referred to
as a microcontroller) and a piece of software, or IDE (Integrated Development Environment)
that runs on your computer, used to write and upload computer code to the physical board.
Arduino pins –
GND (3): Short for ‘Ground’. There are several GND pins on the Arduino, any of which can be
used to ground your circuit.
5V (4) & 3.3V (5): As you might guess, the 5V pin supplies 5 volts of power, and the 3.3V pin
supplies 3.3 volts of power. Most of the simple components used with the Arduino run happily
off of 5 or 3.3 volts.
Analog (6): The area of pins under the ‘Analog In’ label (A0 through A5 on the UNO) are
Analog In pins. These pins can read the signal from an analog sensor (like a temperature
sensor) and convert it into a digital value that we can read.
Digital (7): Across from the analog pins are the digital pins (0 through 13 on the UNO). These
pins can be used for both digital input (like telling if a button is pushed) and digital output (like
powering an LED).
PWM (8): digital pins (3, 5, 6, 9, 10, and 11 on the UNO). These pins act as normal digital
pins, but can also be used for something called Pulse-Width Modulation (PWM). These pins
as being able to simulate analog output (like fading an LED in and out).
AREF (9): Stands for Analog Reference. Most of the time we can leave this pin alone. It is
sometimes used to set an external reference voltage (between 0 and 5 Volts) as the upper
limit for the analog input pins.
Programming Arduino -
Once Arduino IDE is installed on the computer, we connect the board with computer using USB cable. Now
open the Arduino IDE and choose the correct board by selecting Tools>Boards>Arduino/Genuino Uno, and
choose the correct Port by selecting Tools>Port. Arduino Uno is programmed using Arduino programming
language based on Wiring.
Communication –
Arduino can be used to communicate with a computer, another Arduino board or other microcontrollers. The
ATmega328P microcontroller provides UART TTL (5V) serial communication which can be done using
digital pin 0 (Rx) and digital pin 1 (Tx). An ATmega16U2 on the board channels this serial communication
over USB and appears as a virtual com port to software on the computer.
Circuit Diagram -
100k
Arduino build in ADC (Analog to digital converter) peripheral can be utilized to measure voltage.
We can use Arduino ADC (analog to digital) pins to measure the voltage passing the light detector.
Arduino has a 10-bit ADC module. It can measure maximum voltage of rating on which Arduino is
working typically 5 volts precisely. 10-bit ADC max reading value is 1024. So 1024 corresponds to
5 volts. 512 corresponds to 2.5 volts and 0 represents no voltage.
To read an analog voltage we use the command -
Val = analogRead (analogPin);
Where analogPin is analog channel used(A0----A5) and Val is variable in which analog value
returned by the function is saved.
PWM (Pulse width modulation) is basic technique used by microcontrollers to fade or control the
brightness of led. PWM actually outputs a varying voltage on digital pins of microcontroller.
Varying voltage is generated using the timers of microcontrollers.
PWM utilizes timers and a particular pin is switched on and off for a specified period of time. On
period is generally known as duty cycle we can compute the output voltage by changing the duty
cycle. 100% duty cycle represents full voltage output and 50% duty cycle outputs half voltage.
Pwm functionality is present on Arduino Uno pins (3, 5, 6, 9, 10, or 11). PWM signal ranges
between 0 to 255. Where 255 represents 5 volts and 0 represents 0 volts. 127 represents 2.5
volts.
Arduino analogWrite(x,y) function allow us to output a Pwm voltage of desired voltage. In
function the x argument is the pin number to which we want our Pwm signal to appear, y
argument is pwm value.
WORKING -
Based on the intensity of light on the ldr, the voltage divider circuit provides a voltage input to
the analog input pin of the Arduino, based on this input value the duty cycle is varied at the
output digital pins.
Initially when light intensity is very high on the ldr, its resistance is very low and hence a high
voltage (approx. 5V) input is provided at A0 (1024 - 1000). At the output digital pin the duty
cycle is almost 100%i.e. led glows brightly.
For an input value between (200-0) at A0 pin min brightness level has been maintained i.e.
when the light intensity on ldr is very low, the duty cycle cannot reduce below a specific
value.