I intend to purchace a K8055 board, in order to drive a 12V DC motor.
The motor will be powered by a 12V automotive battery. When powered, the motor will consume up to 21A (approx 250 watts).
I will drive the motor thru a “H bridge” with 4 relays in order to be able to invert the rotation of the motor. The relays will be driven by 4 ouputs of the K8055.
I am not so keen at electronics. So I’m not sure about which type of relay I will have to use.
the relay specs say that it needs 0.93W coil power. An automotive battery has over 13V when fully charged and below 11V when discharged. Those are the open terminal voltages, under load it will be even less. To get 0.93W at 11V, you need 85mA which equals a load resistance of 130 Ohms (relay coil plus eventually some extra resistor in series to limit current). Those same 130 Ohms would however drain 100mA at 13V, which is 1.3W power. That is more than a single ULN2803 output can take. The ULN2803 has a power limit of 1W per output, 2.25W for the whole IC.
Unless I am misinterpreting the specs, you will need some PNP power transistors and protective diodes in between the K8055 and those relays.
I guess he still needs the bigger relays to switch the motor. And I am not sure the ones he linked to will do the job to begin with. Ben didn’t say if those 21A (250W) are the motor’s continuous power or the power-on surge.
Thank you for the feedback. Not sure it helps me so far, I have only very basic electricity knowledge
MostlyHarmless :
the spec says for coil operating : DC 3 to 110V / 0.93w. This is why I had in mind they can be operated directly by the battery power, even if low loaded. I understood also that the ULN2803 was not in contact with the battery and motor circuit, am I wrong ? If I am, of course I understand that I’m going in the wrong direction.
WrongWay :
The 21A current will be the peak power of the motor (is it what you call power on surge ?). Motor will move a roll-off roof, sliding on rails and wheels. Maybe 250W will be reached when starting movement, than I expect a much lower power. Moving will long 15 to 20 seconds max, then will stop. This is why I’m looking towards 40A relays for the motor side.
I saw the K8090 card. But I’m afraid the limitation of 16A will be a bit short, and could put the relays in danger ? Also, I need the K8055, because the end of the movement will be detected by position captors, so I need a card with inputs.
Maybe you can point me on drawings or schematics for what I want to do (should have started with this) :
1 PC with USB
1 motor DC 12v 250w max (one of these big wiper arms motor)
car battery for motor power and motor switching (to allow manual swithing and roof movement when general power is off)
if possible very simple (I’m lost when you talk about pnp transistors or diodes)
the spec says for coil operating : DC 3 to 110V / 0.93w. This is why I had in mind they can be operated directly by the battery power, even if low loaded. I understood also that the ULN2803 was not in contact with the battery and motor circuit, am I wrong ? If I am, of course I understand that I’m going in the wrong direction.[/quote]
That is all correct. The motor load will be handled by the relays and only the relay coils will be driven by the K8055. The way you described your plan to connect it all is fine and will work perfectly with a LEGO prototype using small relays.
The problem is the coil power of the high power relay, that you need, in connection with running it all from a car battery. Like all batteries, car batteries have a higher voltage when fully charged than they have when discharged. And they have an even lower voltage when under load. A normal lead acid battery has 12.6V fully charged, 10.7V when discharged and only 10.5V under load when discharged. You want to design your circuit so that it works at that full battery voltage range from 10.5V to 12.6V. With the coil needing 0.93W, the output port limited to 1W and that voltage range, the math just doesn’t work out. Sorry.
I also think that you should not rely on using the end point switches through K8055 inputs. There would be the possibility of a USB communication error or program error causing a failure to turn the motor off. My suggestion would be to have the end contacts be normally closed switches that connect one of the relay coils to the supply voltage. When the roof hits that end point, the switch opens and thereby disconnect the relay coil from power. No program in the world can override that! That puts the K8090 back on the table.
To explain what I meant with those transistors and diodes:
This is only one relay and I left out the motor, because it is irrelevant for the explanation and drawing all 4 relays would just add confusion.
First we have the K8055. The output ports of a K8055 are open collector outputs. That means that they have a very high resistance when the port is OFF and a very low resistance draining to ground when the port is ON.
On to the PNP transistor Q. What does that thing do? It acts like a mini relay. It allows current to flow from the emitter (connected to +12V) to the collector (connected to the relay coil) if the base connected to the two resistors R1 and R2 is 0V or “pulled low”. It is “ON” then. It does not allow that flow or is “OFF” when there is a certain voltage at the base.
How do we control that? With the two resistors and the K8055. Let us assume that resistor R2 has 10 times the resistance of R1. If the K8055-OUT port is off, nothing flows through R1 and R2 pulls the base of Q “high”. That turns Q “OFF”, so the relay coil gets no current. But when we turn the K8055 port “ON”, then most of what comes through R2 is going through R1 to ground. That pulls the base of Q “low”, which turns Q “ON” and now the coil gets current.
The last part of the puzzle is the diode D. A diode is like a one-way valve. It lets current easily flow in one direction, but not the other. This is a protective diode that is needed because we are switching a coil (called an inductive load). They are often called free wheeling diodes, clamping diodes … whatever. The point of that thing is to keep the transistor working more than once! A coil builds a magnetic field. What unfortunately happens when we turn the transistor off is that the collapsing magnetic field will induce electricity back into the coil. This results in a spike of possibly many hundreds of volts … with no way to go except to force their way through the “closed” transistor. Not good. With that clamping diode, this electricity is just short circuited back into the coil and the resistance of the coil itself will take care of it in a short period of time.
When ordered online the transistors should not cost more than $0.70 a piece, the diodes less than $0.20 and the resistors are a few pennies. The biggest item on that bill will be shipping and handling.
All that’s left is picking the right values for the transistor, the diode and the two resistors.
Many thanks for all these explanations and your time !
Only 2 questions more please :
you don’t use the “clamp” contact of the board is your scheme ? I thought that the K8055 outputs received their power from the battery thru GND and CLAMP ?
Maybe some hints ? I guess I will be able to add motor and other relays by myself, but the electric maths are not for me
Please note that the relay coil is not rated ‘3…110V’.
This spec means that the relay is available with a coil voltage ranging from 3 to 110V.
Make sure to specify 12VDC when you order one.
you don’t use the “clamp” contact of the board is your scheme ? I thought that the K8055 outputs received their power from the battery thru GND and CLAMP ?[/quote]
That’s a misunderstanding of how the ULN2803 darlington transistor network works. The “outputs” never provide any voltage at all. They only ever provide a path to GND, or a high resistance. You need to think of them more like a switch that must be installed between a device and ground. The ULN2803 also has a clamping diode for each output and they all go to the CLAMP contact. To use those clamping diodes, the external supply voltage must be connected to that CLAMP contact. It is the same protective diode, that I added to the circuit. That is why it is possible to connect a small relay directly to the K8055 without adding an external diode.
In this case, the ULN2803 is not switching an inductive load. It switches a transistor. There is no collapsing magnetic field when switching a transistor, so there is no EMF. It makes no difference if it is connected or not in this case.
[quote=“Ben_5763”]2)
Maybe some hints ? I guess I will be able to add motor and other relays by myself, but the electric maths are not for me :-([/quote]
That depends on what the final circuit will look like. We will get there.
For your application I think you don’t need the ability of motor braking by short circuiting the H-bridge upper or lower half. That’s not always a good idea anyways. A real short circuit can overheat the motor if that braking goes on long enough.
That means that it is possible to switch the two pairs of relays using one power transistor per pair. It also allows to build in some “mechanical” safety into the relay arrangement so that no matter what happens, both pairs can never be activated at the same time. Engaging all 4 relays at the same time would short circuit the battery. That short circuit would also cut the power to the relay coils, but then they immediately engage again for a full short circuit. That runs whatever current the battery can deliver (that would be a couple hundred cranking amps) through the relays, which causes excessive electric arcing in the relays, eventually welding the contacts together. The end result may be either some burning cables, relays or an exploding lead-acid battery.
[quote=“VEL417”]Please note that the relay coil is not rated ‘3…110V’.
This spec means that the relay is available with a coil voltage ranging from 3 to 110V.
Make sure to specify 12VDC when you order one.[/quote]
Very good point, thank you.
Also, before ordering make sure that the 12VDC version actually is suitable for the voltage range needed. I’m not so worried about the 12.6V of a full battery. As soon as the motor kicks in, the voltage will drop. But if the relay for example cannot stay closed at 11V, then it will get very annoying. As soon as the voltage of the battery drops to 11.2V or so, the relay will close, the motors load will cause the voltage to drop below 11V, the relay opens, the voltage goes back to 11.2V … over and over making a lot of noise without much roof motion going on.
All right, here is my suggestion (Version 0.1). I think it incorporates all that Ben wanted as well as all that I think is necessary to take it to minimum safety levels.
I’d like to hear what other forum members think about it. Any critique is welcome.
I know that the TIP42 power transistor is total overkill for this application. But that is what I found in my “parts” box to build a prototype with, so that’s what I used in version 0.1. Then again, the thing costs $0.42 at Mouser.com today, so who really cares?
The relay configuration is meant to prevent short circuit even if at some point the motor supply voltage would be separated from the relay coil and control circuit supply voltage. Note that the red highlighted parts of the right side show the high power paths.
A “bread board” prototype I built has basically the upper left quarter of the schematics. The relay coils for RLY1A and RLY1B are simulated by a 50 Ohms, wire wound resistor. That equals approximately the load of 3 of the relays in question.
The test setup is powered by a 12V 3A stabilized power supply. The DMM is measuring the current through the 50 Ohms resistor (that big white ceramic block at the top). 12V/50R is exactly 0.24A. I had a hard time believing it myself. That ceramic block has “10%” stamped on it! I expected anything between 0.22 and 0.26, but not 0.240 dead on.
The two red wires going straight up in the second photo are SW1, the end contact “switch” (hold wires together). With that this test setup is 100% complete. The K8055 controls the circuit via O1 and gets feedback on I1 about the SW1 status. Closing SW1 disables power to the resistor (relay coils) even if the K8055 does not turn off the output signal.