Low current AC control system

tegwin

New Member
Im looking into the possibilities of using a Picaze 28X1 to control an unusual central heating system.

Because of the nature of the system a lot of the inputs and outputs need to be 230v AC with a maximum peak load of 0.2A. (4 mains inputs, 3 mains outputs)

I was considering using relays to change the 230V AC down to the 5V required for the PIC. However, there must be a simpler and less "mechanical" solution considering I am not actually drawing a whole lot of current from the control system.

Can anyone suggest a suitable method of isolating the logic control signal from the 230V down to 5?

Was thinking about using Photomos relays...rapidelectronics part number 60-4320 for the outputs but not so sure about the inputs

My only other concern is how reliable the PIC will be in a control system such as this? once its set running will it keep on going for years to come, or is using a PIC for such a vital task not really the best of ideas?

Any input greatly appreciated.
 
Last edited:

moxhamj

New Member
Photomos or relays or solid state relays or triacs will all work for turning things on and off. I have a preference for relays because one can build a circuit and test it by hearing the relays going on and off, and then connect up the 240V later. With other switching devices the 240V has to be connected to really prove it works and if it doesn't work then you are troubleshooting a circuit with 240V on it.

Detecting 240V can be done in all sorts of ways - there is a circuit that drives a led using a capacitor/diode/resistor and the led could be replaced with an optocoupler. Or you can detect the light from a 240V neon indicator lamp using an LDR. Personally I'd use a relay with a 240VAC coil as the click is useful in the debugging stage. A 240V to low voltage transformer is another option.

PICs are reliable if they don't get zapped with lightning or anything, but that would apply to other electronic components anyway. They don't like high currents near them (20cm) - eg switching a 240V 5A load with the wires running nearby can cause resets.
 

BeanieBots

Moderator
I'm with Dr_Acula and favour the use of relays, particularly from a safety aspect. Particularly for the 230v inputs to the PICAXE.

It does depend a lot on what you are switching. The use of zero-crossing detect solid state relays can avoid a lot of switching interference whcih could help prevent undesirable PICAXE resets.

I have a 28X at the heart of an aquarium controller which has been runing for several years quite reliably. Initial problems were caused by resets of the real time clock whenever the lights were turned turned on. This was cured by a few ferrite beads and better cable runs.
I still get the occaisional corrupt character on the LCD display when the lights switch but they soon get overwritten and no more general resets.
The heaters switch at about 1Hz so I used solid state for those because the constant clicking would be very annoying and probably not very good for the relay.

So, yes, a PICAXE can be used to run a system that switches mains for many years but you will need to take precautions for noise. The level of protection required will depend on your loads.
You should also ASSUME FAILURE WILL HAPPEN and build in the appropriate failsafes. eg bimetallic cut-outs for over-temp or whatever it is that you are controlling.
 

inglewoodpete

Senior Member
I'm in the solid-state camp on this one.

Relays take considerably more current to operate, are bulkier, costlier and (slightly) less reliable. You also need to deal with EMR created by the back EMF. Due to the additional current, driving them from 240v can have heating issues.

My choice would be an R + C + diode dropper combination with an optoisolator and LED in series. The opto and LED both need about the same current to operate (they are both LEDs, after all). The (visible) LED would provide the much-needed feedback when the input is active.
 

hippy

Technical Support
Staff member
What's your skill level and your experience of with working with mains voltages ?

While developing I'd suggest putting walwart PSU's across each 230VAC circuit and detecting the presence of power from those via R's in series.

You can later move up to relays, opto isolated connections or even direct mains connection. But don't even think about that if you don't know what you are doing !

Depending upon what you actually need to do you may be able to get away with a lot of it using just 230V powered relays switching 230V.
 

andrew_qld

Senior Member
If you want to switch 230V then relays are definately the way to go.

For sensing 230V I normally use a plugpack ("wallwart" in american) plug in transformer that converts the 230V down to 5V or less.

Take note of the safety notes above. Also, check with your countries legislation on mains wiring- it may be totally illegal to do what you want to do (it certainly would be in Australia unless you are a licensed electrician). For example, if your device caused a fire it would void insurance if illegal.
 

