Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Applied Mechanics and Materials Vols.

462-463 (2014) pp 104-107 Online: 2013-11-15


© (2014) Trans Tech Publications, Switzerland
doi:10.4028/www.scientific.net/AMM.462-463.104

Design of Light Intensity Detection System Based on STM32


Yunhua Zhou1,a
1
Tianjin University of Technology and Education, Tianjin 300222 China
a
zhouyunhua2013@163.com

Keywords: Light Intensity Detection; Embedded; STM32 Processor; BH1750

Abstract. With the needs of the society development, the light intensity detection technology has
gradually into the lighting control, health care, biological research and other fields. Based on many
fields and equipments for the light requirement, this paper proposed and designed a light intensity
detection system. The hardware circuit used the STM32F103VB as the main controller; collocate
with BH1750 digital light intensity sensor and LCD module, the power supply module. The design
of software used the modular design, including data acquisition, data display, and intelligent control
module. After the practical application, the detection system works well.

Introduction
Light intensity detection can perceive some signal which human beings cannot feel, so it can
replace the human do the automatic control and detection. Light intensity detection system mainly
through the light sensor to sense the intensity of the light, and thus some of the things that were
detected and the subsequent analysis and processing. The light intensity detection systems is widely
used in the fields of industry and agriculture, intelligent building, environmental monitoring and so
on; it not only becomes the strong technical support for living digitization and information, but
also it is an important means to obtain and update the environmental monitoring data. Therefore, in
the modern society, it is particularly important that the design of a light intensity detection system
with intelligent, excellent performance, reasonable price and space expand [1].
Based on the development of science technology, circuit and smart chip fields, and according to
the characteristics of embedded devices with high performance, low power consumption and low
cost, this paper designed and developed a light intensity detecting system based on STM32
processor. The system uses a light sensor BH1750 to collect light intensity data, and by the STM32
processor for data processing and control, so it can be applied to lighting control for intelligent
building, street and greenhouse [2-3].

The overall design of system


The overall design of the light intensity detection system can be divided into the sensor part and
the main circuit part. The sensor part uses digital light intensity detection sensor, eliminating the
other light detection scheme for A/D conversion, so simplifies the design. The main circuit includes
the main controller module STM32F103VB, power supply module, liquid crystal display module,
module etc.. The overall schematic diagram of the detection system is shown in Figure.1:
From the Tab 1 data, the different wavelengths of light for the growth of plants is different, plants
need light wavelength of about 400 ~ 720nm.400 ~ 520nm (blue) light, and 610 ~ 720nm (red)light
has the greatest contribution to plant growth. 520 ~ 610nm (green) light is absorbed by plant
pigments lower rates.

The hardware design of system

The part of the sensor


Light intensity detecting sensor uses digital light intensity sensor BH1750, and BH1750 is used
as a digital light intensity sensor integrated circuit two wire serial bus interface. The integrated
circuit can adjust the luminance of the LCD and keyboard backlight according to the collection of

All rights reserved. No part of contents of this paper may be reproduced or transmitted in any form or by any means without the written permission of Trans
Tech Publications, www.ttp.net. (ID: 149.171.67.164, University of New South Wales, Sydney, Australia-14/07/15,07:26:02)
Applied Mechanics and Materials Vols. 462-463 105

light intensity data. It can detect a wide range of light intensity variation using its high resolution
[4]. The main features are as follows:

Fig.1 The schematic diagram of light intensity detection system


(1) The higher spectral sensitivity characteristic (peak wavelength sensitivity typical values:
560nm);
(2) Output the corresponding digital value of brightness;
(3) The wide range of input optical range (equivalent to 1-65535lx);
(4) The optical noise removal functions of 50Hz/60Hz;
(5) Two optional I2C slave address;
(6) Changes in the minimum error ± 20%.
The communication between BH1750 and main controller uses the standard I2C communication
protocol, and the I2C-bus is a PHILIPS developed by two wire serial bus, used to connect the
microcontroller and its peripheral equipment. The circuit schematic diagram between BH1750 and
the main controller is shown in Fig.2:

Fig.2 The circuit schematic diagram between BH1750 and the main controller

