I. Introduction
The independently designed and developed LED desk lamp with stable and adjustable illumination is divided into dimming desk lamp and digital display illumination meter. A wooden board covered with black flannel tape is connected to a 60cm optical axis as the frame of the dimming desk lamp; two ArduinoNano microcontrollers with soft string communication and interaction coordinate the realization of various functions of the desk lamp; a BH1750 illumination sensor collects illumination information; four groups of LEDs are evenly dispersed The lamp beads are connected in a circuit of three in series and two in parallel (three series lamps are one group, and two groups of lamps are connected in parallel); one button enables the desk lamp to switch
freely ; an adjustable power supply with stable output is used to power the desk lamp.
The digital display illuminance meter uses an Arduino Nano microcontroller as the control center; an illuminance sensor as the illuminance information collection part; an LCD1602 liquid crystal display as the illuminance information display part; and a manually switchable buzzer as the illuminance information reminder part; use Two 18650 rechargeable batteries power the light meter
2. Team introduction
Team members: Liu Zhipeng, Li Yuheng, Lai Peng
Instructor: Jiang Dawei
3. Plan argumentation based on this topic
1. Question requirements
1), basic requirements
1. The digital display illuminance meter is powered by a battery. The relative illumination digital display is no less than 3 and a half digits and does not require illumination calibration. The detection head of the digital display illuminance meter is placed 0.5 meters directly below the dimming desk lamp . Adjust the brightness of the desk lamp. When the maximum illumination is reached, the display number is greater than 1000 ; when the detection head is blocked and reaches the minimum illumination, the display number is less than 100 . When the brightness of the desk lamp continues to change, the digital display also changes continuously. When the brightness is stable, the digital display is stable and the jump is no more than 10 . There cannot be any exchange of information between the digital display illuminance meter and the dimming desk lamp.
2. Dimmable desk lamp input voltage Vi : DC 10V-15V , changes in Vi do not affect the brightness.
3. The brightness is continuously adjustable from the brightest to completely extinguished, without flickering ( the LED light panel power supply voltage ripple is less than 5% ).
4. When the power supply voltage of the desk lamp is 12V , the power efficiency ( the ratio of the power consumption of the LED light panel to the output power of the power supply) is not less than 90%.
2), fulfill the requirements
1. Adjust the desk lamp to the maximum brightness, and place a piece of A4 white paper 0.5 meters below it. The brightness of the entire area of the white paper is required to be uniform and stable, and the illumination difference at each point is less than 5%. There can be multiple illumination detection heads of the desk lamp, located at any position other than the A4 paper surface.
2. Use another LED light panel adjusted to maximum brightness as the environmental interference light source for testing, and change the distance to achieve changes in interference light intensity. When the ambient light changes slowly, the duration of the weakest and strongest changes is not less than 10 seconds. The desk lamp can automatically track the changes in ambient light and adjust the brightness to keep the illumination change in the center of the paper no more than 5%. When the ambient light suddenly changes, the weakest and strongest changes last for no more than 10 seconds. The duration of strong changes shall not exceed 2 seconds, and the sudden change in illumination in the center of the paper shall not exceed 10%. When the ambient light increases until the desk lamp goes out, the illumination change in the center of the paper is no more than 10%.
3. The smaller the impact of environmental interference light intensity changes on the paper surface illumination, the better.
3), other innovations
The innovation of our group is to place a switchable buzzer on the digital display illumination meter. When the illumination value is on, the larger the illumination value, the louder the buzzer will be; the smaller the illumination value, the weaker the buzzer sound will be.
2. Comparison and selection of central controller solutions
According to the requirements of the topic, the dimming desk lamp and the digital display illuminance meter are two independent parts that need to realize different functions, so the choice of microcontroller is very important.
Option 1: Use STM32 microcontroller as the central controller. The
STM32 series has multiple core versions and different packages. There are a variety of models to choose from. STM32 is powerful and can handle a variety of situations in actual operations. The STM32 microcontroller configuration is complex, and it is difficult to debug problems in actual use.
Option 2: Use Arduino Nano microcontroller as the central controller.
Arduino Nano microcontroller is small in size. It maintains efficient computing and processing capabilities while taking into account the characteristics of low cost and simple operation. At the same time, in order to ensure the stable realization of various functions of the dimming desk lamp, we adopted the soft serial communication and interaction method of two Nano microcontrollers as a solution.
In summary, the control center of the dimming desk lamp uses two Arduino Nano microcontrollers for soft serial communication interaction, and the control center of the illuminance meter uses a Nano
3. Comparison and selection of brightness adjustment solutions for desk lamps in manual mode
Due to the meaning of the question, the desk lamp requires both automatic and manual dimming. For mode switching, we adopted a solution that uses buttons to control the two states. How to achieve stable brightness control of the desk lamp in manual mode is an important issue we need to solve.
Solution 1: Use an adjustable step-up and step-down module to change the voltage value . The
LM2596S step-down module can achieve 5A high-power, high-efficiency step-down and low ripple, and has a digital tube that can display three-digit numbers to display the input and output voltage values in real time. The module is equipped with a high-efficiency, low-space-occupying heat sink to prevent temperature changes from affecting the function of the module. However, in actual use, changing the voltage to change the brightness of the LED light panel will inevitably have an adverse effect on the overall circuit, and it is inconvenient to debug the desk lamp function.
Option 2: Use a potentiometer to feedback analog values to achieve brightness control. By adjusting the resistance of the potentiometer, the PWM
values fed back to the microcontroller are different. According to the different PWM values, the LED light panel is controlled to turn on and off, and manual control is achieved. This solution is not only It meets the question requirements and is simple to operate, which facilitates subsequent code debugging. In summary, using a potentiometer to feedback analog values to realize brightness control of the desk lamp in manual mode is the optimal solution.
4. Comparison and selection of solutions for achieving stepless dimming
According to the requirements of the topic, the dimmable desk lamp needs to achieve stable and adjustable brightness, so we chose PWM high-frequency pulse width technology as the solution. The use of this technology is inseparable from the selection and comparison of relays and MOS tubes.
Option 1: Relay
As a common electrical control device, relays have a certain interactive relationship between the input loop and the output loop when the excitation reaches a specified threshold. Using relays in automated control circuits can achieve automatic adjustment functions. Relay manufacturing technology is mature and has low environmental requirements. However, the relay control state only has two states of opening and closing, and it cannot realize the high-frequency switching function. Obviously, it is impossible to realize the stepless dimming technology of LED
. Option 2: MOS tube
MOS tube has fast switching speed and excellent response ability. And it has the physical characteristics of low power consumption and low noise. Connect the MOS tube to the PWM pin of the microcontroller to enable high-frequency switching to achieve stepless dimming of the LED . However, due to its continuous high-frequency opening and closing, there will be serious heating problems that affect the performance of the device. To sum up, we choose MOS
tubes that are exposed to the air to fully dissipate heat to achieve LED stepless dimming technology.
4. Composition of the work
The works are composed of Arduino NANO , BH1750 , LED lamp beads, LCD1602 , LM2596S step-down module, and potentiometer.
5. Module Introduction
1. Main control
The advantages of using Aruino NANO are that it is easy to debug, has stable performance and is cheap.
2. Illuminance sensor
BH1750 is used as the illumination measurement sensor. The BH1750 illumination sensor has accurate measurement, is relatively compact in size, and is more cost-effective than other products in terms of price. The BH1750 illumination sensor uses I2C communication, which is more convenient during the code writing process and has greater reliability.
The actual digital display illuminance meter is shown in the picture
3. LCD1602 display
Our illumination test meter uses LCD1602 as the data display screen. LCD1602 is a very common display screen with low price, simple operation and small size. However, it also has shortcomings such as complicated wiring. But considering the overall cost and later code writing, we decided to still use LCD1602 as our data display part.
4. Desk lamp circuit design
In the lamp bead part, we use 24 lamp beads for lighting. We divide the lamp beads into four parts, each part has 6 lamp beads. Six lamp beads are connected in three series and then two sets of parallel circuits are connected in parallel to ensure uniform lighting. Below is our schematic.
Actual object as pictured
5. Other parts
There are also many small parts that are too common to explain too much, such as potentiometers, key switches, 4v lithium batteries and other small parts.
6. Overall part
Below I will present the schematic diagrams of the components we use so that everyone can learn and communicate.
Part of the code:
#include <Wire.h>
#include <SoftwareSerial.h>
SoftwareSerial myserial(11, 10);
#define ADDR 0b1011100
String teststring = "";
void setup() {
Serial.begin(9600);
myserial.begin(9600);
Wire.begin();
Wire.beginTransmission(ADDR);
Wire.write(0b00000001);
Wire.endTransmission();
}
void loop() {
int val = 0;
Wire.beginTransmission(ADDR);
Wire.write(0b00000111);
Wire.endTransmission();
Wire.beginTransmission(ADDR);
Wire.write(0b00100000);
Wire.endTransmission();
delay(50);
Wire.requestFrom(ADDR, 2);
for (val = 0; Wire.available() >= 1; ) {
char c = Wire.read();
val = (val << 8) + (c & 0xFF);
}
delay(70);
myserial.print(val);
myserial.print("v");
}
void setup() {
Serial.begin(9600);
myserial.begin(9600);
for(int i=0;i<=3;i++)
{
pinMode(led[i], OUTPUT);
}
pinMode(8, INPUT);
}
void light_work1() {
for(int n=0;n<=9;n++)
{
light[n] = analogRead(A1);
delay(5);
}
for(int n=0;n<=9;n++)
{
light[n]>MAX;
MAX=light[n];
}
for(int n=0;n<=9;n++)
{
light[n]<MIN;
MIN=light[n];
}
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet