
So I've just been trying out a 5v relay (with 5v regulator) on port D0 but it's not working as expected. I first tried "Set(D0,on)" and it closed the relay switch. I then tried "Set(D0,off)" and it wouldn't open. I disconnect it from the EZ-B and it opens, plug it back in and it closes again but can't control it from then onwards. I even tried a combined script...Code:
Set(D0,on)
Sleep(2000)
Set(D0,off)
but no change. I'm I missing something here or is there something else I can try?
Thanks.
From what I am reading, there are different types. You could get one that does as you describe, and acts like a toggle, changing position each time signal is applied, or one that has two different signals, on and off, so you set one high momentarily to turn it on, and another high momentarily to turn it off.
@Steve G, Yes, that is one of the things this is meant to do, and should be working. I suspect the issue is that it expects a 5v signal and the EZ-B only provides a 3.3v signal, as @rb550f indicated. You may need a logic volt shifter (so your voltage regulator is dropping the VCC from 7.5 to 5, which is what the relay needs for VCC (power), and the shifter raises the 3.3v signal to 5v which is what it needs to trip relay position.
Alan
Thanks again.
Worth a try I guess with nothing to lose.
Yeah, a beer sounds like a great idea. Had a 4 hour back and forth argument with UPS earlier about what I thought was a simple issue that could be resolved, then my central heating boiler packed up, and numerous other things were sent to test me. So I thought robotics would be a nice stress free release... Wrong, lol. What was I thinking.
Andrew, make mine a Budwiser, and make it snappy.
Now you're talking.
Jokes aside, thanks for the kind words. I've just ordered two of the relays you linked to, so it should be all good.
Forgot to mention.. they are only rated at 2amps, but as I said I have ran more through them...
Thanks again for your input everyone.
Steve.
Quick and possibly silly question. The relay you linked to, how do you connect it? So far I have the G, V, S (three pin port on the relay) on port d0 via a 5v reg, and a separately powered LED with the break in one wire going through the Com and NC, but nothing's happening (except for a very faint LED that breifly flashes once when I run a "On, sleep, Off script").
G=ground
V= Red pin
S=signal pin
switching part....
com= common
NO= normally open
NC = Normally closed
simply set(D0,On) and set(D0,off) to operate... Plug and play dude...
Right. Reg was the problem. All good now. Cheers bud.
I found out what the problem was. The regulator I was using (not an EZ-Robot one, but a UBEC one) was labeled incorrectly. Output was input, and visa versa. It works now I have it back to front.
Thanks anyway. An unrelated question, can an ADC port be set to On and Off, and if so, how?
Perhaps you'll be fine without the reg... Like I said the relay wasn't complaining or getting hot when I was using 8V with them.... Besides, they are not all that expensive, so won't be a big deal to replace them should they fail before their MFT (mean failure time).... They are probably good for a few 100,000 relay cycles....
Thanks again.