Electronics Lab Philippines

Refrigerator Power-ON Delay; PIC timer

Offline akosiikem

  • ******
  • 462
  • 6
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #20 on: November 30, 2013, 10:26:15 PM »
kaya ba na thru firmware na rin yung zero crossing at triac triggerig para mawala na rin yung opto???
"Take chances! Make mistakes!"
             - Mrs. Frizzle(Magic School Bus)

Offline Super zHero

  • *****
  • 5838
  • 310
  • Simple problem- ...simple solution.
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #21 on: November 30, 2013, 11:07:32 PM »
To do the zero crossing trigger, you need to sample the AC waveform.  So the answer is no, at least not with this particular micro.  Pero can be done with other PICs that have the ADCs and comparators.

Offline motion55

  • *****
  • 3171
  • 520
  • Gender: Male
  • Been at this longer than you've been alive.
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #22 on: December 01, 2013, 08:25:47 AM »
Here is a link to a light dimmer application of the PIC12C508. The PIC12C508 is an older device compared to the PIC10F202. They are almost the same except the PIC12C508 has a few more I/O pins.

http://ww1.microchip.com/downloads/en/AppNotes/40171a.pdf

If you check the schematic, I/O pin count is not an issue. This should also work on the PIC10F202. On the schematic, the PIC12C508 has a pin assigned for zero cross detection. The program can easily be modified from light dimming to ON/OFF on zero cross.



"Set your mind free!"

Offline Super zHero

  • *****
  • 5838
  • 310
  • Simple problem- ...simple solution.
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #23 on: December 01, 2013, 10:02:44 AM »
Ah yes, thanks,,,,, I'd seen this App Note way back when, late '90s when it first came out.  I was getting started in learning PICs.  In fact I still have a stick of 12C509As in my drawer (I just checked).

If I remember correctly, Microchip has several Apps on these chips for Mechatronics projects.  Mabilis na nawala sa isip mga ito when the Flash programmables came into market.

I still have a few unused 12C672 with the UV erase window  8)

Offline marcelino

  • *****
  • 6597
  • 312
  • ...keep moving forward! - Robinson's
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #24 on: December 01, 2013, 10:57:54 AM »
Here is a link to a light dimmer application of the PIC12C508. The PIC12C508 is an older device compared to the PIC10F202. They are almost the same except the PIC12C508 has a few more I/O pins.

http://ww1.microchip.com/downloads/en/AppNotes/40171a.pdf

If you check the schematic, I/O pin count is not an issue. This should also work on the PIC10F202. On the schematic, the PIC12C508 has a pin assigned for zero cross detection. The program can easily be modified from light dimming to ON/OFF on zero cross.

Thank you sir for sharing. ganun lang po pala kasimple ang pagdetect ng zero crossing using mcu? in terms of hardware, a resistor (20Mohms) to limit the current. sa code naman, detect lang ng HI or LOW.

Tama po ba ang ang pagkakaintindi ko?
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Offline akosiikem

  • ******
  • 462
  • 6
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #25 on: December 01, 2013, 01:34:28 PM »
So hindi na pala kaylangan na may ADC yung PIC para sa zero crossing
Eto pa po isang nakita ko para sa electric stove naman

http://ww1.microchip.com/downloads/en/appnotes/00958a.pdf

 ;)
"Take chances! Make mistakes!"
             - Mrs. Frizzle(Magic School Bus)

Offline Super zHero

  • *****
  • 5838
  • 310
  • Simple problem- ...simple solution.
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #26 on: December 01, 2013, 02:10:28 PM »
Better na hindi na kailangan ADC, kailangan lang nung comparator.

Offline Ikasamoko

  • *****
  • 6436
  • 492
  • Gender: Male
  • ..sexually deficit..
    • My "BLAG!"
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #27 on: December 01, 2013, 06:26:30 PM »
Ayos! buti at may F508 pa ako dito....:D

Offline Super zHero

  • *****
  • 5838
  • 310
  • Simple problem- ...simple solution.
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #28 on: December 03, 2013, 09:26:15 AM »
I will be trying a PIC12F629, also an 8-pin IC but with comparator, to see if I can incorporate a zero crossing detector.  Wala kasi akong PIC10F204 pero marami akong 12F629.

Offline marcelino

  • *****
  • 6597
  • 312
  • ...keep moving forward! - Robinson's
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #29 on: December 03, 2013, 10:39:43 AM »
Sir, I think dun sa post ni sir motion55 about light dimmer, parang di naman gumagamit ng comparator module. basic I/O detection lang.

eto po yung part ng code kung saan dinidetect lang naman ang pagiging LOW ng AC line.
 
Code: [Select]
if(LineInput == 0) //Check for AC line already low
{
   Maxdim += 5; //If so, increment Maxdim
   while(LineInput == 0); // and re-sync with line
   while(LineInput == 1)
   CLRWDT;
}
else
{
   while(LineInput==1) //Wait for zero crossing
   CLRWDT;
   Maxdim = PercentOn - TMR0 + 2; //Compensate full dim value for line
                // frequency vs osc. speed
}

Although, kung gagamit ng comparator, parang mas magiging madali para sa processor.
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Offline Super zHero

  • *****
  • 5838
  • 310
  • Simple problem- ...simple solution.
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #30 on: December 03, 2013, 05:53:28 PM »
Let's study it further..... I'm now experimenting with 629's comparator, something I haven't used in the PIC itself, before.

Offline rage3657

  • ******
  • 361
  • 23
  • Gender: Male
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #31 on: December 03, 2013, 06:43:17 PM »
may chance ba mag short ang resistor in normal use? if thats the case luto ang mcu.. mas safe siguro to use two in series.. mag short ang isa may isa pa.
bong

Offline akosiikem

  • ******
  • 462
  • 6
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #32 on: December 03, 2013, 07:51:05 PM »
I will be trying a PIC12F629, also an 8-pin IC but with comparator, to see if I can incorporate a zero crossing detector.  Wala kasi akong PIC10F204 pero marami akong 12F629.

Nice abangan ko to..
"Take chances! Make mistakes!"
             - Mrs. Frizzle(Magic School Bus)

Offline akosiikem

  • ******
  • 462
  • 6
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #33 on: December 03, 2013, 07:54:14 PM »
Thank you sir for sharing. ganun lang po pala kasimple ang pagdetect ng zero crossing using mcu? in terms of hardware, a resistor (20Mohms) to limit the current. sa code naman, detect lang ng HI or LOW.

Tama po ba ang ang pagkakaintindi ko?


Yun nga din pagkaintindi ko. Parang sensing lang ng On/Off.
"Take chances! Make mistakes!"
             - Mrs. Frizzle(Magic School Bus)

Offline akosiikem

  • ******
  • 462
  • 6
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #34 on: December 03, 2013, 07:55:59 PM »
may chance ba mag short ang resistor in normal use? if thats the case luto ang mcu.. mas safe siguro to use two in series.. mag short ang isa may isa pa.

Tingin ko hindi. Common mode of failure kasi ng resistor is open.
"Take chances! Make mistakes!"
             - Mrs. Frizzle(Magic School Bus)

Offline Super zHero

  • *****
  • 5838
  • 310
  • Simple problem- ...simple solution.
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #35 on: December 03, 2013, 08:16:23 PM »
Tingin ko hindi. Common mode of failure kasi ng resistor is open.

Parang filament ng incandescent bulb, when it burns out, it opens.

Offline Super zHero

  • *****
  • 5838
  • 310
  • Simple problem- ...simple solution.
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #36 on: December 06, 2013, 10:55:03 AM »
I was reading up on some of the App Notes on Triac trigggering.  Tho now I see that it can be done with this simple PIC chip without the use of a comparator or ADC, and in a very simple way, there is a gamble on false triggering due to AC and switching noises.  It is all dependent on the design.

PIC's AN958a  (Low-Cost Electric Range Control Using a Triac) showed that they put in quite some good filtering for their transformerless resistive PS.  I'm not sure if that method is better than a transformered simple PS for simplicity and cost.  For cost consideration since I'm not doing this for mass production, I think I will go with a USB wall charger that can be purchased for only P50.  With that I can have an isolated 5V regulated supply that will give me nearly an Amp.

Offline Super zHero

  • *****
  • 5838
  • 310
  • Simple problem- ...simple solution.
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #37 on: December 29, 2013, 08:55:31 PM »
Design Note:
To ensure fast reset time or when the power line is quickly cycling On & Off, the power supply bulk filter cap should not be too large so it discharges the V+ line going to the IC fairly quickly also.

Since this is an MCU the chip resets as soon as the Vcc drops.

Offline >>>^żżż^<<<

  • *****
  • 13845
  • 706
  • żżż
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #38 on: December 29, 2013, 09:19:55 PM »
Kaya dun din sa gawa kung analog. Trade din ang filtering ng ecap dahil kapag mataas ang filter niya baka abutin ng pagdating uli ng power sa quick on-off scenario. Na may enough pang charge sa kanya na hindi bibitaw sa current state yung circuit. Kay ccap gamit ko minsan.
http://www.elab.ph/index.php?topic=52236.0 TF?
http://www.elab.ph/index.php?topic=41860 ? ? ? DIY traffo Test Build Uli
http://www.elab.ph/index.php?topic=33717  I2c / spi programmer
http://www.elab.ph/index.php?topic=37150.0 Lcr esr makikigulo rin ba kayo ??? Test Build
http://www.elab.ph/index.php?topic=29963.0 Esr collection na malamig
http://www.elab.ph/index.php?topic=25854.0 Basic C++ Programming Tutorials by Prof Asimo
We only live once,treasure those we love, make friends not enemies and keep our family closer. And we will be at peace.
FISH

Offline Super zHero

  • *****
  • 5838
  • 310
  • Simple problem- ...simple solution.
Re: Refrigerator Power-ON Delay; PIC timer
« Reply #39 on: December 29, 2013, 09:29:44 PM »
Few milliAmps naman kailangan ng PIC including LED drive.  Kung relay gagamitin instead of Triac, konti pang mA ang dagdag.