Did I mess up? SSR control - Page 1
Forum section: electronics / projects

author: antonmi97
author_rank: Contributor
timestamp: April 05, 2019, 07:22:56 pm
content: Hello everyone!This is my first forum post, and to be honest, I'm not really happy that I have to post this question, because it seems trivial. Anyhow, here we go.I am designing a SSR mains light controller board and I want to controll the SSR with a GPIO of my ESP8266.The SSR is the AQH3213http://www.farnell.com/datasheets/1682136.pdf?_ga=2.232540383.1564095963.1554464329-1879432376.1547653567I did thisAnd I'm not sure if it will work. Can anyone clear things up a bit for me?

author: pelule
author_rank: Frequent Contributor
timestamp: April 05, 2019, 07:33:41 pm
content: Missing some needed connection in your schematic ... U2 / pin (4) == cathode of the opto-LED should be tied to ground or you have a floating circuit./PeLuLe

author: antonmi97
author_rank: Contributor
timestamp: April 05, 2019, 07:47:52 pm
content: It’s just hidden. All GND pins in my schematic are hidden and connected to the GND net. The only thing worrying me is if the SSR will even turn on. I tried turning a LED on (that works), but I’m not sure I understand what it takes to turn on the SSR (I don’t understand it’s datasheet). Any help is appreciated

author: langwadt
author_rank: Super Contributor
timestamp: April 05, 2019, 08:01:21 pm
content: Quote from: antonmi97 on April 05, 2019, 07:47:52 pmit is just like driving an LED, 20mA to be use it turns onI don't see why you need all that stuff

author: antonmi97
author_rank: Contributor
timestamp: April 05, 2019, 08:07:28 pm
content: I thought so too, but I wasn’t sure. So you think it would work with just directly connecting a GPIO pin (with a current limiting resistor) to the VCC pin of the SSR? I don’t need a voltage divider?

author: wraper
author_rank: Unknown
timestamp: April 05, 2019, 08:08:46 pm
content: Quote from: langwadt on April 05, 2019, 08:01:21 pmYep, if control circuit can provide over 10mA, all you need is single resistor. All that bloat is pure nonsense. Especially R4, R5, D1, C1.

author: wraper
author_rank: Unknown
timestamp: April 05, 2019, 08:10:49 pm
content: Quote from: antonmi97 on April 05, 2019, 08:07:28 pmWhy would you need voltage divider?

author: SenseofScale
author_rank: Contributor
timestamp: April 05, 2019, 08:19:53 pm
content: I don't know about the particular device, can it source 10-20 mA from a GPIO pin? The datasheet gives different performance curves for currents ranging from 10 to 50 mA for activation of the SSR.Supposing the transistor is needed, shouldn't they also move it to the ground side?

author: Zero999
author_rank: Super Contributor
timestamp: April 05, 2019, 10:10:17 pm
content: According to the datasheet, the SSR is guaranteed to trigger, when the LED forward current is above 10mA, but it will most likely trigger with just 5mA and it can be as high as 50mA, before any damage occurs.The ESP8266 has a maximum output current of 12mA.All you need is a resistor. Assuming the forward voltage drop of the LED is 1.2mA and a power supply voltage of 3.3VI = 10mA = 0.1AVF= 1.2VDD= 3.3VR = (VDD-VF)/I = (3.3-1.2)/0.01 = 2.1/0.01 = 210R.Use the next standard lower value resistor such as 200R or even 180R.If you use a transistor, it can go either side of the LED, but if it's on the positive side, it will drop another 0.6V, so the series resistor's value will need to be reduced to compensate.

author: antonmi97
author_rank: Contributor
timestamp: April 06, 2019, 10:09:08 am
content: Yes, this is what I needed. I was not sure if my uC could source the needed current so I put in the transistor, and yes I should’ve put it on the ground side, but this should work anyhow. When the boards arrive I’ll give it a final test with and without the transistor, but I’d prefer it with the transistor in order to protect the uC

