ÕÒ»ØÃÜÂë
 Á¢¼´×¢²á

QQ怬

Ö»ÐèÒ»²½£¬¿ìËÙ¿ªÊ¼

ËÑË÷
²é¿´: 2601|»Ø¸´: 10
´òÓ¡ ÉÏÒ»Ö÷Ìâ ÏÂÒ»Ö÷Ìâ
ÊÕÆð×ó²à

arduino+moc33021+bta16ΪʲôɶֻÓа벨¿ØÖÆ£¬Çó´óÀнâÒÉ

[¸´ÖÆÁ´½Ó]
void up()
{
  digitalWrite(12, HIGH);
  delayMicroseconds(5000);
  digitalWrite(12, LOW);
  delayMicroseconds(1000);
  digitalWrite(12, HIGH);
}

void setup() {
  pinMode(2, INPUT);
  pinMode(12, OUTPUT);
  // put your setup code here, to run once:
  attachInterrupt(0, up, RISING);
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(100);
}

Õâ¸öÊÇarduino´úÂ룬¼ì²âµ½¹ýÁãºóÑÓʱ5ms¿ØÖÆmoc3021¿ªÍ¨¡£

²»ÖªµÀΪʲôֻÓÐÔÚ220vµÄ¸º°ë²¨ÄÜ¿ªÍ¨¿É¿Ø¹è£¬ÕýµÄ°ë²¨Ò»µã·´Ó¦¶¼Ã»ÓУ¬¿É¿Ø¹è´¥·¢µç·ÊDzο¼µÄmoc3021ÊÖ²áÍÆ¼öµç·£¬ÊDz»ÊÇproteus·ÂÕæÔª¼þÓÐÎÊÌ⣿moc3021£¿bta16-600bw£¿


51hei½ØÍ¼20191101174505.jpg (204.17 KB, ÏÂÔØ´ÎÊý: 66)

51hei½ØÍ¼20191101174505.jpg

51hei½ØÍ¼20191101174746.jpg (66.37 KB, ÏÂÔØ´ÎÊý: 61)

51hei½ØÍ¼20191101174746.jpg

Arduino 328.rar

92.11 KB, ÏÂÔØ´ÎÊý: 12

proteusÏîÄ¿Îļþ

·ÖÏíµ½:  QQºÃÓѺÍȺQQºÃÓѺÍȺ QQ¿Õ¼äQQ¿Õ¼ä ÌÚѶ΢²©ÌÚѶ΢²© ÌÚѶÅóÓÑÌÚѶÅóÓÑ
ÊÕ²ØÊÕ²Ø ·ÖÏíÌÔÌû ¶¥¶¥ ²È²È
»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

ɳ·¢
ID:633947 ·¢±íÓÚ 2019-11-4 09:37 | Ö»¿´¸Ã×÷Õß
ûÓÐÈËÂð£¿
»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

°åµÊ
ID:342822 ·¢±íÓÚ 2019-11-4 10:31 | Ö»¿´¸Ã×÷Õß

ÕâÊÇProteus 8 ÖеÄÀý³Ì¿´Ò»¿´°É
/* Main.ino file generated by New Project wizard
*
* Created:   mer ago 22 2018
* Processor: Arduino Uno
* Compiler:  Arduino AVR
*/

int AC_LOAD = 3;    // Output to Opto Triac pin
int dimming = 128;  // Dimming level (0-128)  0 = ON, 128 = OFF

void setup()
{
  pinMode(AC_LOAD, OUTPUT);// Set AC Load pin as output
  attachInterrupt(0, zero_crosss_int, RISING);  // Choose the zero cross interrupt # from the table above
}

//the interrupt function must take no parameters and return nothing
void zero_crosss_int()  //function to be fired at the zero crossing to dim the light
{
  // Firing angle calculation : 1 full 50Hz wave =1/50=20ms
  // Every zerocrossing thus: (50Hz)-> 10ms (1/2 Cycle)
  // For 60Hz => 8.33ms (10.000/120)
  // 10ms=10000us
  // (10000us - 10us) / 128 = 75 (Approx) For 60Hz =>65

  int dimtime = (75*dimming);    // For 60Hz =>65   
  delayMicroseconds(dimtime);    // Wait till firing the TRIAC
  digitalWrite(AC_LOAD, HIGH);   // Fire the TRIAC
  delayMicroseconds(10);         // triac On propogation delay (for 60Hz use 8.33)
  digitalWrite(AC_LOAD, LOW);    // No longer trigger the TRIAC (the next zero crossing will swith it off) TRIAC
}

void loop()  {
  for (int i=5; i <= 128; i++){
    dimming=i;
    delay(10);
   }
}
»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

µØ°å
ID:342822 ·¢±íÓÚ 2019-11-4 10:51 | Ö»¿´¸Ã×÷Õß
¼ì²âµ½¹ýÁãºóÑÓʱ5ms¿ØÖÆmoc3021¿ªÍ¨£¿£¿£¿£¿
ÓÃ10msÊÔÒ»ÊÔ~~
»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

5#
ID:633947 ·¢±íÓÚ 2019-11-4 14:33 | Ö»¿´¸Ã×÷Õß
taotie ·¢±íÓÚ 2019-11-4 10:31
ÕâÊÇProteus 8 ÖеÄÀý³Ì¿´Ò»¿´°É
/* Main.ino file generated by New Project wizard
*

Õâ¸öÀý×ÓÃû³Æ½Ðʲô£¬ÎÒÏë¿´¿´ÍêÕûÏîÄ¿
»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

6#
ID:633947 ·¢±íÓÚ 2019-11-4 14:44 | Ö»¿´¸Ã×÷Õß
¿ÉÒÔ¿´µ½µ¥Æ¬»ú´¥·¢ÐźÅÓ¦¸ÃÊÇûÎÊÌâµÄ£¬µ«ÊÇÖ»Óиº°ë²¨¿É¿Ø¹è¿ªÍ¨ÁË

51hei½ØÍ¼20191104095454.jpg (67.34 KB, ÏÂÔØ´ÎÊý: 68)

51hei½ØÍ¼20191104095454.jpg
»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

7#
ID:342822 ·¢±íÓÚ 2019-11-4 16:24 | Ö»¿´¸Ã×÷Õß
jzli2019 ·¢±íÓÚ 2019-11-4 14:33
Õâ¸öÀý×ÓÃû³Æ½Ðʲô£¬ÎÒÏë¿´¿´ÍêÕûÏîÄ¿

Arduino Dimming 230V AC
»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

8#
ID:342822 ·¢±íÓÚ 2019-11-4 17:12 | Ö»¿´¸Ã×÷Õß
°´ÄãµÄ³ÌÐò·ÂÕæÃ»µÃÎÊÌâ¡£¡£


»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

9#
ID:633947 ·¢±íÓÚ 2019-11-4 18:02 | Ö»¿´¸Ã×÷Õß
taotie ·¢±íÓÚ 2019-11-4 17:12
°´ÄãµÄ³ÌÐò·ÂÕæÃ»µÃÎÊÌâ¡£¡£

´óÀУ¬ÎÒ°Ñproteus8.7Ð¶ÔØÁËÖØÐÂ×°ÁËproteus8.9£¬ÏÖÔÚÄ£ÄâҲûÎÊÌâÁË¡£¡£¡£ºÜĪÃûÆäÃî°¡
»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

10#
ID:633947 ·¢±íÓÚ 2019-11-4 18:03 | Ö»¿´¸Ã×÷Õß
taotie ·¢±íÓÚ 2019-11-4 17:12
°´ÄãµÄ³ÌÐò·ÂÕæÃ»µÃÎÊÌâ¡£¡£

ÄãÓõÄÊÇÄĸö°æ±¾£¬ÎҸоõ¾ÍÊǰ汾²»¶Ôµ¼Öµġ£¡£¡£
»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

11#
ID:342822 ·¢±íÓÚ 2019-11-5 13:01 | Ö»¿´¸Ã×÷Õß
jzli2019 ·¢±íÓÚ 2019-11-4 18:03
ÄãÓõÄÊÇÄĸö°æ±¾£¬ÎҸоõ¾ÍÊǰ汾²»¶Ôµ¼Öµġ£¡£¡£

ºÇºÇ8.8
»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

ÄúÐèÒªµÇ¼ºó²Å¿ÉÒÔ»ØÌû µÇ¼ | Á¢¼´×¢²á

±¾°æ»ý·Ö¹æÔò

ÊÖ»ú°æ|СºÚÎÝ|51ºÚµç×ÓÂÛ̳ |51ºÚµç×ÓÂÛ̳6Ⱥ QQ ¹ÜÀíÔ±QQ:125739409;¼¼Êõ½»Á÷QQȺ281945664

Powered by µ¥Æ¬»ú½Ì³ÌÍø

¿ìËٻظ´ ·µ»Ø¶¥²¿ ·µ»ØÁбí