Link£ºhttps://pan.baidu.com/s/1nmJy5t9vIsmBLq_sTPXTUw
Extraction Code£º1234
After Copying This Content, Open Baidu Netdisk Mobile PhoneApp£¬More Convenient to Operate
Use£º
Light Brightness Detection,Light Brightness Sensor£¬Smart Car Light Search Module
Module Features£º
1¡¢Sensitive Photosensitive Resistor Sensor
2¡¢Comparator Output£¬Clean Signal£¬Good Waveform£¬Strong Driving Ability£¬More15mA¡£
3¡¢Adjustable Potentiometer Can Adjust the Brightness of Light Detection
4¡¢Work Voltage3.3V-5V
5¡¢Output Form £ºDigital Switching Output£¨0and1£©
6¡¢Fixed Bolt Hole£¬Easy to Install
7¡¢Small PlatesPCBSize£º3.2cm x 1.4cm
8¡¢Wide VoltageLM393Comparator
Module Usage
1¡¢Photosensitive Resistor Module Is Most Sensitive to Ambient Light£¬Generally Used to Detect the Brightness of Light in the Surrounding Environment£¬Trigger Single Chip Microcomputer Or Relay Module, Etc.£»
2¡¢When the Ambient Light Brightness of the Module Does Not Reach the Set Threshold£¬DOTerminal Output High Level£¬When the Brightness of Ambient Light Exceeds the Set Threshold£¬DOTerminal Output Low Level£»
3¡¢DOThe Output Can Be Directly Connected to the Single Chip Microcomputer.£¬Detect High and Low Levels through Single Chip Microcomputer£¬to Detect the Change of Light Brightness in the Environment£»
4¡¢DOThe Output Can Directly Drive Our Relay Module£¬Thus, a Light Control Switch Can Be Formed.¡£
External View of the Front and Back of This Series of Modules
Single Chip Microcomputer Test Program
/******************************************
Shenzhen Hitherway E-Commerce Company
Sensor Trigger Test
Single-Chip Microcomputer£ºSTC89C52
The Baud Rate£º9600
Product Use£ºLight Detection¡£
*****************************************/
#include <reg52.h>
unsigned char date;
#define uchar unsigned char
#define uint unsigned int
sbit key1=P0^1;
/* Function Declaration -----------------------------------------------*/
void delay(uint z);
void Initial_com(void);
//***********************************************************
/*
********************************************************************************
** Function Name £º delay(uint z)
** Function Function £º Delay Function
********************************************************************************
*/
void delay(uint z)
{
uint i,j;
for(i=z;i>0;i--)
for(j=110;j>0;j--);
}
//******************************
//*****Serial Port Initialization Function***********
//******************************
void Initial_com(void)
{
EA=1; //Total Interruption
ES=1; //Allow Serial Port Interruption
ET1=1; //Allow TimerT1Interrupt
TMOD=0x20; //TimerT1£¬In the Way2Interrupt Generates Baud Rate
PCON=0x00; //SMOD=0
SCON=0x50; // Way1 Controlled by Timer
TH1=0xfd; //Set the Baud Rate9600
TL1=0xfd;
TR1=1; //Open TimerT1Operation Control Bit
}
//*************************
//**********Main Function*********
//*************************
main()
{
Initial_com();
while(1)
{
if(key1==0)
{
delay(); //Jitter Elimination
if(key1==0) //Confirm Trigger
{
SBUF=0X01;
delay(200);
}
}
if(RI)
{
date=SBUF; //SCM Acceptance
SBUF=date; //Single Chip Microcomputer Sending
RI=0;
}
}
}