...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.
...I can drive the SSR directly with no transistor! I seem to have a knack for running into stuff like this.
[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.
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.
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...
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?