author: Ian.M
author_rank: Super Contributor
timestamp: April 06, 2019, 11:01:04 am
content: There's nothing wrong with an emitter follower if you need to source more current from a MCU pin, don't want to invert the signal, and can tolerate the 0.7V Vbe drop. However, as Wraper points out, your circuit needs decrapifying. When the boards come, do not populate D1, C1, R2, R5, and fit zero ohm jumpers for R1, R4.56 ohms should work well for R3 giving a LED current of about 23mA., which is pretty close to the recommended 20mA. I wouldn't go much higher for R3 as the efficiency will drop as the LED ages.Zero999's calculation neglects the internal voltage drop in the ESP8266 output, which when sourcing close to 12mA is going to be significant. IMHO its too close to the bleeding edge - if you choose a resistor to satisfy the constraints If>=10mA and Iout <12mA, you should be able to get it to work OK on the bench in a shirtsleeve environment, but you wont have any margin for LED ageing and low temperatures, and at high temperatures you are likely to draw excessive current from the EP8266 I/O pin, so reliability will be poor.

author: antonmi97
author_rank: Contributor
timestamp: April 06, 2019, 01:35:57 pm
content: Thank you for the advice guys, you made this much easier and faster for me. Appreciate it

author: Zero999
author_rank: Super Contributor
timestamp: April 06, 2019, 01:48:27 pm
content: Quote from: Ian.M on April 06, 2019, 11:01:04 amGood point, but the output voltage drop/resistance isn't specified, which makes that approach more difficult, as it would have to be derived experimentally.

author: Ian.M
author_rank: Super Contributor
timestamp: April 06, 2019, 02:02:26 pm
content: Yes. I didn't take the time to look for ESP8266 output characteristic curves, and am not particularly surprised to be informed there's no official data.If the emitter follower transistor has a min. hFEof 100, the worst case load on the pin will be less than 2% of its max current rating so one can be certain that the pin will swing rail-to-rail under load.Therefore, with the transistor, a simple analytic solution with appropriate tolerances will be sufficient.

author: antonmi97
author_rank: Contributor
timestamp: April 06, 2019, 03:18:26 pm
content: So the outtake of this would be to:1. Short the Base to the gpio pio and remove 10k resistor conecting the base and emitter.2. Not use the voltage divider and put in a resistor limiting the LED current to about 20-25 mA with the 3.3V - the transistors Vce voltage drop (0.8V with the one I have)3. Remove the diode and the bypass capThis means that I can use my boards. Yay!Anything else? Advice, suggestions?

author: Zero999
author_rank: Super Contributor
timestamp: April 06, 2019, 03:49:14 pm
content: Yes, you should be able to use your existing PCB by replacing R1 and R3 or R4 with jumpers and not fitting the other components. It should look like this.I hope you've allowed enough distance between the mains and DC side? If not, I suggest you just use these boards as a proof of concept and redo the PCB, paying more attention to the creapage and clearances: certainly if you're going to sell this.

author: antonmi97
author_rank: Contributor
timestamp: April 07, 2019, 04:36:37 pm
content: All my boards are proof of concepts for now. Once we test everything, a older colleague will revise the boards with us in order for them to pass all required testing and stuff. I'm still a young 21 yo college student

author: Doctorandus_P
author_rank: Super Contributor
timestamp: April 08, 2019, 01:37:28 pm
content: For experimenting with SSR's it is handy to use a low voltage transformer (12V or 24V) and a light bulb for the load of your SSR.This circumvents messin' with high voltages and you can experiment all you want on a breadboard.

author: antonmi97
author_rank: Contributor
timestamp: April 21, 2019, 09:28:57 pm
content: Quick update guys. Everything is fine with the board, with a sole exception that i misaligned the pins of the transistor on the schematic and the footprint, but luckily it's only a 90 degree rotation. I'll redo the board and hopefully get it right this time. Thank you for all the help <3