|
Forum Index : Microcontroller and PC projects : Open Collector Option
| Author | Message | ||||
| Tinine Guru Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
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 KingdomPosts: 10580 |
Use a 5V tolerant pin |
||||
| Tinine Guru Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
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 KingdomPosts: 10580 |
Just add a transistor to convert a non 5V pin |
||||
| CaptainBoing Guru Joined: 07/09/2016 Location: United KingdomPosts: 2171 |
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 KingdomPosts: 1646 |
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 KingdomPosts: 2171 |
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 KingdomPosts: 1646 |
Ah, they're not current limiters, they are pull—ups. |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2466 |
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 KingdomPosts: 2171 |
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 KingdomPosts: 1646 |
Think I'll go with the ULN2803. Transistor is so 1970's |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |