AVR Zero Cross Detection and AC dimmer

Go To Last Post
60 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

HI all
Hi all,
I am working on AC dimmer circuit , for that i have have interfaced the Zero Cross Detection circuit with ATmega16 INT0 pin. INT0 is configured as a rising edge. here i am attaching image which shows the working of Zero cross detection is good. but when i interface its output with ATmega INT0 pin, the Zero Cross Pulsed gets down and nothing happen on INT0 pin. i have tested INT0 code separately which also working as expected. I am not getting where i am doing anything wrong? please somebody help me who has worked with such project ever before
Here is a code snip which gives INT0 routine and Int0 Configuration as rising edge.

/*
 *  Written in AVR Studio 5 / AVR Studio 6
 *  Compiler: AVR GNU C Compiler (GCC)
 *
 *  Author: AVR Tutorials
 *  Website: www.AVR-Tutorials.com
*/
 
#include 
#include 
 
#define F_CPU 16000000UL
#include 
 
#define DataPort	PORTC	// Using PortC as our Dataport
#define DataDDR		DDRC

//Interrupt Service Routine for INT0
ISR(INT0_vect)
{
	unsigned char i, temp;
	cli();
	//_delay_ms(500); // Software debouncing control
 
	//temp = DataPort;	// Save current value on DataPort
 
	/* This for loop blink LEDs on Dataport 5 times*/
	DataPort = 0x00;
	for(i = 0; i<100; i++)
	{
		
		_delay_us(200);	// Wait 5 seconds
	
		//_delay_us(200);	// Wait 5 seconds
	}
 	DataPort = 0xFF;
	//DataPort = temp;	//Restore old value to DataPort	
	sei();
}	
 
int main(void)
{
	DDRD = 1<<PD2;		// Set PD2 as input (Using for interupt INT0)
	PORTD = 1<<PD2;		// Enable PD2 pull-up resistor
 
	DataDDR = 0xFF;		// Configure Dataport as output
	DataPort = 0xFF;	// Initialise Dataport to 1
	
	GICR = 1<<INT0;					// Enable INT0
	MCUCR = 1<<ISC01 | 1<<ISC00;	// Trigger INT0 on rising edge
 
	sei();				//Enable Global Interrupt 
    while(1)
    {
	/*	if(DataPort >= 0x80)
			DataPort = 1;
		else
			DataPort = DataPort << 1;	// Shift to the left
 
		_delay_ms(500);	// Wait 5 seconds */
		if(!(PIN_1 & (1<<SW_1))) //If switch is pressed
		{
			toggle(LED_PORT,LED_1);
			_delay_ms(1000);
		}
		else if(!(PIN_1 & (1<<SW_2))) //If switch is pressed
		{
		toggle(LED_PORT,LED_2);
		_delay_ms(1000);
		}
    }
}

When i use this Zero Cross Detection pulses as a normal switch its working good, but when i use it with INT0 pin the pulse get destroyed and nothing happens as attached images
http://obrazki.elektroda.pl/1675199400_1404870504.jpg
http://obrazki.elektroda.pl/8512216500_1404870506.jpg
http://obrazki.elektroda.pl/5135125800_1404870507.jpg

This topic has a solution.

Taher Kawantwala

Last Edited: Sun. Oct 8, 2017 - 06:55 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
DDRD = 1<<PD2;      // Set PD2 as input (Using for interupt INT0) 

Writing a 1 to the DDR sets the port pin to an output!

INT0 must be an input in order to work the way you want it too.

jc

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jccordill wrote:

DDRD = 1<<PD2;      // Set PD2 as input (Using for interupt INT0) 

Writing a 1 to the DDR sets the port pin to an output!

INT0 must be an input in order to work the way you want it too.

jc


the same thing i have applied and in simuation it is working as of now. i will check it on real hardware and then get back to you. Thanks a lot for your reply. :)

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone. As i have developed the Zero cross detector as per above schematic but cant get successful Waves on CRO. Please can anyone tell me is this circuit has any problem which make it not to run in real time?

Attachment(s): 

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Any small Help is Highly appreciable.

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm not sure what your asking, why the scope does not match the sim or why your code does not "run in real time". If the later, it is poor practice to use functions with in a ISR, and one (i would think) would never use a delay function, you want your ISR to run as fast as possible, test a sensor, set a flag and exit. then in main, test if flag is set and reset it, then call function to service sensor, etc...
Also on an AVR, to test a port bit, you need to look at the PIN register not the PORT register.
As for the scope pic, I have no idea where your probing, what are the settings, voltage, time scale, etc...
JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You CANNOT put a zero-based AC signal into a port pin, no matter how it is configured and have a chip this will survive for any time. That is because the pin voltage is limited to the range of -0.5 to (Vcc+0.5); see "Absolute Maximum Ratings" at the start of "Electrical Characteristics".

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also are you seriously using a NPN transistor to control AC circuitry? Post your actual and readable schematic.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

here is a schematic attached which i am using for Zero Cross Detection. And i have used this links as reference.http://avrprojects.info/avr-projects/digital-dimmer-using-atmega8/
http://www.pcbheaven.com/circuitpages/PIC_DCV_Controlled_AC_Dimmer/
http://www.instructables.com/id/AC-Lamp-Dimmer-Using-TRIAC-and-PIC16F877A/
Please explain me why you are surprised with NPN transistors used here?

Attachment(s): 

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
You CANNOT put a zero-based AC signal into a port pin, no matter how it is configured and have a chip this will survive for any time. That is because the pin voltage is limited to the range of -0.5 to (Vcc+0.5); see "Absolute Maximum Ratings" at the start of "Electrical Characteristics".

Jim


Application Note AVR 182 (Zero Cross Detector):
http://www.atmel.com/images/doc2...

Depending on the application, I would NOT suggest to use the described way to detect zero cossing for safety reasons. At least the 1MOhm resistors should be split in a series (e.g. 4x 250kOhm).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The zero cross circuitry is more complex than what it needs to be. The opto coupler is a total waste of time in this circuit. As jcordill said, you havent told us much about your test setup. Is your scope measuring the mains output? If so, you need a load on the output. Triacs have significant leakage so put a 40W incandescent light bulb as a load. Note: playing around with mains voltages can kill you and cause things to blow up in your face. Wear safety glasses at a minimum.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Regarding the Power_SupplyZerocrossDetector.pdf:

For me, the optocoupler OK1 (4N25) makes only little sense. There is already a transformer, which isolates the grid side from the low voltage side. Three transistors should be enough to generate from 12V RMS, 50Hz a TTL pulse signal.

edit:
@Kartman: you have been faster with your comment regarding the optocoupler...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Please Let me know how much we can trust on simulation? IS there any Problem with My Zero Cross Detector Circuit then please explain me clearly.

Quote:
You CANNOT put a zero-based AC signal into a port pin, no matter how it is configured and have a chip this will survive for any time. That is because the pin voltage is limited to the range of -0.5 to (Vcc+0.5); see "Absolute Maximum Ratings" at the start of "Electrical Characteristics".

I am not giving the Zero cross signal directly to Controller. I have used isolator for that. which give pulse when zero crossing detected.
in my test setup i have measured the signal before Opto-coupler.

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But your isolator doesn't isolate! Nevertheless, if we assume your zero cross detector works, what is the problem you are having? All we see is a picture on the oscilloscope but we don't know what you are showing us.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sir. I have checked this Zero Cross Circuite in Oscilloscope but as i have uploaded the image earlier, i am not getting the Zero Crossing pulses as expected. so thats why i want to know what can be the problem?

Quote:
But your isolator doesn't isolate!

what do you want to say regarding isolator?
The zero cross circuit ref. is http://pcbheaven.com/scripts/imagepresent.php?filename=%2Fcircuitpages%2Fimages%2Fvoltagecontrolledacdimmer_1262362194.png

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But your circuit is rather different! The original circuit makes sense - yours doesn't.

