Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

switching AC

Status
Not open for further replies.

large_ghostman

Well-Known Member
Most Helpful Member
i am off to school but today when i get home one the things i need to work on is how to switch my humidity device on/off, i have the sensor part under control now its down to switching. Its a simple on for x time (few seconds normally sometimes more) then of for anything from couple seconds upto 30 mins or more depending on the readings,
the unit itself is one of those foggers you can get for reptiles and stuff.
Voltage is 24VAC, i was thinking triac but the opto's i have are not zero cross detect (does it matter?) or i have a Mosfet circuit in mind with a rectifier. going to have a think about it at school, and report back later. slowly getting it all together (too slowly tho) soon it will be code time :D other job for today is look at seven segment displays, my choice is a scanning technique or i might just use a shift register. i have multiplexed displays and some normal ones.
anyway back later!
LG
 
Use a triac and sense the zero crossing with a pic microcontroller. You can then also vary the power to the unit by only allowing though a certain "pattern" of mains cycles - for 50% power use every other cycle.

To be honest with you, switching something at 24vac at slow speeds won't really make much benefit of zero crossing but it is good practice to do it anyway. I built a washing machine once as a project (a full size one !) and did a lot with zero crossing detection and speed control :)
 
Just use an optocoupler with built in zero cross firing. That way all you need to do is supply a few volts at 10 or so ma in order to drive your AC load.

No point in over engineering things when a part with four pins that costs less than a good gumball can do it all for you. :p
 
To be honest I wouldn't worry too much about the zero crossings - not if it's only switching every few minutes. Best bet would be to fit a socket for the opto (always good practice as it's vulnerable to getting killed by stuff on the mains) - then you can prove the concept using the optos you've got, and get the zero-crossing ones next time you get an order together.
Don't forget to fit a snubber network across your main power triac too (think 100n in series with 100R is standard - does that sound right chaps?)
 
i have a couple of zero cross but i might need them for switching line voltage for the heaters so i am keeping them back! i always socket all ic's incase i need to change one or pinch it for another circuit :D the part i have most of is the TIL3022 datasheet here **broken link removed**
or even here


i am not dealing with much voltage just 24V AC running at around 850mA so my options may even include zero cross detection with micro as it's a golden chance to try it on non lethal voltages! or i might go the Mosfet route still unsure for now.
 

Attachments

  • TIL3022.pdf
    174.4 KB · Views: 281
I wouldn't worry the least bit about using a zero cross circuit for your little 24 VAC load.
I have worked on large Century arc welders that pull up to 10 KW that use non zero crossing random turn on type SSR's for their primary side power regulation.

If they can do that without messing up their internal control system I have serious doubts your little 24 VAC circuit is going to cause enough interference to bother your control circuits.;)
 
and just for completeness here is the mosfet circuit i had in mind if i go that way, i think if i did go for the zero cross detect with a micro route then it would be a pure learning experience and i would want to try and add a filter, i do except fully that from the outside it seems a utter waste of time energy and components, but on the other hand it might be a chance to get a little experience of something without having to use dangerous voltage so it does kind of appeal from that point!
anyway here is the mosfet circuit i was thinking of using, no values added as i havnt thought that far :D
acswitching.JPG
 
That should work but I have a curiosity about how you plan to deal with the floating ground/common lines between the DC logic side and the AC fogger drive side? :confused:
 
well OBVIOUSLY i am going to ermmmm well i will.......surely i dont need to spell it out:rolleyes: we are all pros here!:wideyed:
actually the issue of floating ground never occurred to me :oops: so i think best i get back to you on that :D, as i am/was tempted to be stupid and say tie them together but seeing as you asked the question makes me think there is more to it than that :D
 
If the 24vac supply is isolated from the digital supply (i.e. fed from a separate transformer etc) then surely it would be fine to tie the ground from the Mosfet driver bit to the microcontroller part ?

*Edit - you could even just replace Q1 with a relay for full isolation but then you might as well just use a relay to switch the fogger lol.
 
Good answer! :D

Sometimes the simple way really is the easiest to do.:p

I would just opto isolate the circuits and be done with it.;)
 
Just use an optocoupler with built in zero cross firing. That way all you need to do is supply a few volts at 10 or so ma in order to drive your AC load.

No point in over engineering things when a part with four pins that costs less than a good gumball can do it all for you. :p

Don't some of these company's have an Educational System, if he's just experimenting maybe he could ask them if they'll let him have 5 or 10 of these. All he would have to do is pay for shipping?

I remember, I was fixing a Light Box for a Church one time and picked up 5 Triacs or Thyristors, I can't remember which, but it was no charge.

Maybe they would just ship out some zero cross opto, let's say 10. They might be more incline to do so, if he coupled it with an order?
 
i will sort some triacs and just go with the opto's i have
 
It is easy to detect a zero crossing. With a single comparator you can create a digital signal which will interrupt your PIC at every second crossing.

You need to check from time to time wether the switch should be on or off anyway. The "zero crossing" interrupt is a good place to do all the checking and switch if necessary.
 
with a comparator i was wondering, i take it the idea is to switch at the point the waveform hits the zero point just before it start's its way down into the neg, so. do you set the comparator at say zero volts or say 1mV? because i was thinking if you wait untill its actually zero then you dont have micro time to do anything?? or am i over thinking it?ive read the micro chip mains zero crossing with a pic but didnt really get at what point you would fire an interrupt, logic says to me just before so you have time to do something, maybe right at the start of a falling edge???
 
You do not need to be very accurate. You will have plenty of time between the zero crossing and the voltage coming to the level where the triac can switch on.
 
fascinating stuff! i have no idea what triacs we have, i know there should be a couple of spares somewhere as dad used some ages ago on a circuit eric gibbs did for him on here, and we might even have some different ones but as i havnt messed with AC before i havnt taken notice if we have any.
the more i think of it tho a opto and triac is a good chance to learn how to control AC, the fogger is a nice simple on for a bit off for a bit kinda thing, so a good place to learn some techniques for other stuff,
then i might get a crack at messing with phase angle firing with some kind of PID with the heaters! again i might try 24V with these but probably not unless i go with the lower resistance version of what i have ordered. still it wont hurt to try it on 24V first before plugging it into the mains :D
 
Hi,

As you probably gathered by now, when you just have to turn a load on and off you dont need to sense zero crossing in many cases. You just need to turn the triac on or off as needed. You can do this with a switch and resistor or opto if you prefer.

The MOSFET/bridge setup is not needed here. It just adds complexity. But if you want to use it anyway then you need to find a way to power the MOSFET gate. Since it doesnt take much power it shouldnt be too hard to do.

Another problem with either of these solutions however is that there will be significant drop in the switch. It could be as high as 1.5 volts, which may or may not affect the application load significantly so you'll have to check that. If you puts two diodes in series and then another set of two diodes in series and then put those two strings in antiparallel, you can then insert that in series with the load. If the load still performs well then the switch voltage drop wont be a problem.

Another problem that 'could' come up in the MOSFET solution is back EMF from the load. If there is back EMF even during one switch 'off' cycle, that could destroy the diodes and/or MOSFET. So some snubbing may be necessary. If the load does not contain significant inductance this may not be a problem but something that has to be kept in mind.
 
what do you mean by switch? not a real one you manually push? this has to be automated as its for a fogger, what happens is the humidity sensors tracks the humidity and when its too low it blows a little fog in for a few seconds then waits 20 seconds takes another reading and adjusts again. once the correct humidity is reached it then goes into a routine that tries and keeps it in range, so it blows a 2 second puff in every 2-3 mins to compensate for the humidity lost through venting etc :D, i also obviously have to sync it with a fan but tomorrow i will post a pic of the unit i am building as we have one here on another incubator, the setup is good its just the way they do the switching and timing is rubbish
 
i am not going to worry too much about zero cross and all that because i have decided that when the heaters get here i will try them out first with the big 24V weller soldering iron transformer, once i have it sorted on that i will connect to the mains:eek: under strict supervision of course :D:woot:
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top