LDR with RCWL-0516 Motion Sensor switches on light only when it is dark
Arduino, Node MCU, ESP32

For security reasons and also to save power we use every day Passive Infrared sensor which is economically priced and provides reasonable amount of flexibility. But since it is dependent on body heat for triggering the alarm or switching on LED bulb it does not deliver consistent and reliable solution. For many applications when we need the light to be on till the presence of people or person in the room, after pre-set time the light goes off. This has led to invention of RCWL-0516 microwave radar motion sensor based on doppler effect.
RCWL-0516 has Doppler radar which works by bouncing a microwave signal off a desired target and reading the frequency of the returned signal. By analysing how the target’s motion has altered the frequency of the transmitted signal, the target’s velocity can be measured.
The RCWL-0516 itself is pretty straightforward and works out of the box. Simply apply power by connecting DC and GND of Arduino, Node MCU or ESP32 to 5 volts/3.3 volts and GND of RCWL-0516. The sensor output goes HIGH for two seconds when motion is detected and goes LOW when idle (no motion detected).
The RCWL-0516 also has support for an optional light-dependent resistor (LDR), which enables the device to operate only in the dark. This is useful for building motion-sensitive lighting systems.
There are LDR pads marked as CDS on the PCB which stands for cadmium sulphide which is used in LDRs. So we can solder LDR at this place or one of the output pin is marked as CDS and we can solder LDR between this pin and ground.