I can only guess you don't have the oscilloscope ground connected to your circuit.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

how my circuit is not making sense? please explain sir.

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are probably using more parts than are necessary to perform a specific function. The circuit is too complex. If you want to build a lot of such devices, you want to save money. Less parts are also preferable to reduce the failure probability.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The original circuit has three parts - the zero crossing detector, the delay generator (555 ic) and the opto drive for the triac.

You want to substitute the 555 ic with the AVR. Thus the opto is not part of the zero cross circuit.

You still haven't told us how you've hooked up your oscilloscope. You seem to latch onto our other comments. Show us a picture so we can try to understand.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Use only the red marked part for zero detection.
Show what you see with a scope on Q1 collector.
(In real, not in a simulator)

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

why not to use opto coupler?

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It seems we're going around in circles. You're having problems and your circuit was wrong. What you have said/shown us is confusing - so we can't make sense of the problem you are having. Ask your question again and tell us clearly what the problem is and how your measure it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
why not to use opto coupler?
A better question is why to use it. You have told us no reason for this. You need not isolate the circuit. 12 V from the transformer is not danger.

There where even a single resistor would work, you use 3 transistors and an opto coupler.
And finally it does not work, as you say.
It was told here more times that your circuit is overcomplicated.

Do you really not understand why to simplify the thing?
If you need an amplifier with gain 32, will you use a transistor with gain 32 or five transistors with gain 2?
I suspect you prefer the latter.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks you very much first of all. Actually my zero cross detection circuit is not working as per the oscilloscope signals. So i want to know what can be the problem.

Quote:
Do you really not understand why to simplify the thing?
If you need an amplifier with gain 32, will you use a transistor with gain 32 or five transistors with gain 2?
I suspect you prefer the latter.

you mean i should not use three transistors in my circuit?
If my circuit is overcomplicated then i request you to make me understand how can i simplify it?

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Thanks you very much first of all. Actually my zero cross detection circuit is not working as per the oscilloscope signals. So i want to know what can be the problem.

I've already suggested i don't think your scope probe gnd is connected. Since you haven't told us otherwise, we can only guess.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK. I will use as you have suggested and get back here with results.

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Quote:
Thanks you very much first of all. Actually my zero cross detection circuit is not working as per the oscilloscope signals. So i want to know what can be the problem.

I've already suggested i don't think your scope probe gnd is connected. Since you haven't told us otherwise, we can only guess.


finally done with the zero crossing.
Now i want a guidance for controlling triac using AVR. Thanks a Lot for you help guys.

Attachment(s): 

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Related to the link above:
The MOC3041 has a built-in zero-cross detector.
You may want to use a MOC3020 or a similar part without this, since you have already a zero-crossing signal.
If you do not want to control the power with phase cutting (on, off only), then you are right with the MOC3041 and no discrete phase signal.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In a perfect world all you need is a resistor and transistor. The reality is there are sources of noise and transients, thus you need some filtering. The downside is filtering gives you phase shifts that need to be compensated for. I'd suggest getting the dimmer working first then add some filtering to the ZX detector.

Remember - when working with mains it's freaking dangerous. Make sure you have an earth leakage circuit breaker on your power source and proper fusing. Be very careful when using the oscilloscope to probe the mains circuits. Its very easy to damage your scope and/or probes if you slip or do something silly. How do I know????

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

HI everyone. Thanks for the guidance Kartman, skotti and bloody-orc.
I am giving this Zero crossing pulse to AVR controller On INT0 interrupt pin.I am generating a pulse when zero crossing occurs. but in my case i am not getting any output from the pin when zero crossing occur. here is a code which i am using for generating plse.

/*
 * ATmega8_intrpt.c
 *
 * Created: 15-08-2014 AM 09:39:07
 *  Author: TAHER
 */ 
#include 
#include 

#define F_CPU 1000000UL
#include 

