Multiple 230v Relay board for A Micro

Hey guys!
So, for my first project, I wanted to control lights. Those lights however are made for 230v AC (they are still LEDs tho with built in transformer, so this is a bit stupid).
Therefore I'm designing a compact relay-board for the A Micro, trying to limit myself to be able to get all the components from a single shop, and also as cheap as possible.

I stared playing with electronics not very long ago, my main experience is with >230v AC so I might get some stuff terribly wrong (that's why I'm here).
I researched components from the shop, and then I downloaded "ExpressPCB" to design the board. I'm thinking of etching it, but I'm not sure yet.

So, here's the image of the sketch:

And here's the image of the PCB:

And the datasheet for the relay can be found here in the shop: https://www.elfa.se/elfa3~eu_en/elfa/init.do?item=37-403-51&toc=19087&name=solid_state_relay_single_phase_1.18...2.5_vdc,_aqh3223

Can you see any major errors, or any reason why this wouldn't work? This is my first time doing something like this, so any tips are very welcome!
Thanks for your time!

Decided to step back to using only 5 relays and add a Fuse instead.
Also this design is easier to expand, should I decide to go for 7 relays again.

  1. Provide a link to the ACH3223 (is that what it is) (Not an e-bay shop).

  2. That is not the correct way to connect a relay to a micro. If you do you will fry your chip! Look in the playground to see how its done, as you did not provide a link I can't tell what you need to drive the relay.

Mark

I did post a link to the AQH3223... but here you go https://www1.elfa.se/data1/wwwroot/assets/datasheets/buAQH_data_e.pdf

Why would that fry my chip? I can't really see any reason why it should.

Why would that fry my chip? I can't really see any reason why it should.

Why,

  1. fly back aka back EMF unless the relay has a built in diode,

  2. size of the relay coil does it require more current to operate than a pin can provide,

  3. total power consumption when all relays are on.

Mark

PS Sorry missed the link in your post

M

It’s a solid state relay…
Basically what the micro is doing is powering a 1.2v 20mA LED. Yeah, that’ll fry it for sure.

As far as I can see the SSR has a max of 1.3v ON and a min of 1.21v for off do you think you can get that with just a resistor?.

Mark

Well... Powering a 1.2v LED with a 5v source to 20mA requires only a 220ohm resistor : http://led.linear1.org/1led.wiz?VS=5;VF=1.2;ID=20
So, why not?

20mA is a lot for the uC to be sinking or supplying, especially to multiple channels. Might I recommend a ULN2003A (http://www.digikey.com/product-detail/en/ULN2003A/497-2344-5-ND/599603)? It can act as a switching current sink, and I’ve used it before to drive mechanical relays and higher power LEDs to no ill effect and connect it directly to a uC. Basically connect the ‘ground’ end of the relay to the ULN2003A output and connect the input to your uC.

Also you might want to space your resistors out further from your connectors. They may interfere with each other, and at the very least will be hard to get at once everything is in place.

Also, if you are running at 230V, I believe that in the US you should fuse both AC lines (Might not be the case elsewhere in the world, Fuse any “live” lines and you can ignore any neutrals or grounds). Also make sure you have nice thick traces that don’t run too close to each other so you don’t burn them out or heat them up. It more depends on necessary current at 230V, but its likely if you are running at 230VAC then you’ll need more current.

germx:
Well… Powering a 1.2v LED with a 5v source to 20mA requires only a 220ohm resistor : http://led.linear1.org/1led.wiz?VS=5;VF=1.2;ID=20
So, why not?

Supplying 20mA from one Arduino output is no problem. Supplying 20mA from 7 outputs at the same gives 140mA total, rather high but still within the chip limit of 200mA Vcc or ground current. So your design is OK, if a little power-hungry.

However, those SSRs have a minimum turn on current of 10mA max. So you could increase the resistors a little to reduce the current to (say) 14mA, thereby reducing the Vcc current to around 100mA.

Bear in mind that your mains-voltage LEDs will have built-in switched mode supplies, so they will take a large surge current when first switched on as the input capacitor charges. This might overload the SSRs. You can reduce the surge current by timing the turn on to be just after a zero crossing of the mains.

Thanks for the suggestions. I ran 5x mechanical relays rated at 15-20mA with a ATtiny 85 with no problems whatsoever, so I'm not really worried. But I guess I could use 270ohm resistors instead.
I'll look at that ULN2003A anyway tho, it's nice to know about other solutions that might come in handy :slight_smile:

Being SMD resistors, I think they'll be fine. But I don't have that much experience with those yet. I will get a delivery next week to play around with, and then move them out a bit if needed.

If the fuse burns, there will be no outgoing AC. At least it's better than the relay-boards you can buy, they don't have any fuses (that I know of).

Thanks for the power clerification dc42, I did read up on the micro on the main site, but it only said that it was max 40mA per pin. But I figured if a 6 I/O digispark could drive 5 relays, then a 20 I/O chip could do it, otherwise, what to do with all the pins? :slight_smile: (Yeah, I think I'll be going with the 5 relay desing, not 7)

Hmm... That I did not think about. Haven't measured the current surge. Do you think that I should go with the Zero cross version of the SSR? Is there any drawbacks with that option?

Thanks a LOT for the feedback!

edit I didn't understand the specs on the ULN2003A 100%, but I see what you mean now. With that I could basically switch all 5 relays with 5mA total output from the Micro? Pretty nice!

germx:
Haven't measured the current surge. Do you think that I should go with the Zero cross version of the SSR? Is there any drawbacks with that option?

The drawback is additional hardware and software. For the hardware, you can use an AC-input opto isolator such as http://www.farnell.com/datasheets/54263.pdf along with a series resistor of around 100K to detect the zero crossings. Take care with choosing the series resistor - it needs to handle the full 230V plus transients, so if using SMD resistors then you'll need several in series.

The SSR you have chosen has a single-cycle surge rating of 12A. It may be that the LEDs have a current-limiting device (e.g. NTC thermistor) built-in and that the surge current is below this value.

Okay, but... there is a version of the SSR with a built in zero cross circuit. Do you mean that I need to add additional hardware for that to be of any use?

I highly doubt that the LEDs will have that kind of surge. The usual controllers wouldn't handle that.
For normal usage there won't be more than 30-40mA per SSR.
Though it's true that they have slow fuses in those cards.

The problem is measuring the short surge with a digital instrument.

germx:
Okay, but... there is a version of the SSR with a built in zero cross circuit. Do you mean that I need to add additional hardware for that to be of any use?

The zero-cross types probably won't work properly, because once the input capacitor of the LED power converter has charged, there will be no current flowing just after the zero cross. The result is likely to be a lot of flickering.

germx:
I highly doubt that the LEDs will have that kind of surge. The usual controllers wouldn't handle that.
For normal usage there won't be more than 30-40mA per SSR.
Though it's true that they have slow fuses in those cards.

What do you mean by "the usual controllers"? Incandescent lamps can draw a surge of 20x their normal current when first switched on (halogen lamps are the worst), so switches and dimmers for incandescent lamps have to handle that surge. However, 12A is quite high, so I suspect that the LED lamps will have a smaller surge current than that.

germx:
The problem is measuring the short surge with a digital instrument.

Easy enough with an oscilloscope.

dc42:
What do you mean by “the usual controllers”?

The LEDs are made to be used as traffic lights. The usual controllers would be the cards in the traffic light controller thingy. But they have to handle up to 5 of these firing at the same time.

Easy enough with an oscilloscope.

Surely, but I’d have to get one first. In my world you can just use a multimeter to measure whatever you need. I’m not used to this, fine tuned stuff.

Edit:
So after a lot of tweaking and redoing, this is what I finally ended up with → https://dl.dropboxusercontent.com/u/524696/Arduino/Rboard.r3.5fl-Amicro.PNG
And also a digispark version → https://dl.dropboxusercontent.com/u/524696/Arduino/Rboard.r2.9fl-digispark.PNG

So if anyone has any ideas on how to improve any of them in any way, that would be great! Otherwise this’ll have to do for a first try :slight_smile:

So this is likely the final design of the project. My 5x SSR relay shield for arduino micro.
We’ll see how it handles, I’ll try and etch it next week.
Thanks for the help so far! <3

Running traces under the SSRs is not a good idea, because it compromises the isolation between primary and secondary sides. I suggest you read about creepage distance.

And that's why the leftmost trace is PE. So that if anything creeps from the 230v side it will end up shorting to earth, burning the fuse. At least, that's the idea.