The main control module


The main control module is designed with the ARM Cortex-M3 for a 32 bit STM32F103VB
processor, and the processor is the latest generation of embedded ARM processor, 72MHz clock
frequency, the built-in high speed memory, with enhanced I/O port and serial port, SPI and other
peripheral rich [5]. This system is the use of the chip itself comes with the I2C interface and light
intensity sensor BH1750-phase connection for light intensity data collection. 5V external

The power supply module


The system uses a supply voltage of 3.3V, so the power supply module is responsible for external
5V to 3.3V, which is used to provide power for control module and light intensity sensor. The power
supply uses a voltage regulator chip AMS1117 conversion, which is a low dropout positive voltage
output three-terminal linear regulator circuit, at 1A output current under a pressure drop of 1.2V,and
the output voltage is divided into fixed and adjustable output voltage versions version. This system
chooses the fixed output versions AMS1117-3.3, with the output voltage 3.3V [6], the schematic
diagram of the power supply module is shown in Fig.3:
106 Progress in Mechatronics and Information Technology

Fig.3 The schematic diagram of the power supply module

The LCD display module


A 2.4-inch TFT LCD screen module with touch function is configured for the light intensity
detection system, so as to view the work status and light intensity parameter of the light sensors. At
the same time, it is for the future expansion of the corresponding function.

The software design of system


The software design of the system uses the modular design. The software part is divided into data
acquisition, data display module, in order to improve the timeliness of software design.

The workflow of system


When the system works, it is first to initialize various parts of the system; and after this it can
wait to receive user commands. The system can execute different tasks according to the different
operations; the flow chart of the main program is shown in Fig.4:

Fig.4 The flow chart of the main program

The software design of BH1750 sensor


BH1750 is a digital output of the ambient light sensor, the internal integration of 16 bit AD
converter, enabling the digital value output directly. The communication between BH1750 and main
controller uses the standard I2C communication protocol, which it has three types of signal
transmission of data process for the start signal, signal and response signal.
Applied Mechanics and Materials Vols. 462-463 107

The work process of measuring light intensity for this system is shown in Fig.5:

Fig.5 The work flow chart of BH1750


(1) Power on, enter standby mode.
(2) Send the activation command, so that the chip is ready state.
(3) Transmits a measurement command to be measured in a corresponding mode of operation: if
the BH1750 module with a single measurement mode, then after measurement, BH1750 into the
standby state; if it is working in a continuous measuring mode, it has been in the state of
measurement, real-time data controller can be directly read chip measurement, rotating between two
working modes.
(4) The main controller reads the measurement results.

Conclusion
This paper designs and implements the light intensity measurement system based on the STM32
microprocessor. The system can detect light intensity of an environment according to the hardware
platform and the software design. The system has the advantages of small volume, low power
consumption and low cost, so it can be widely used in intelligent lighting system, security and other
fields, and has broad application prospects.

References
[1] Anke He. Wireless Street Lamp Control System Based on the STM32 and BH1750 [J]. Applied
Technology, 2011 (20) :15-17.
[2] Zhonghua Yun, Tianrui Bai. Indoor Light Intensity Measuring Instrument Based on
BH1750[J].Microcontrollers & Embedded Systems, 2012 (6) :27-29.
[3] Jian Wang, Tengfei Mao, Yingge Chen. Design and Implement of An Metering System Based
on BH1750[J]. Journal of Changshu Institute Technology(Natural Sciences), 2011, 25 (2): 117-120.
[4] ROHM.BH1750FVI light intensity sensor data sheet [EB / OL]. http://www.rohm.com.
[5] Ning Li. Based on the STM32 processor MDK application development [M]. Beijing: Beijing
University of Aeronautics and Astronautics Press, 2008,11.
[6] Xiaoqing Zheng, Rijie Yang. Design of multiple-output DC-DC circuit[J]. Research and
Development, 2012,31 (9) :31-33.
Progress in Mechatronics and Information Technology
10.4028/www.scientific.net/AMM.462-463

Design of Light Intensity Detection System Based on STM32


10.4028/www.scientific.net/AMM.462-463.104

You might also like