Stadium lights consume a lot of electricity. They are high beam lights with high wattage rating. A lot of electricity can be saved by controlling the intensity of these lights manually or automatically. For controlling the intensity of light, the voltage supply to the lights need to be controlled. This project is a demonstration of the same application. In this demo project instead of actual stadium lights, LED lights are used.
Stadium lights consume a lot of electricity. They are high beam lights with high wattage rating. A lot of electricity can be saved by controlling the intensity of these lights manually or automatically. For controlling the intensity of light, the voltage supply to the lights need to be controlled. This project is a demonstration of the same application. In this demo project instead of actual stadium lights, LED lights are used. A series of 8 LEDs are used to demonstrate intensity control functionality. For manual control of light intensity, a variable resistor is used and for automatic control of light intensity, an LDR sensor is used. The LEDs are connected in two series via 2N2222 transistor. The transistor acts as an amplifier whose output is driven by the voltage at its base pin. A set of two switches is used to set the automatic or manual mode of project’s operation.
The project is built on Arduino Pro Mini. The Arduino sketch manages to detect mode selection, sense input voltage from variable resistor and the LDR sensor and output a suitable voltage at the base of the light controlling transistor. The Arduino sketch is written using Arduino IDE and burnt to the board using the same.
Components Required –

Circuit Connections –
The circuit is built around Arduino Pro Mini. The LED series, SPDT switches, LDR sensor and Potentiometer are connected to the Arduino board. The circuit connections are as follow –
Power Supply – The circuit needs a 5V regulated DC for its operation. An 18V battery can used as the primary source of power. The supply from the battery can be regulated to 5V using 7805 voltage regulator IC. The pin 1 of the voltage regulator IC should be connected to the anode of the battery and pin 2 of it should be connected to the ground. The voltage output must be drawn from pin 3 of the 7805 IC.
LED Series – A group of 8 LEDs are interfaced to the Arduino board as demo of stadium lights. The LEDs are connected so that their cathode pins are connected to the ground while the anode pins are connected to the emitter of 2N2222 transistor. The base of the transistor is connected to the pin 6 of the Arduino board and collector is connected to VCC.
SPDT switches – The switches are connected at pins 9 and 8 of the Arduino board. By default the pins are connected to ground via 10K resistors. On toggling the switches, the respective pins are short circuited to VCC. If the switch connected at pin 9 has HIGH while switch connected at pin 8 has LOW, the automatic mode is selected and the LED lights are operated according to the LDR sensor. If the switch connected at pin 9 has LOW while switch connected at pin 8 has HIGH, the manual mode is selected and LED lights are operated according to the potentiometer. If both the switches has LOW, the LEDs are switched OFF.
LDR sensor – The LDR sensor has a resistance dependent on the ambient light intensity. More is the light falling on the sensor, less is its resistance. The LDR sensor is connected in a potential divider circuit at A0 pin of the controller. It outputs analog voltage at the controller pin which is scaled from 0 to 5 V.
Potentiometer – A 10K pot is interfaced at the A1 pin of the Arduino. The potentiometer allows passing a variable voltage below 5V at the controller pin.
How the circuit works –
Once the Arduino board is powered on, the board initializes the circuit and set the pins digital output or input. It checks the status of pins connected to the SPDT switches. If the switch connected at pin 9 has HIGH while switch connected at pin 8 has LOW, the automatic mode is selected and the LED lights are operated according to the LDR sensor. If the switch connected at pin 9 has LOW while switch connected at pin 8 has HIGH, the manual mode is selected and LED lights are operated according to the potentiometer. If both the switches has LOW, the LEDs are switched OFF by sending a LOW logic at the pin 6 of the board.
If automatic mode is selected, the Arduino reads analog voltage at pin A0 where the LDR sensor is connected in a voltage divider circuit. More is the surrounding light, less is the resistance of LDR and less is the voltage output at the controller pin. The voltage is read and digitized using in-built ADC channel. The value is factored by four and the resultant voltage value is passed to the pin connecting amplifier transistor. So more is the surrounding light, less is the voltage supplied to the transistor and less is the intensity of LED lights.
if manual mode is selected, the Arduino reads analog voltage at pin A1 where the potentiometer is connected. On moving the potentiometer knob, the voltage output at the pin is varied. The same voltage is converted to a digitized reading using in-built ADC channel and factored by four. The resultant value of voltage is supplied at the pin 6 of the Arduino where transistor’s base is connected. So more is the voltage output from the potentiometer, more is the supply voltage for triggering at the base of the transistor and more is the intensity of LED lights.
The factor of four has been determined after calibration of the LED’s intensity during project testing. On making the project and using other set of LEDs, other factor may be found suitable for the respective set of LEDs. Since the inbuilt ADC channel of the Arduino board is 10-bit long, the factor must have a denominator of 1024 and a suitable numerator as determined during project test.
Check out the project code to learn how Arduino reads status of SPDT switches, read analog voltage from LDR sensor and potentiometer and output a factored voltage at transistors base.
Programming Guide –
The Arduino sketch declares variables denoting potentiometer, LDR sensor, LED connection and SPDT switches and assign the respective controller pins according to their interfacing.
int potPin= A1;
int LDR = A0;
int LED= 6;
int sw1 = 9;
int sw2 = 8;
The setup() function is called which runs for once after the controller is powered ON. The function set the pins connected to base of the 2N2222 transistor as digital output and pins connected to the potentiometer, LDR sensor, and SPDT switches as digital input using pinMode() function.
void setup() {
pinMode(potPin, INPUT);
pinMode(LDR, INPUT);
pinMode(LED, OUTPUT);
pinMode(sw1, INPUT);
pinMode(sw2, INPUT);
}
The loop() function is called which iterates infinitely. The status of the SPDT switches is read using digitalRead() function and stored in variables. if the switch connected at pin 9 has HIGH while switch connected at pin 8 has LOW, the automatic mode is selected and the ldr() function is called. If the switch connected at pin 9 has LOW while switch connected at pin 8 has HIGH, the manual mode is selected and pot() function is called. If both the switches has LOW, the LEDs are switched OFF by passing LOW at the pin 6 of Arduino which triggers OFF the transistor circuit.
void loop() {
int SWITCH1 = digitalRead(sw1);
int SWITCH2 = digitalRead(sw2);
if (SWITCH1 == HIGH && SWITCH2 == LOW)
{
ldr();
}
else if (SWITCH2 == HIGH && SWITCH1 == LOW)
{
pot();
}
else if (SWITCH2 == LOW && SWITCH1 == LOW)
{
digitalWrite(LED,LOW);
}
}
In the pot() function, the voltage from the potentiometer is read using analogRead() function and stored in a variable. The value is scaled by a factor and written to the pin 6 of Arduino where the base of the LED driving transistor is connected.
void pot()
{
int readValue = analogRead(potPin);
int writeValue = (255./1023.) * readValue;
analogWrite(LED, writeValue);
}
In the ldr() function, the voltage from the LDR sensor is read using analogRead() function and stored in a variable. The value is scaled by a factor and written to the pin 6 of Arduino where the base of the LED driving transistor is connected.
void ldr()
{
int sv = analogRead(LDR);
int wv = (255./1023.) * sv;
analogWrite(LED, wv);
}
This completes the Arduino code for Stadium Lights Intensity Control Project.
You may also like:
Project Source Code
###
//Program to
###
Filed Under: Arduino Projects, Electronic Projects
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.