relay switch
Hi all,
I have a 3v relay trying to use it with a pin.
The pin cannot turn the coil on. Moreover if I do it manually, connect the Vin to Gnd the system rebouts and loses all the values.
I am thinking of using a 3.3 voltage regulator before the coil so that the voltage is the required.
Is there any other way in controlling the Vin using a pin? I have tried connecting the Vin with the Signal and from the other side the Gnd or the other way around still nothing.
The command is a simple high(pin number).
Any ideas would be appreciated!
I have a 3v relay trying to use it with a pin.
The pin cannot turn the coil on. Moreover if I do it manually, connect the Vin to Gnd the system rebouts and loses all the values.
I am thinking of using a 3.3 voltage regulator before the coil so that the voltage is the required.
Is there any other way in controlling the Vin using a pin? I have tried connecting the Vin with the Signal and from the other side the Gnd or the other way around still nothing.
The command is a simple high(pin number).
Any ideas would be appreciated!
Comments
Given you have a 3VDC relay coil, what amount of current does it require? You may be beyond the capactity of the Propeller i/o. And how exactly are you protecting the Proppler i/o from a spike caused by the collapse of the magnetic field when the coil is turned off?
Trying to wire a relay coil directly -- even a 3 VDC relay coil; creates a lot of hazards and technical problems that may be avoided by a more sophisticated approach to driving relays.
I guess you are having the Propeller provide the ground side of the relay. To make this work, more details might be helpful -- but what you really should be doing with any relay coil is providing some degree of protection and some degree of isolation from the i/o pins.
The usual solution is to provide a transistor that drives the relay coil, like a 2N2222. And a diode that traps the fly-back voltage when the coil is turned off. Wanting to eliminate these components creates more risks and more problems.
The problems you are mentioning seem to indicate that these factors are not being considered. You are at risk for damaging individual Propeller i/o pins -- which can be avoided by a more conservative scheme.
Has anyone got a C code test and how to connect it? I read the manual yet the code is not working for the propeller and all it does is to charge with rc_time until it hits the max.
this is what I read: https://www.parallax.com/sites/default/files/downloads/27920-Humidity-Sensor-Documention-S1101-v1.0.pdf
I just want to control the coil which in turn will open the voltage for a a heating resistor. I cannot understnd why it doesnt open the coil. Prop is suppose to have a 3.3v. Anyway.
this is the site with all the information: http://grobotronics.com/relay-5v-dpdt-5a-250vac.html
V/R = I Ohm's Law
3.3/17 = 0.194 amps or 194 milliamps.
Or the specs say a coil current of 176.5 milliamps. (3.0./17 = 176.5)
Either way, you are not getting enough current.
The Propeller i/o will only provide 30 milliamps at best, and a greater load may cause damage.
At this point, you may have to set up a multimeter or an LED with a resistor and verify that you haven't burned out individual i/o pins. If you have dead i/o pins, nothing is going to revive them. And you will have to work around them to have any project work.
https://www.kiwimill.com/model-making-how-to-transistor-driven-relay-switch/
You may have already blown 1-4 pin on the Propellor, which could be the problem with reading the Humidity Sensor.
There are a few reed relays that can be driven directly from a Propeller I/O pin, but their contacts are only rated for maybe 250mA. They're good for switching audio or video signals, not a heater
The relay you mentioned requires 175mA to switch on. A Propeller I/O pin can supply maybe 20-30mA and there are limits on how much total current can be supplied by a group of I/O pins and by the chip as a whole.
Reed relays might work, but they are famous for bouncing.
Even when you have contacts rated at 5amps, there are all sorts of loads that will derate the contacts by as much as 60 percent. So I just use 12 amp relays for all and everything in general. With motors, the relays can require a 30 or 60 amp rating.
These tiny relays are tricky and much easier to damage.
All pins work fine.
If I use 12v relays that have 30ma for the coil, how am I suppose to make them work since the prop can give only 3.3v?
Or is this irrelevant?
Nevertheless I did manage to control the relay through a leftover h bridge. Dont know if this is good or bad, yet it does its job and that is fine. Would like though to learn more about relays. IS there any chance the h bridge to be damaged?
HOWEVER, it may be that if you are using a relay in the mistaken belief that this is the best way of handling a motor or solenoid etc. If however that load is not high voltage then mostly you are better off using a MOSFET which can be driven directly by the processor and so handle many many amps.
I am happy to hear that you did not damage anything. Yes, half an H-bridge can control one relay coil nicely and may include fly-back protection.
I'll try to clear up why I prefer 12VDC relays to the 3.0VDC relays.
A. First off, the power to pull in the contacts is about the same.
So Power = Volts x Amps
For 3.0, you have 3.0 x .1765 = 0.526 watts
For 12.0, you might have 12 x .050 = 0.600 watts.
(I doubt you are going to get a 12 volt coil that is 30 ma.)
B. The advantages with higher voltage are simply that smaller wires can carry similar amounts of power and that voltage drops by transistors, darlingtons, or MOSfets that reduce power by less of a fraction of the whole.
I try to drive motors at 12 or 24 volts to take advantage of the smaller wires, so the 12 or 24 volts is also available for relay coils.
MOSfets have been mentioned and they are very, very handy. They have low voltage drops and often built-in fly back diodes that will eliminate coil fly back. Their big draw back is that most of the good ones are surface mount packages, which make them useless to beginners that are breadboarding circuits.
Using a transistor has a bigger voltage drop. For the usual switch, it is about 0.7 volts. So at 3.3 VDC, the voltage that it will provide to the coil is really about 2.6V; but at 12VDC, the voltage that arrives at the coil is 11.3VDC. Much less power loss. Of course, you still have add in a fly-back diode to eliminate noise and protect the transistor, but the project can be breadboarded.
The main point here is that microcontrollers never were intended to provide power directly to coils, motors, or heavy loads. If you desire to control those loads, something has to go between the microcontroller's i/o and the load that provides the required power and the eliminates the hazard of damaging the microcontroller. Internally, the wires of a microcontroller are extremely small, like whiskers of gold wire. Don't expect them to be your power supply.
Sure the Propeller is supposed to deliver 30 ma to one i/o pin. But the device as a whole is unable to deliver more than something like 300 ma to all i/o pins without risk of failure. So if you really want to use the Propeller well, that 300 ma budget has to be spread over all the i/o pins and works out to less that 10 ma available per pin.
The Propeller provides control signals. Power has to come from elsewhere.
Most of the time, when each and every pin is in use, it's a sign that you need to use some kind of I/O expander to free up some of the I/O pins or maybe offload some of the peripheral management to another device. Two Propellers may simplify your design or a Propeller and some other microcontroller.
I would never consider such a thing, I make sure whatever I connect to the microcontroller is compatable, and stays well below the hosts spec's, even though the chip's spec's are below what the chip can handle. Thats good design, Isn't it?
We have a lot of people that latch on to that one fact -- an i/o pin may deliver as much as 30ma at 3.3VDC and don't grasp that you can't have all 32 available GPIO pins driving 30ma at the same time without damage.
Something similar occurs with using voltage regulators. People try to get a full 1 amp out of a 3.3 volt regulator, but want to provide a 12VDC or 18VDC input and no heat sink.... after all, the PDF says that the device can accept 18VDC.
Power requirements and heat disappation get ignored by novices. The way specs are written are to indicate failure limits, but good practical use.
NQT, an I/O can deliver 3.3V *or* >30ma, but not both. Imagine the CMOS transistors as resistors with a value of around 40 ohms or so. Without a load you will get 3.3V and if you short the output you will get as much current as the structure will pass, but no voltage! So light loading will introduce some drop in the signal voltage but when we are driving LEDs etc we aren't too worried about the output voltage unless of course we are trying to drive some other logic. Total chip current includes the chip itself, that is the current the processor uses in addition to any I/O current. But those ABSOLUTE MAXIMUMs are NEVER to be taken as operating conditions as they often seem to be referred to.
When driving a relay or other high-current device directly from a micro, it's also worth noting that in most cases an output pin can sink more current (at considerably less resistance) than it can source. So connect your relay/device from the pin to B+, not ground.
Documentation states the board can be used with 3.3v signals, could it be the pin current limiting resistors included on the QSB causing the problem, the 3.3v rail measures Ok.
BTW. You should have started a new thread for this question.
Pins 6&7 are connected to the relay board, and signals were checked moving the pins to 22&23, QS LED's.
I didn't want to look too dumbfounded, just thought I could sneak a quick question in.
BTW: relays actuate connecting the signal lines to the QS 3.3v bus.
• P0 through P7 — General purpose input/output pins. Also connected to the resistive touch
buttons. When not in use, the buttons will not load the I/O pins, when touched, they will add
negligible resistive loading.
• P8 through P15 — General purpose input/output pins.
P.S.: this project will eventually will be moved to the Propeller Mini, so pin assignments were not a consideration yet.
Good deal!
Carry on.