#define DataPort	PORTC	// Using PortC as our Dataport
#define DataDDR		DDRC
uint8_t ZC=0;
//Interrupt Service Routine for INT0
ISR(INT0_vect)
{
	ZC=1;
}

int main(void)
{
	DDRD = 1<<PD2;		// Set PD2 as input (Using for interupt INT0)
	PORTD = 1<<PD2;		// Enable PD2 pull-up resistor
	
	DataDDR = 0xFF;		// Configure Dataport as output
	DataPort = 0x01;	// Initialise Dataport to 1
	
	GICR = 1<<INT0;					// Enable INT0
	MCUCR = 1<<ISC01 | 1<<ISC00;	// Trigger INT0 on rising edge
	
	sei();				//Enable Global Interrupt
	
	while(1)
	{
		if(ZC)
		{
			DataPort=0x00;
			_delay_ms(8);
			DataPort=0xFF;
			ZC=0;			
		}
	}
}

I have tried this code with Connecting the 10K pull-up to INT0 pin and also without Pull-up.
then i have commented the line

PORTD = 1<<PD2;		// Enable PD2 pull-up resistor

and also check with INT0 pulled up and without pulled up. in all cases I am getting NO outpu from the PORTC pin.
please provide me the way to get out of it.
your help and guidance is truly appreciable.

Attachment(s): 

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are setting PD2 as an output!

Read the tutorial on bit twiddling to understand why - in short you are putting a 1 bit in DDRD for PD2 which sets it as an output. The default is input so you really don't need to touch DDRD

ZC needs to be declared volatile

You have at least two defects that stop it working. Even if you fix one defect it would still not work. In future, only try to debug one problem at a time. Trying to debug two or more problems at a time will frustrate you and waste a lot of time. Also, get used to usung a simulator - this will help identify where the problems are.

Last Edited: Fri. Aug 15, 2014 - 08:18 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Guys i have written a test code which will generate a 250uS pulses whenever Zero-Crossing interrupt pulse arrive at ATmega8 Interrupt PIN INT0. Here is my sample code:

int main(void)
{
	DDRD = 1<<PD2;		// Set PD2 as input (Using for interupt INT0)
	PORTD = 1<<PD2;		// Enable PD2 pull-up resistor
 
	DataDDR = 0xFF;		// Configure Dataport as output
	DataPort = 0x00;	// Initialise Dataport to 1
 
	GICR = 1<<INT0;					// Enable INT0
	MCUCR = 1<<ISC01 | 1<<ISC00;	// Trigger INT0 on rising edge
 
	sei();				//Enable Global Interrupt
 
    while(1)
    {

    }
}

here is the ISR routine:

ISR(INT0_vect)
{
		DataPort = 0xFF;
		_delay_us(250);	// Wait 5 seconds
		DataPort = 0x00;
}

Let me know am I on the right track or not?

Attachment(s): 

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What is channel 1 showing us?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ch-1 is AC signal? i dont know why i am getting just a half cycle. ch-2 is the output of the AVR ATmega8 controller at PORTC when Interrupt occur on TNT0 pin

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ch-1 is ac signal - from where? I think we need to see your schematic and what you're measuring to make any sense. For all we know, the ac signal could be from your fingertip!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Ch-1 is ac signal - from where? I think we need to see your schematic and what you're measuring to make any sense. For all we know, the ac signal could be from your fingertip!

Please have a look at beloved attached image. here i have showed where i am measuring which signals.

Attachment(s): 

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also i would like to know how can i measure the triac firing and AC signal using oscilloscope.I have 25Mhz 500 MS/s Digital storage Oscilloscope.Please also suggest me the schematic circuit to connect triac with micro controller output.

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Code:

ISR(INT0_vect)
{
      DataPort = 0xFF;
      _delay_us(250);   // Wait 5 seconds
      DataPort = 0x00;
}


The comment does not match the command!
However, I would strongly avoid any delay function in an interrupt service routine. Use the interrupt of the zero crossing to synchronise an additional timer interrupt to the grid.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are plenty of examples of dimmer circuits on the internet. Google 'avr dimmer'

As for connecting oscilloscope to mains - check the specs of your probe and oscilloscope. Mine is rated to 500V. Use 10:1 probe.

Your wiring of low voltage circuits is suspect, so wiring of a mains circuit must be a whole lot better otherwise you burn your house down or electrocute yourself. Choose the wire size to suit the fuse.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Everyone here.
I have tested my code with the triac circuit for 12V 50Hz input. i have connected 100E 1W resistor as a LOAD. Here i have attached the schematic.Here is the code which is used to Fire the TRIAC.


/*
 *  Written in AVR Studio 5 / AVR Studio 6
 *  Compiler: AVR GNU C Compiler (GCC)
 *
 *  Author: AVR Tutorials
 *  Website: www.AVR-Tutorials.com
*/
#ifndef F_CPU
#define F_CPU 1000000UL
#endif
#include 
#include 
#include 
 
#define DataPort	PORTC	// Using PortC as our Dataport
#define DataDDR		DDRC
#define SW_PORT		PORTD
#define PIN		PIND
#define SW_DDR		DDRD
#define UP			PD0
#define DOWN		PD1
#define LED_PORT	PORTB
#define LED_DDR		DDRB
#define LED_1		PB0
#define LED_2		PB1

#define toggle(var, mask) 	((var) ^= (uint8_t)(1<< mask))	// MACRO: toggle register bit

