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.

Controlling 230v on/off from a PIC

Status
Not open for further replies.

edeca

Active Member
I designing a circuit to turn on/off 230v mains from a PIC. I plan to control an 18W heater but would like it to be flexible up to 60W if possible (for bigger heaters).

Thanks to some great help in another thread I know how to correctly power the PIC at 5v from the mains supply. I wanted to do this as it seemed silly to have a package that involved incoming mains but also needed a DC power supply. Now I need help switching the outgoing mains.

I am trying to avoid suggesting my own solutions. However, an Omron G3VM-351B was suggested in another thread. This seems to offer a load of 120mA which would be fine for the 18W heater, but no bigger than 27W (if 0.12*230 is correct!). The smaller I can make the circuit the better, so an all-inclusive package like this looks nice. However, I am open to any option. A normal relay would be fine, but everything seems to suggest that this needs its own DC supply for isolation.

If anybody can provide circuits, links explaining the theory or suggestions that would be great.
 
Last edited:
hi,

Google for opto triac this device will give the isolation and the ability to control power triacs safely.
 
hi,

Google for opto triac this device will give the isolation and the ability to control power triacs safely.

That's interesting. This: https://www.electro-tech-online.com/attachments/timer-jpg.10745/ looks similar to what I am trying to do, including the transformer section. I wish I had found it earlier!

However, I thought the opto triac was designed to feed another triac and the thread the image comes from says that too.

I think my choice comes down to:

1) a relay
2) an opto isolator & triac
3) some sort of single package (like the mosfet device linked in my 1st post)

I know that the relay would need a separate DC supply and don't know where to obtain it if I plan on having a transformer like above.

I still haven't found a decent triac & opto triac circuit example and I'm not sure where to start, so options for that would be good.

I don't know anything about choice 3, so would appreciate options that allow enough current for ~60W.

Thanks for your post, I plan on reading up on some of the MOC3xxx optotriacs later. I think finding one that can handle the voltage is going to be the task.
 
I know that the relay would need a separate DC supply and don't know where to obtain it if I plan on having a transformer like above.
Instead of the 6Vac transformer you could use a 9Vac transformer, that would give about +12Vdc on the input side of the 7805.
That would be able to energise a 12Vdc relay using a transistor driver from a PIC output pin.

I still haven't found a decent triac & opto triac circuit example and I'm not sure where to start, so options for that would be good.

I don't know anything about choice 3, so would appreciate options that allow enough current for ~60W.

Thanks for your post, I plan on reading up on some of the MOC3xxx optotriacs later. I think finding one that can handle the voltage is going to be the task.


hi,
You can get 12Vdc relays that have mains rated contacts.
 
hi,
You can get 12Vdc relays that have mains rated contacts.

I have seen ones with mains rated contacts but I am unsure on two points:

1) is is possible to trigger easily from 5v, as that is the output of the PIC
2) does the input of the relay need to be isolated from the PIC power supply at all? I have read posts which suggest a separate DC supply is the correct way.. but fail to understand why

A relay is definitely the easiest (and probably cheapest) way, I am just stuck on those two points. Would something like this be suitable?

MULTICOMP MCHRM-S DC5V
 
I have seen ones with mains rated contacts but I am unsure on two points:

1) is is possible to trigger easily from 5v, as that is the output of the PIC
The PIC output would drive a low power transistor via a resistor, the collector of the transistor would be connected to the 12V relay.

2) does the input of the relay need to be isolated from the PIC power supply at all?
If you buy a relay that is rated for mains switching that will be OK.
I have read posts which suggest a separate DC supply is the correct way.. but fail to understand why
So do I.!

A relay is definitely the easiest (and probably cheapest) way, I am just stuck on those two points. Would something like this be suitable?

MULTICOMP MCHRM-S DC5V

hi,
I'll look at the link.

EDIT: the relay is rated at 240Vac, 10A max , its got the correct approvals so it should be OK.
Remember to have a clamp diode across the relay coil.

The relay coil requires 5/36 = 136mA, so you MUST use a driving transistor between the PIC and the coil.
 
Last edited:
hi,
I'll look at the link.

EDIT: the relay is rated at 240Vac, 10A max , its got the correct approvals so it should be OK.
Remember to have a clamp diode across the relay coil.

The relay coil requires 5/36 = 136mA, so you MUST use a driving transistor between the PIC and the coil.

I planned on a standard circuit something like this to drive it: http://www.rentron.com/images/NPN-DRIVER1.GIF

I think that should be perfect.. as long as I can connect the +5v source to the relay from the same source as the PIC. Please shout if not.

Out of interest, what approvals would you look for when buying mains rated products? I don't fancy frying myself!

Thanks.
 
Yes, this is ok. just get more current capablity diode for better protection ( 1N4004 ).
 
Yes, this is ok. just get more current capablity diode for better protection ( 1N4004 ).

I'm confused.. the whole 1N400X family are 1A diodes? However, I notice that the 1N4004 is rated for 280V (RMS) reverse voltage.. was that what you meant?

In which case.. I think the 4004 is probably the right one to use?

Thanks.
 
I'm confused.. the whole 1N400X family are 1A diodes? However, I notice that the 1N4004 is rated for 280V (RMS) reverse voltage.. was that what you meant?

In which case.. I think the 4004 is probably the right one to use?

Thanks.
hi,
The 1N4001 are 50V wkg, they will be OK, for a 5V relay.
If you buy in the 1N400x in packs, I would go for 1N4007's they can be used on almost any circuit.
 
hi,
The 1N4001 are 50V wkg, they will be OK, for a 5V relay.
If you buy in the 1N400x in packs, I would go for 1N4007's they can be used on almost any circuit.

Of course! They aren't on the high power side of the relay, I wasn't thinking :)

When you mentioned approvals before for the relay, what was it you looked for?

Thanks for all your help.
 
Of course! They aren't on the high power side of the relay, I wasn't thinking :)

When you mentioned approvals before for the relay, what was it you looked for?

Thanks for all your help.

hi,
Look at this picture and text, ref approval.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top