Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 15:21 14 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Open Collector Option

Author Message
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 03:44pm 21 Aug 2020
Copy link to clipboard 
Print this post

I have an Opto-22 type, solid-state relay-rack.
The rack is fed with 5v and to switch on the relay, the -ve needs to sink.

Does this mean that I can use any output if I use the OC option or is this still a 5v tolerant pin-only option?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10580
Posted: 05:06pm 21 Aug 2020
Copy link to clipboard 
Print this post

  Quote  Does this mean that I can use any output if I use the OC option or is this still a 5v tolerant pin-only option?


Use a 5V tolerant pin
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 05:12pm 21 Aug 2020
Copy link to clipboard 
Print this post

Dammit....I need more

Coulda swore I read that it was fine, due to the fact that it was going from high impedance to GND  
Edited 2020-08-22 03:15 by Tinine
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10580
Posted: 05:14pm 21 Aug 2020
Copy link to clipboard 
Print this post

Just add a transistor to convert a non 5V pin
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2171
Posted: 05:38pm 21 Aug 2020
Copy link to clipboard 
Print this post

it is sketchy but if you have the load between the 5V and the pin AND the load drops enough of the voltage then you should be OK on any pin.

It is best to use match the pin to the voltage, failing that, drive it with a small transistor or if you are feeling brave, measure the voltage drop of the internals of the SSR. e.g. if the internals (likely and LED) drops 3V then you'll only be chucking 2V into that pin. If it's 1.8V (IR/redLED) you will just about be in the clear if you are running the uM at 3.3V but it is close.

Personally wouldn't risk it and I'd use a small FET, 2N7000 or SI2300 (SMD) - pennies... Set the pin to use PULLDOWN and don't use OC. If you do, you can't drive the pin HI (on), only LO (off) and if you take the pin HI, the gate will float around all over the place. This is the danger Zone for FETs when used as load switches - probably not an issue driving an LED but it still won't work as you expect.

If you use a BJT as your load switch (BC107, BC541, ZTX300 etc...) then you'll need a resistor between the pin and the base that gives you enough gain to pull the load current... remember also you get about 0.6V across a tranny so you can't give the SSR the full 5V drop (4.4V) probabaly be fine... and still don't use OC obvs.
Edited 2020-08-22 04:02 by CaptainBoing
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 05:59pm 21 Aug 2020
Copy link to clipboard 
Print this post

  CaptainBoing said  it is sketchy but if you have the load between the 5V and the pin AND the load drops enough of the voltage then you should be OK on any pin.

Best to use a 5V tolerant one, failing thank drive it with a small transistor... failing than measure the voltage drop of the internals. e.g. if the internals (likely and LED) drops 3V then you'll only be chucking 2V into that pin.

Personally I'd use a small FET, 2N7000 or SI2300 (SMD) - cheap as chips... pennies... if you do then don't use OC on that pin


Yeah, gonna check the schematic but IIRC, the 5v runs through a led current-limit (opto coupler) and so the MCU just needs to bring that to ground.
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2171
Posted: 06:04pm 21 Aug 2020
Copy link to clipboard 
Print this post

in which case it might try to drift up to full 5V when off, and you would still have 5-3.3 (1.7V) across the SSR which might be enough to activate it.... with OC you could get damaging voltage, without, it would be clamped to 3.3V through the pin and you'd see some current flow. You could be in a situation where the thing is on uncontrollably.

Use a tranny to drive it and be certain.
Edited 2020-08-22 04:14 by CaptainBoing
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 07:58pm 21 Aug 2020
Copy link to clipboard 
Print this post

Ah, they're not current limiters, they are pull—ups.


 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2466
Posted: 01:31am 22 Aug 2020
Copy link to clipboard 
Print this post

  CaptainBoing said  If you use a BJT as your load switch (BC107, BC541, ZTX300 etc...) then you'll need a resistor between the pin and the base that gives you enough gain to pull the load current... remember also you get about 0.6V across a tranny so you can't give the SSR the full 5V drop (4.4V) probabaly be fine... and still don't use OC obvs.


not quite: while Vbe is approximately 0.6v or thereabouts for a silicon transistor, Vce can be close to zero when the transistor is fully saturated. for example a BC547 running with Ib=500uA and Ic=10mA gives a typical Vce(sat)=90mV.
https://www.mouser.com/datasheet/2/149/BC547-190204.pdf

IF you can't pull the base above the collector, you arrive at the 0.6v drop, but that isn't the case when the base is driven from an external source such as a pin on a micro.


cheers,
rob   :-)
Edited 2020-08-22 11:32 by robert.rozee
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2171
Posted: 06:45am 22 Aug 2020
Copy link to clipboard 
Print this post

yes Rob, you are quite right of course... was typing faster than the brain was running  

Thanks for the correction.
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 02:22pm 22 Aug 2020
Copy link to clipboard 
Print this post

Think I'll go with the ULN2803. Transistor is so 1970's  
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025