I have used the L298n driver chip in the past, it would almost certainly have enough current drive for your task and it has four outputs, each of which could be used to boost a seperate logic signal up to 24V. They can swing a signal high or low across a 24V range, are desgined to deal with inductive loads like motors and relays, can drive a fair bit of current and usually handle the level shifting problem for you. Personally in that case I would look at "motor drive" chips. Yes, 5V supply and 24V supply will be sharing a common ground. I have assumed that there might have a relay. it may be a relay or not but it sure that I have to provide a (0volt to 24volt) digital signal. Your use of the optoisolator is also rather pointless given that you have your 5V supply on both sides of the barrier.Īctually I am not sure what will be there. Your design will not work, the ULN2803 is a NPN array, so it's only suitable for low-side switching. If not then more complex designs may be justified. If you have free choice of how the relay coil is connected and your power supplies have a common ground then a simple low-side transistor switch as described in Olin's answer makes sense. Does the 5V supply to your Arduino share a common ground with the 24V supply to the relay?.Do you have free choice over what both sides of the relay coil are connected to? or does third party equipment connect one side of the relay to some form of common connection?.The big question here is what are your constraints? It's too bad there is not a compatible MOSFET array that was of comparable cost, but the existing parts are just too cheap and work well enough. Take care as to the current ratings if you are using multiple channels, particularly with the smaller surface mount packages- read the fine print and charts on the datasheets and not just the headline claims. The ULN2803 and the cheaper 7-output ULN2003A are probably the best way to switch or or a few small 24V relay(s), since they have good gain, are fairly robust and have the catch diodes built in. Or connect directly to the ULN2803 if you have good layout such as a ground plane and are sure the ULN2803 ground can't bounce more than a couple hundred mV below MCU ground. 1K) going directly into the ULN2803 and leave out the optoisolator. The optoisolator is not doing much since the grounds are common- it does prevent ground bounce from getting into the MCU if your layout is bad. Pin 9 is not shown on your schematic and must, of course, be grounded. The circuit in your schematic will work fine except that the relay coil should be connected to the output and to +24, not the output and GND. I'll therefore stick to my original answer. Again, it's a lot more trouble to explain why a bad circuit is bad than to show a good circuit. You are also trying to use it as a high side driver. The ULN drivers are darlingtons, which have unnecessarily high saturation voltage. Using a opto-isolator is silly, since you don't need isolation nor a unpredictable voltage shift. In any case, my answer above is still valid. I might have skipped this question entirely if I had seen it post-edit for the first time. That's easier to answer than having to first dispel myths. Your original question was better, because it simply asked how to do something. I see you have substantially changed your question while I was writing this answer. The diode gives the inductive kickback current a safe place to go while the current dies down on its own due to the resistance of the coil. Without the diode, that would require abusing the transistor. When anything tries to shut off the current through it abruptly, the inductor will make whatever voltage it takes to keep the current flowing in the short term. The relay coil has a significant inductive component. 13.5 mA is well below that, so no problem.ĭ1 is not optional, even though it looks like it doesn't do anything. This means it can support up to 20 mA collector current. To guarantee the transistor stays solidly in saturation, let's say we only ask it for a gain of 20. This means there will be 1 mA of base current when the left end of R1 is held at 5 V. You didn't say how much coil current the relay draws at 24 V, so I picked an example part I had in my system (Zettler AZ8-1CH-5DSE).įigure the B-E drop of Q1 is about 700 mV. The real problem is driving a 24 V relay from a 5 V digital signal. Converting to a "24 V signal" is missing the point.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |