Small project: SCM SCR dimming design with optocoupler zero-crossing detection component list source code schematic diagram, etc.

Someone asked me to do a graduation project on SCR dimming. I made one with 51 single-chip microcomputer and sent it to learn with everyone.

I used the 52 MCU on the development board I bought. The crystal oscillator uses 11.0592M. The optocoupler uses two thyristors MOC3023 and P521-1. The BTA41 and a rectifier bridge capacitor use CBB 0.06μF resistors. Since I do n’t have that much, I found similar values ​​and then added a power indicator and work indicator button. I directly modified it into an independent button on the development board.

After the power is adjusted, the several resistors become very hot. But the part of zero-crossing detection is still not clear. Before I made a spot welding machine, there was no zero-crossing detection at all, but added pulse width adjustment and current adjustment. Specially remind all fans to pay attention to the safety detection and detection, and then check and confirm that the power is on again. I am also trying to make progress together with everyone.

First go to the physical picture
Insert picture description hereInsert picture description here
Insert picture description here
schematic diagram
Insert picture description here
C language reference source code

#include “reg52.h”

sbit lamp_pwm = P0 ^ 0; // SCR bit
sbit key0 = P3 ^ 4; // Decrease brightness key bit
sbit key1 = P3 ^ 5; // Increase brightness key bit

unsigned int inc;

void INT0s () interrupt 0 using 0 // INT0 external interrupt, zero crossing detection trigger
{
TR0 = 0;
if (! key0) // decrease brightness
{
inc + = 50;
if (inc> = 8000) inc = 8000;
}
if (! key1) // Increase brightness
{
inc- = 50;
if (inc <= 800) inc = 800;
}
TH0 = (65536-inc) / 256;
TL0 = (65536-inc)% 256;
TR0 = 1;
}

void timer1 () interrupt 1 using 0 // triac trigger interrupt
{
unsigned char i;
lamp_pwm = 0; // lamp on
for (i = 0; i <2; i ++); // delay 2us
lamp_pwm = 1; / / Light off
)

/ STC for continuous power download
** / sfr ISP_DOWNS = 0xe7; // ISP soft reset address
sbit ISP_SW = P3 ^ 0; // Serial data reception
void DebugDownISP () // soft reset
{

Due to space limitations, only part of the code can be written, if you need the complete code, please download it yourself

Finally, if you have any comments or suggestions, you are welcome to leave a message to me, let us learn together and progress together.
If you need the complete code or design file, please leave a message or private message me below.

Thank you!

Published 97 original articles · 200 praises · 80,000+ views

Guess you like

Origin blog.csdn.net/weixin_44212493/article/details/104335184