Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Zero crossing to pic from 24 VAC with 2n2222

Status
Not open for further replies.

igeorge

Member level 5
Joined
Oct 31, 2010
Messages
85
Helped
1
Reputation
2
Reaction score
2
Trophy points
1,288
Activity points
1,956
Hello,
I have a zero crossing circuit feeding input B0 on a pic , by using an optocoupler
I would like to replace the opto with a 2N2222
I do not have a clue and need help, eventually a hand drawing schematic
Thank you
 

Attachments

  • ZeroCrossOpto.png
    ZeroCrossOpto.png
    27.2 KB · Views: 110

That doesn't really look like a zero crossing detector to me,
at least not what I'm used to. There will be one pulse per
crossing (either direction) but only if the + of the FWB
returns to less than opto Vf every cycle - get a leaky forward
diode, and it might never.

Since you're isolated you might be able to substitute a
simple NPN, but this will be more sensitive to needing the
FWB output to return to GND every half-cycle (its Vbe
is likely much lower than optoisolator Vf). You might
need to add a shunt resistor (or divider) to make this
robustly so, and you should think about protecting the
NPN (or the opto) against negative excursions (as a
leaky FWB might allow, or a direct-to xfmr connection
would surely impose if you elected to take the signal
right off the secondary).
 

This it does works for me as now.
Attached is a simple schematic
I removed all the unnecessary components
Out can be 12VAC from center or 24VAC full
Do you have a suggestion and a drawing ?
Thanks
 

Attachments

  • simple.png
    simple.png
    10 KB · Views: 90

@ Easyrider83 ,
So what do you suggest ?
Do you have a drawing ?
 

Drawing? Just exclude the optocouple. Connect resistor directly to transistor's base. This should be enought.
 

Sorry easyrider83
Does not works
the transistor collector is ON all the times
Attached is a picture of the base signal
 

Attachments

  • 20141110_002254.jpg
    20141110_002254.jpg
    2.7 MB · Views: 65

When input voltage to base drops below 0.7V the transistor turns off and due to resistor on collector you will get Vcc at the collector. When input voltage to base of transistor rises above 0.7V the transistor goes into saturation and it will be ON and hence you will get around 0.4V at the collector of transistor. Transistor will be acting as a inverter.


Here is a ZCD circuit.

https://tahmidmc.blogspot.in/2013/06/ac-power-control-with-thyristor-pulse.html

https://tahmidmc.blogspot.in/2013/06/power-control-with-thyristor-phase.html
 
Hi,

Use an NPN type bjt.
Connect E to Gnd
Connect C to output pullup resistor.
Connect rectified AC with a current limiting resistor to B. Maybe 1mA at peak voltage.
Connect an additional resistor from B to Gnd. Maybe the same value as the resistor above.
...Then it switches ON with an input voltage of about twice Vbe = about 1.3V.
If you need it to switch on at lower voltage, then increase the value of the second resitor and vice versa.

Klaus
 
I did and here are the results
Transformer is 2X12 volts
I use the lower side to get 5 volts and for zero crossing
The top i use it for a valve
You have the schematic and 3 pictures.
One is just after diode before going to voltage divider
The second one is on the base of transistor after limiting resistor
The last one is on the collector
The wave is weird with that bump on the middle of zero volts. It is about 300 mv
Any suggestion ?
 

Attachments

  • drawing.png
    drawing.png
    15.1 KB · Views: 77
  • Just after diode(FILEminimizer).jpg
    Just after diode(FILEminimizer).jpg
    678.3 KB · Views: 95
  • Base(FILEminimizer).jpg
    Base(FILEminimizer).jpg
    676.5 KB · Views: 69
  • Collector(FILEminimizer).jpg
    Collector(FILEminimizer).jpg
    892.3 KB · Views: 111

Hi,

for sure the scope shows different diagrams:
The first schematic is with full bridge rectifier while your actual circuit shows a half wave rectifier.

Although not wrong: R1 is somehow useless.


Klaus
 
