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?
It seems you already have a flyback diode on your relay board so no need to add another. It doesn't really look like a diode but it's an older style germanium.
I'm getting the sense that your relay has an issue, do you have anymore of these boards to test? Can you test something like a servo on the digital pin you are using just to make sure everything is in working order?
I take it back that the board has too many resistors. I didn't notice that second LED on there. So that's one resistor per LED and one for the transistor base.
There's two LEDs on the board, is one a power LED?
You mentioned that if you send a high signal from the ez-b to IN1 on the relay board the relay activates. (no resistors applied)
You also mentioned if you place a pull-down resistor (from IN1 to GND) the relay activates.
These two scenarios are in conflict with each other.
Are you certain that you have a common ground?
I am unsure what you mean by "triggering a port" but I will say this: The I/O pins on the ez-b are tri-state, which means that when they are not set to a digital high (3.3V) or digital Low (0V) they are in a high resistance state (High-Z). In a High-Z state the pin will appear to have 0V but in reality it is floating and has no state until a high or low signal is sent.
Yes, I agree, but it is what is happening. This makes me think that when the ez-b activates, the current flows through it to gnd.
Common ground is achieved by connecting the gnd pin of the ez-b to the gnd of the 5v power source for the relay. This allows, in my mind, common ground. Perhaps not?
In High Z state the relay is doing nothing.
When the port is set on(no resistor) it activates. When port is set off(no resistor) the relay hits the mid point, where it is half way to turning of, as indicated my the activation light dimming.
When port is set on(WITH resistor) it deactivates, and when turned off, it activates.
I too am puzzled by this conundrum. I will play with it again, and see if something changes.
This relay has a 2TY device, 3 resistors all marked 102, 2 leds and a diode. I am assuming the 2TY is a transistor. If anyone knows this is true, can they tell me the pinout ? I will then try to make a schematic of the one I have.
Maybe we then can get a better idea of what we are dealing with.
Thanks,
I assume 2TY is a transistor.
Someone please help how to use this circuit.
Diode polarity may be drawn wrong.
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.
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,
What is the relay part number ?
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
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.
1) EZB Pin Low => 0, Vb is less than Ve the transistors closes => relay on
2) EZB Pin High => 3.3v Vb is still less than Ve and the transistor closes => relay on
3) 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 ?
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
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.
1)
https://www.digikey.com/product-detail/en/texas-instruments/SN74HCT245N/296-1612-5-ND/277258
has 8 ports can convert 8 x 3.3v to 5v (unidirectional) but the cost can get more expensive with shipping costs ($4 to $9)
if you like "legos":
these is the cheapest i found in the ebay:
2)
http://www.ebay.com/itm/10PCS-IIC-I2C-Logic-Level-Converter-Bi-Directional-Module-5V-to-3-3V-For-Arduino-/151910206546
each circuit has 4 ports, they wrote i2c because most people use them to interface arduinos 5v with 3.3v i2c devices, but they are bidirectional they can convert the opposite way.
There is a high side & low side, you can use them also to convert to 1.8v (intel edison)
if you don't trust ebay vendors you can get this one from sparkfun:
3)
http://www.robotshop.com/en/logic-level-converter-bidirectional.html
also has 4 ports.
Thanks,