Triggering an SSR from Arduino Zero with NPN -- what's my mistake in this schematic?

Bonded the grounds between arduino and 12V supply and it works great! Thanks again, everyone.

Re: driving it without a transitor: I've come across some threads and such that seem to imply that the Zero's output pins won't go over like 2mA unless some extra code is used.
Thread: Are the Zero's pins set to strong drive strength by default?
Issue: SAMD outputs do not provide high drive current · Issue #158 · arduino/ArduinoCore-samd · GitHub

...those threads aren't super recent, but sounds like it might be the culprit? I'm going to test with the workaround code and see if that allows me to skip the transistor/resistor. Would be great if so.

No 'and', sorry -- I was just OT musing that it was strange that the devices wouldn't operate in the more straightforward configuration. Sounds like it might just be a Zero quirk.

Ah shoot right, I was so focused on driving the NPN I forgot the output pin needs current limiting. Thanks. Hopefully didn't hurt anything.

Confirmed: when I use this workaround code on the GPIO pin:

PORT->Group[g_APinDescription[MY_PIN].ulPort].PINCFG[g_APinDescription[MY_PIN].ulPin].bit.DRVSTR = 1;

...I can drive the SSR directly with no transistor! I seem to have a knack for running into stuff like this. :slight_smile:

[EDIT: Unconfirmed! It turns it on, but not fully; output voltage was like 8V instead of 12V... seems that a transistor is necessary, at least with the Zero.]

Since the SSR has a built-in resistor, I'm probably safe without something inline from the GPIO, yeah?

Glad to hear you got it working.
I'm going a little off topic: How much current do you plan on flowing through the load side of this SSR? I'm always skeptical of low $, high current relays without heatsink bottom plates.

Let me know how this one works out for you once you have it in service.

Thanks

It's just a 75W centrifugal fan, but I'm PWM throttling it, and not sure yet what level it will be running at. I'm guessing at like half or less of its capacity. So maybe 3A? Nothing intense, but it will be in a museum context so I'm hoping it will last a little while. It will also be activated in short bursts only, not running continuously.

These SSRs do have a metal bottom plate (doesn't look like it in the Amazon pics, but they do.) They also sell a similar one at Sparkfun (for AC), for what that's worth.

Oh, it shouldn't have any issues then.

That's good to know. Thanks

SSRs are optically isolated so you could have just connected the arduino dig out and GND to the SSR control input without the PS and transistor
You can verify this by just connecting the arduino 5V and GND to the SSR and you will see it turns on so that means it would turn on with a digital outout signal and the arduino would be optically isolated inside the SSR.SSR SCHEMATIC

The SSR has a built in resistor because it has an opto isolator which is nothing more than a resistor and led with a photon barrier and a photo transistor receiver to turn on the output.

Thanks, yeah -- that's where I started but it didn't work due to the Zero's undocumented current limitation on the GPIO pins (see post 22). The solution in post 23 seemed to work, so I went back to controlling it directly from the GPIO. However I'm not sure it's actually enough current, still -- on a test arrangement I have, when driving the SSR from the digital pin directly, the load side is only outputting like 8V (instead of the 12 being fed to it). I'm going to wire up a transistor arrangement and see if that solves it, or if maybe I have a faulty SSR in the test setup. Investigation ongoing...

All your doing is turning on an led in the SSR optocoupler so 15 to 20 mA should be fine

The Zero is spec'ed at 7mA max from the GPIO pins, but without the code workaround it actually only delivers 2mA max. I just wired up the transistor arrangement with my test setup and now it's working as expected... I guess whatever resistor is internal to this SSR is just not being driven enough by the 3.3V from the Zero's pin?

That sounds like the size of it.

Why PWM not working with SSR-controlled fan? - Using Arduino / General Electronics - Arduino Forum