Design and production of rain control and light control timing controller based on P87LPC764
Source: InternetPublisher:宋元浩 Keywords: Light control circuit Updated: 2023/12/11
1. Working principle:
1. Circuit characteristics (see Figure 1 for the electrical schematic and Figure 2 for the printed circuit)
The control circuit uses PHILIPSP87LPC764 microcontroller. The reset circuit uses an on-chip power-on reset, and after reset, output pins 10, 13, and 14 are set to high level.
Use an off-chip crystal oscillator. Both the photometry and rain measurement circuits use on-chip analog comparators, which greatly simplifies the circuit. An internal watchdog circuit is used to improve the reliability of the program.
2. Overall structure
The controller is composed of a main control circuit, an input circuit, an output circuit, a photometry circuit, a rain measurement circuit, a working status display circuit, a power circuit, etc.
▲The main control circuit is composed of P87LPC764, oscillation circuit (C1, C2, XTAL), etc.
Circuit function:
(1) Judge the light (night or day). When the light does reach the opening illumination, control the output circuit to turn on the controlled electrical appliance (such as street lamp, etc.).
(2) After the controlled electrical appliance is turned on. The controller is not affected by any light until the controlled appliance is turned off regularly.
(3) After turning off the controlled electrical appliances regularly, do not turn on the controlled electrical appliances that night.
▲Input circuit: composed of BCD DIP switch, etc. The BCD DIP switch is used to set the turn-on time, 1~10 is the timer of 1~10 hours respectively.
▲ Photometry circuit: It is composed of R2, R5, R7 and GM photoresistor. It is used to measure external light, set the opening light illumination, and select the opening illumination by adjusting R5 (selection range llx ~ lOlx).
▲Rain measuring circuit: composed of R3, R6, YM, C4, D. 1 composition. YM is a rain-sensitive resistor, which has a high resistance value when there is no rain and a low resistance value when it rains. In rainy days, IC1 (14) pin outputs low level, and D1 clamps the low level of BG2 base level, so that the output circuit has no output. When there is no rain, IC1 (14) pin outputs high level, and the output loop is controlled by the main control loop.
▲Output circuit: composed of R4, R8, R9, R10, BG1, BG2, D4, relay, etc.
▲Working status display: D2 (red indicator light) continues to light up, D3 (green indicator light) goes out, and the controlled electrical appliance status is to be turned on; D2 flashes (cycle is 4 seconds) to determine whether the light is approaching evening; D2 flashes (cycle is 2 seconds), and D3 lights up at the same time, turning on the controlled electrical appliance status; D2 strobes (cycle is 1 second) to determine whether the light is approaching dawn.
2. Component selection
The photoresistor should be a product with an open resistance of 1kΩ, a dark resistance of 1MΩ, and good linearity; the photosensitive resistor can be made with a copper-clad plate. The structure is shown in Figure 3. The distance between the two poles of the copper-clad plate is about 1mm. See Figure 1 for other component parameters.
3. Debugging and installation
Install the cured program 987CPC764 into the circuit board.
Debugging and turning on the light illumination: Adjust the ambient light illumination to 10lx, and test the resistance value of the photoresistor (the error of the same model of genuine photoresistor is not large, and the average value can be taken). The value is the minimum value of the adjusted light resistor RX. Take one Resistor R7 of equal value can be connected in series to potentiometer R5; then adjust the ambient light illumination to 11x to test the resistance of the photoresistor. Its value is the maximum value of the adjusted light resistor RX. The nominal value of potentiometer R5 is RX. The maximum value minus the value of R7. When R5 is adjusted to the maximum, the opening illumination is llx. When R5 is adjusted to the minimum, the opening illumination is 101x.
Debugging the rain sensitivity: First use a potentiometer of about 1MΩ (set the potentiometer to the maximum) instead of R6, connect the rain-sensitive resistor to the circuit board with a wire, power up the circuit board, and sprinkle a little water on the rain-sensitive resistor. Adjust the potentiometer from large to small and measure IC1 (18) pin. When it changes from high level to low level, the resistance of the potentiometer is the value of R6.
Installation: In order to prevent electrical interference, install the movement in an iron case, and isolate the control circuit and output circuit with an iron sheet. In order to facilitate observation and setting of the initial value, D2, D3, dimming potentiometer R5, BCD dial switch, photoresistor socket and rain-sensitive resistor socket should be installed on the casing.
- LED acceleration and deceleration motion display composed of CD4017
- DIY a hat with a programmable LED display
- Delayed gradual lighting with protection function
- LED Flasher circuit using 2 transistors for LED switching
- Gas flameout alarm circuit
- AC and DC dual-purpose flash light
- Large light emitting diode display circuit
- Fluorescent lamp dimming circuit composed of thyristors
- Touch/wireless remote control dimmer light circuit diagram
- 2KHZ LED flash
- Light control circuit diagram using 555 time base circuit
- night light lighting circuit
- Street light control circuit 9
- Street light control circuit 8
- Street light control circuit 7
- Street light control circuit 5
- One of the street light control circuits
- Stable and reliable light control circuit
- Intermittent operation of light control circuit
- Full wave light control circuit