uint8_t SPEED=0;
//Interrupt Service Routine for INT0
ISR(INT0_vect)
{
 for(uint8_t i=0;i

below are attached images which shows the output wave form when we fire triac. i have used switch to change firing angle. sw1 will give 4ms delay after ZC to fire TRIAC. SW2 will give 8ms delay after ZC to fire triac.
I am getting the different kind of signal. please guide me where i am going wrong. if possible rectify my mistakes and show me the way to interface triac to check its functionality.
Your every comments are appreciable here.

Attachment(s): 

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You do realise the 100 ohm resistor presents a 2.4W load? Thus I would expect the resistor to get extremely hot.
Your layout does not look very safe. Keep the low voltage away from the high voltage. Your mains wires are fairly thin - how are they fused?

Stop and think before you kill yourself.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

As for connecting oscilloscope to mains - check the specs of your probe and oscilloscope. Mine is rated to 500V. Use 10:1 probe.

You have to be very careful when connecting a scope to the mains, some scopes are designed for the job but the vast majority are not meant to be connected to the mains even if the voltage rating of the input has you believe it is

Its very dangerous indeed

Its to do with the scope ground clip being referenced to earth, when you ground the clip and apply a voltage to the scope tip then you basically short circuit voltage to earth and this will trip an RCD every day of the week, in the UK RCD's are very common and some cowboys have been known to unearth a scope to stop it tripping!!!!!!!! if you don't have an RCD then bad things can happen, its very very dangerous

To do work on mains then you need a proper set of differential probes which are very expensive, perhaps as expensive as a cheap scope but it is the tool for the job

A 1:1 isolation transformer is also an essential piece of equipment to supply the bench some people think that this is the only thing they need to use a scope on the mains but its not, a proper set of differential probes is the tool for the job an isolation transformer is to protect the engineer

Reading the OP and his further questions then I can only recommend he doesn't think about measuring the mains, reduce the vltages to safe levels there are ways to learn/develop without touching mains voltages

Don't do it!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

how should i use the triac circuit for 100W bulb? please give me the safe way to test it.

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Get a lower voltage bulb and use a lower voltage

If you really want to work with mains then you can't use a veroboard for a start, Veroboard is not good for mains so straight away you need to build a PCB

Then get an isolation transformer, then get some differential probes

After all of that you need to be competent and thats the most important part, I worked on mains for about ten years, putting mains into an enclosed space and then going in probing it can be dangerous you need to have your wits about you and you need to have a good knowledge of electrical safety

I see absolutely no benefit for you to work on the mains, there is nothing that you can't do on lower voltage

But I see a lot of downsides to you working on mains, there is a real danger you will hurt yourself, please don't do it it would be stupid of you I cant say that enough

I build mains powered inverters and even with all the equipment I have I always avoid mains work as much as possible its just better to avoid it and it usually can be avoided

maybe not what you wanted to hear but

Don't do it, don't do it and definitely don't do it!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Noob - the ground clip is already earthed, so I'm not sure of the point you want to make. Earthing the neutral will trip a RCD, but measuring the mains wont.
It becomes a problem when you might want to measure waveforms on a switchmode supply. If one tries to put the ground clip on what might be 0V - bang! The probe cable and scope circuitry won't appreciate the fault current.

Nevertheless, the OP is doing some plainly stupid things. I should know - i've blown things up and zapped myself many times.

The differential mode is computed on many digital scopes, so it is next to useless - it really needs to be done in the analog domain.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman I was just relaying my experience, I don't wanna seem like a know it all its just this is the type of thing I have done a lot of and its been hammered into me

There is a lot of info online to see why its not right to put mains voltages into a scope even when the scope input voltage is above the mains potential

I havent watched it yet but I think he will explain better than I ever could

http://www.eevblog.com/2012/05/1...

Whren I said differential probes I meant proper hardware differential probes

These are the ones i own

http://www.ebay.co.uk/itm/like/2...

1289 USD second hand!, not cheap but absolutely essential for mains work

Quote:
the OP is doing some plainly stupid things

Exactly, I am sure he is learning and he seems really enthusiastic which is great, he should not get ahead of himself and go to mains as this would be wholly irresponsible of him

OP keep it real!

Last Edited: Sun. Aug 17, 2014 - 11:51 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hopefully it's not veroboard! If it's plain dotboard, then make it separate from the rest of your circuitry. Keep your high voltage separated from the low voltage - don't go crossing wires. Your circuit is not complete- you are missing a choke and snubber circuitry. Build that into a box and use wires for the mains rated to suit your circuit fuse. I would normally use a 60W light bulb (incandescent) as a load.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Hopefully it's not veroboard! If it's plain dotboard, then make it separate from the rest of your circuitry

I can't tell 100% but I would bet it is indeed vero board

Look at how wires come in and through a hole, if it were dotboard then surely the wires would be underneath?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Everyone Thanks for your response. Thanks for sharing your valuable knowledge and experience with me guys. Here have used doted general Purpose PCB Board for Zero-cross detection circuit and Triac circuit. ATmega dev board is also developed on GPP Board. but it is on separate board. i am giving ZC signal to ATmega8 INT0 pin through transistor with 10K RES @base side of transistor. Traic pulse is given from ATmega8 PIN through MOC3021 isolator. and i have used Snubber circuit as shown in image for a Bulb as LOAD.it is 100W bulb work on 230V.

Attachment(s): 

Taher Kawantwala

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

tahertinu wrote:
Hi Everyone Thanks for your response. Thanks for sharing your valuable knowledge and experience with me guys. Here have used doted general Purpose PCB Board for Zero-cross detection circuit and Triac circuit. ATmega dev board is also developed on GPP Board. but it is on separate board. i am giving ZC signal to ATmega8 INT0 pin through transistor with 10K RES @base side of transistor. Traic pulse is given from ATmega8 PIN through MOC3021 isolator. and i have used Snubber circuit as shown in image for a Bulb as LOAD.it is 100W bulb work on 230V.

I have developed this circuit and tested with 230V 50Hz. and with having load 230V bulb. i have used the same code.

uint8_t SPEED=0;
//Interrupt Service Routine for INT0
ISR(INT0_vect)
{
 for(uint8_t i=0;i

and it is working for both switches. 4ms delay after ZC pulse and 8ms delay after ZC pulse.
As it is working so I am planing to design the PCB for the same. Please guide me for this.

Taher Kawantwala

Pages