Asked
— Edited
Alright. My dewy build is almost finished, but I have hit a problem with the relays I'm using. They require at least 1.5v to activate them, and then nothing to deactivate them.
Using a set digital control, I can turn them on, but turning the control off doesn't deactivate the relays.
Why would this be? Does setting the digital port off not set the voltage low?
How else can I activate them and deactivate them with the ez-b if not in this manor?
Here is a schematic,
I assume 2TY is a transistor.
Someone please help how to use this circuit.
Diode polarity may be drawn wrong.
Sweet, thanks for that @Andy it gives me a bit more to go on. As I suspected earlier on, the 2T transistor is a PNP (looked it up via it's SMD code). This makes more sense now, in order to activate a PNP transistor you have to bring your signal low.
One thing to remember about PNP transistors is that voltage relationships matter. If you are supplying 5V at the VCC pin and switching the transistor base with 3.3V logic the 1.7V difference might appear as a logic low to the PNP and it will turn on.
You'll likely have to use 3.3V on the VCC pin, that being said, I hope 3.3V is enough to turn these PNP transistors off.
What I also suspect is happening is that there is a 1Kohm (102) resistor + the 330ohm resistor on the ez-b itself in series with the digital pin which is limiting the amount of current that can be "sunk" by the ez-b digital pin. This is likely why the LED is stuck half on. What I would suggest is adding a solder blob across the 102 resistor that attaches to the IN pin in order to create a 0 ohm resistor instead of 1Kohm.
No matter how you look at it, if you want to use the control circuitry on this board you will have to use inverted logic due to the PNP transistor. 0V turns it on, 3.3V turns it off. But remember with a bit of soldering skills you can bypass the on-board control circuitry, solder directly onto the relay coil pins, and use your own circuit to control the relay (I'd suggest a NPN transistor...much easier)
Please note: I believe there's a couple minor errors with the schematic above. The LEDs should be flipped as the cathode should be toward GND and the Flyback diode should be probably be across (parallel with) the relay coil, not in series with it.
Thanks for the explanation.. At last I may get it to work.
My electronic skills are minimal and diode polarity escapes me. Anyway it seems I got it close enough for you to figure it out.
Thanks again,
@Andy,
What is the relay part number ?
I am sorry to say they were an ebay deal I got quite a while ago so I have no information. Here is a picture.
They are low level logic. (signal Off = relay on, Signal On = relay off)
I would try to find a High logic one. (needs npn transistor) per Jeremie
I think we are complicating what is simple.
the relay is rated to work with 5V, there are other relays from the same family (Songle) one of them is rated to run at 3V (but is not what is in the pcb)
The circuit expects VCC=5V has a PNP transistor, this means when Vb is less than Ve the transistor closes.
EZB Pin Low => 0, Vb is less than Ve the transistors closes => relay on
EZB Pin High => 3.3v Vb is still less than Ve and the transistor closes => relay on
if you put 5V on IN, Vb is not less than Ve and the transistor is open => relay is off
we have a Logic Level issue, how to convert 3.3v to 5V.
Without complicating too much there are LLV circuits less than $1 why not use one ?
I wrote this on the beginning of the thread, no one supported my opinion is it wrong or not adequate ?
I use the KISS principle why complicate, changes and soldering new components ?
Hi @ptp, like many others here, have a limited knowledge of electronics so we are learning as we go. I didn't understand what goes on or how the relay circuit worked. Now I have a better idea. You, Jeremie and others have helped greatly.
If I understand, I just need to buy one of those 3.3vdc to 5vdc converters? I think they also work the other way too? (5v to 3.3v) They cost about $3 and have like 4 or 6 outputs. Right? This would be an easy fix. Thanks for the explanation and all the help you have given. . I will get a converter and give it a try. I will keep trying things and learn.
Ron
@Andy,
It was a question too,
i'm not an expert neither i feel 100% confident, so that is why i asked the question.
i was waiting for Jeremie's or anyone to argue against a LLV, otherwise it seems too me the cleanest solution.
I like more software than hardware and i'm not good hacking circuits i have lost a few circuits, so i look to hardware like lego pieces, integrate circuits versus changing.