Thank you KlauST,
But what i have to do with the bump in the middle.
If you look at the picture before voltage divider you will see that it is just some peaks.
After voltage divider it transforms on some steady up and down levels, no peaks.
Just on the middle of up level it is a little bump , little peak which is amplified more on the collector of the transistor
On the pictures you can see some measurements of the wave on the scope.
What do you suggest to get read of that spike ?
 

Hi,

i just can imagine...
Could it be from ground bounce caused by the high current when your capacitors are charged?

Try to lower the value of R3. Maybe also 4k4 (isn´t this an unusual value?)

Klaus
 
I will
The value was selected by using my voltage divider link
"http://www.calculatoredge.com/electronics/voltage%20divide.htm"
You fill 3 field and get the last one
I have after diode 6.57 volts
I divided to get 1volt
What is weird is that with no base connected it shows 1 volt, but when i connected to base, with or without resistor, drops to o.3 volts
What i am doing wrong here
The 4.4K was made by 2X2.2k in series
Can you help me to get the right resistors values please
Divider and collector to VDD voltage
Vdd is 5 vdc from 78o5 as in the drawing.
Please help
Thank you
Ion
 

hello

do you want zero cross detection at 100Hz !

Base current in transistor must be strong enough...
and adding a trigger de schmitt 74LS14 (or equivalent in CMOS)
gives a sharp pulse ..
your can reverse the sign of pulse by using another 74LS14 ..


Alim_5V_et_Synchro100Hz.jpg
 

Thanks you Paul but i cannot do it on this project. No room on the board
I will use it on other projects because i love the shape of your wave form from 74ls14
At this stage, i try to figure out the best resistors for the example above 9 latest drawings and pictures)
Just for curiosity, why do i need the 2n2222 in this case if i use the inverter gate.
2n2222 is in fact an inverter in this configuration
Maybe i should put just a voltage divider at the gate input ?!?!?!
What is the software you use to simulate ?
Thanks
george
 
Last edited:

2N2222 is used to adapt the voltage level .. >14V peak value !
and amplifie the area of the signal near zero volt ..to obtain a less width signal, (because NO hysteresis!)
as if used direct with a 74LS14..

Alim_5V_et_Synchro100Hz_direct.jpg

Zero detect pulse is very large in this case...


software used:
Circuit Maker for Student
CM60S.jpg
 

Please Define the purpose of ZCS pulse.

pulse width? Lag/lead? Polarity?
Or just high or low if Vo<=x [V] where x=<0.5V


Two common solutions

1. A logic inverter can make sine > square wave {with ac couple and 1M feedback.} An XOR gate with small RC delay on 1 side can produce pulse for each transition. RC delay can be anything from <<1us to >>1ms.

2. series Cap-resistor to a zener with high R across cap
- the pulse width will reduce to steady state ratio of series/parallel R , after C charges up, using on 2 small signal Schottky diodes if using centre tap = gnd. Will generate pulse if Vo<0.5V for peak voltage of 24X1.4=34V thus 0.5/34= 1.5% pulse width. Steady Pulse width is determined by diode Vf and Rs/Rp ratio.

Make sense?
 

Thank you Paul
I had the impression that it you used circuit maker but i was not sure. I downloaded the student edition but is little hard to start. Can you post please your latest version of project as zip so i can play with it? I can see that just the gate does the job. They sell at digikey just one gate in a small package, like a transistor or sot. Maybe i use it to replace 2n2222

- - - Updated - - -

Hello Sunnyskyguy, the ZCS is used by port B0 on a pic to generate an interrupt.
I drive an AC motor which speed is controlled by phase delay. When i detect the zero cross i start the motor with Am!Al35@0#Par0la$9a short delay for higher speed , or leave a longer delay for slow speed.
Because Paul proposed above the use of 74LS14 , ( what you suggested also), can you give me the values of the R and C to obtain a 1 ms pulse at zero cross with an XOR ?
Where should i connect the RC ? Between the output and one input ? Please post a small drawing. Thank you
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top