evanh

Senior Member
For stability it's mostly about your board layout, circuit filtering and packaging choices rather than the components themselves.

Regards to SSRs, they are reliable as long as you massively overrate them. The real bonus of SSRs, though, is they can be cycled indefinitely and very quickly.

They often come with input indicators built in but it's also easy to add that anyway. They don't take well to short circuits and they always leak on the switched side. Make sure you have real isolation from the supply before handling their field devices.

Finally, because they are built from triacs/SCRs and steal power from the load, at high loading they get hot quickly and need large heatsinks and good cooling, no exceptions.


Evan
 

evanh

Senior Member
I haven't played with photomos for outputs myself but I'd guess they'd be a bit prone to damage on direct mains.

For inputs, hard to beat a plain optocoupler. There is more than one way to poke 230 volts into an opto. Inglewood's setup wins, and using X rated capacitors is seriously reliable but rather bulky.
 
Last edited:

tegwin

New Member
Chears for your input guys. Most appreciated.

For the input I have decided to use relays for simplicity and to reduce the number of components connected to 230V.

For the output I intend to use an optoisolator driver and relays again for safety reasons. (I had looked at triacs but relays are so much simpler)

If im using optoisolators on the outputs and am filtering the PIC power supply, will this totaly remove any reset/error issues or do I need to consider anything else?


Im confident and happy working with mains and have enough experience to know whats dangerous and am designing all circuitry to "fail safe".

But as someone mentioned higher up the page... Is it legal in the UK to build and use a homemade central heating control system.

All I am effectivley doing is taking the signal from room stats, temperature probes etc and feeding it back out to the control signals on the heating units and valves.
 

BeanieBots

Moderator
Is it legal in the UK?

Do you know how to calculate what gauge wire to use?
Do you know how to derate that gauge depending on how many cables are in the trunking?
Do you know which safety devices the law requires you to add?
Are you altering the wiring of a CE marked device?
If yes, do you have TUV approval?

If the answer to ANY of the above is no, then you would be breaking the law in the UK because if you had the required qualification you would know the answer to all of those questions.

If you have the required qualification but can't answer those questions, you won't be breaking the law, but you should consider a refresher course!
 

hippy

Technical Support
Staff member
Is it legal in the UK to build and use a homemade central heating control system.
Yes, but definitely no if you don't comply with current regulations and legislation.

From http://www.baileyandbirch.co.uk/news letter.html ...

"Homeowners who plan to carry out home improvement projects should be aware of tough new changes to building regulations, which if not complied with, could land you with a massive £5,000 fine and a property you can't sell ...

Under the law, homeowners are still able to replace accessories such as light switches and sockets to an existing circuit, although there are exceptions for locations such as kitchens and bathrooms. An electrician registered under a government-approved scheme must undertake all other work. The alternative, for DIY'ers, is to notify a local building control body before starting any work and pay the appropriate fee for an inspection and a certificate after work is completed."


You could just go ahead and do it, but then it's the secondary consequences which bite. If you don't have the required certificates your house insurance may be invalid, if you try and sell the house you face dealing with HIPS and surveyors who take one look and ask for a certificate, and, if you're unlucky, shop you to the authorities.

Official Part P regulations can be found here ...

http://www.planningportal.gov.uk/PpWeb/jsp/redirect.jsp?url=http://www.planningportal.gov.uk/uploads/br/BR_PDF_ADP_2006.pdf

I am not a Lawyer nor registered electrician, so this is not advice or recommendation; but it should be possible to not install a central heating controller, but to just install relays which switch circuits. You can fit everything and get a qualified electrician to wire it up or go the self-certification route. Either way, at that point you have legal mains wiring and paperwork to prove it. Adding a low voltage control system ( even if mains powered ) would seem to fall outside the Part P regulations although other EU directives may apply.

The law is nearly three years old so it's not likely you could pretend it was installed years ago, before the regulations came in. That's not recommended and likely illegal to do in some way or other.

Added : Part P might not apply in Scotland.
 
Last edited:
Top