How many times do we forget to turn off lights in the daytime? We still turn on/off our lights manually with a switch with our fingers. Most people still turn their lights on when the sun is up and has brightened the room or when they don't use the room.
Imagine how much energy we have wasted and how much money that we could save. Lighting controls can help us save energy and money. It is necessary for us to keep the minimal loss of electricity.
Lighting Control with LDR Module SensorLDR sensor module is used to detect the intensity of light. When there is light, the resistance of LDR will become low according to the intensity of light. The greater the intensity of light, the lower the resistance of LDR. The system works by sensing the intensity of light in its environment with the LDR module sensor.
In this project, STM32F407 Discovery is used as the microcontroller and the LDR module sensor is used to detect the lighting. The LEDs will be supplied from a 12V DC battery. The 5V DC relays are for switching the LEDs. The LEDs that I use in this project are HPL 9-12V 10W LEDs.
The LDR module sensor will detect if the light is bright or dim. When the detected light is bright, the sensor will send logic 1 to the microcontroller and logic 0 if it's dim. Then, the microcontroller program is coded.
The program is coded to make the LED turns on when the LDR module sensor detects light and off when the LDR module sensor doesn't detect light. The LCD will show the condition of the lamp.
// LED CONTROL WITH LDR MODULE SENSOR TEST
if (HAL_GPIO_ReadPin(GPIOB, LDR_Pin)==0){
// LED 1 ON
HAL_GPIO_WritePin(GPIOE, LED1_Pin, GPIO_PIN_RESET);
// WRITES ON LCD
lcd_gotoxy(0,0);
lcd_puts("ON ");
}
else if (HAL_GPIO_ReadPin(GPIOB, LDR_Pin)==1){
// LED 1 OFF
HAL_GPIO_WritePin(GPIOE, LED1_Pin, GPIO_PIN_SET);
// WRITES ON LCD
lcd_gotoxy(0,0);
lcd_puts("OFF");
}
Lighting Control (with 1 LED)Now, we can start to create the lighting control for 2 LEDs. We will use the same planning from the previous one for the 2 LEDs.
Next is to add one more LED to the hardware circuit. Supply the second LED with the battery too by paralleling two LEDs with the battery. Connect the second LED to the DC relay too. Then add 1 more GPIO Output on the STMCubeMX and edit the main program a little bit.
// LED CONTROL WITH LDR MODULE SENSOR TEST
if (HAL_GPIO_ReadPin(GPIOB, LDR_Pin)==0){
// LED 1 ON
HAL_GPIO_WritePin(GPIOE, LED1_Pin, GPIO_PIN_RESET);
// LED 2 ON
HAL_GPIO_WritePin(GPIOE, LED2_Pin, GPIO_PIN_RESET);
// WRITES ON LCD
lcd_gotoxy(18,0);
lcd_puts("ON");
lcd_gotoxy(18,1);
lcd_puts("ON ");
}
else if (HAL_GPIO_ReadPin(GPIOB, LDR_Pin)==1 ){
// LED 1 OFF
HAL_GPIO_WritePin(GPIOE, LED1_Pin, GPIO_PIN_SET);
// LED 2 OFF
HAL_GPIO_WritePin(GPIOE, LED2_Pin, GPIO_PIN_SET);
// WRITES ON LCD
lcd_gotoxy(18,0);
lcd_puts("OFF");
lcd_gotoxy(18,1);
lcd_puts("OFF");
}
Compile and flash it to the STM32F407 Discovery microcontroller. Connect the LED 2 GPIO Output to the LED 2 DC Relay. Now we can finally use the lighting control system for 2 LEDs. Move the LDR module sensor up to detect bright light and down to detect dim light. You can modify the brightness sensitivity of the LDR module sensor however you like with the LDR module sensor's potentiometer.
So how can lighting control be used for energy saving?
- First, we calculate the normal energy usage for a day. As an example, we use a 10-Watt LED which is usually turned on every day.
10 Watt × 24 hours = 240 kWh
. So the normal energy usage of the LED for a day is 240 Wh (Watt-hour). - Then we calculate the energy usage for a month.
240 Wh × 30 days = 7200 Wh
.
Now we calculate the energy usage of the LED after the lighting system is implemented. If the lighting system doesn't detect light from 5 P.M. until 6 A.M., the lighting system will turn on the LED for 13 hours a day.
- Let's calculate the energy usage for a day.
10 Watt × 13 hours = 130 Wh
. So we get the energy usage of the LED after using the lighting system for a day to be 130 Wh. - Next, we calculate the energy usage for a month.
130 Wh × 30 days = 3900 Wh
.
So now, we get the normal energy usage of the LED for a month is 7200 Wh and the energy usage after using the lighting system for a month is 3900 Wh. From this example, we could save 3.300 Wh or 45.8% energy usage by using the lighting system.
Sources- http://www.jselectronics.com.my/index.php?ws=showproducts&products_id=1963634#:~:text=LDR%20sensor%20module%20is%20used, to%20the%20intensity%20of%20light.
- https://maker.pro/arduino/tutorial/how-to-use-an-ldr-sensor-with-arduino
- https://sunenergy.id/blog/cara-menghitung-biaya-listrik/#:~:text=Untuk%20menghitung%20biaya%20listrik%20Anda, 1.000%20%3D%2020%2C95%20kWh.
Comments
Please log in or sign up to comment.