United Kingdom
Asked — Edited
Resolved Resolved by rb550f!

5V Relay Not Responding As It Should

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...


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.

User-inserted image


ARC Pro

Upgrade to ARC Pro

Stay at the forefront of robot programming innovation with ARC Pro, ensuring your robot is always equipped with the latest advancements.

#17  

@Richard R

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

#18  

@steve... RE: what Alan said... just as a stretch try sending the relay set(D0,ON) and then send the same set(D0,ON) again and see if it clicks off... You never know...

United Kingdom
#19  

Right thanks guys. I'm getting it now. As @rb550 said, the signal pin need to produce 5v, not 3.3. I'll have a look at your suggestion Richard. Thanks again everyone. Not just this issue (just the cherry on the horrible tasting cake), but I'm REALLY having one of those days where nothing goes right.

Thanks again.

United Kingdom
#20  

@Richard.

Worth a try I guess with nothing to lose.

#21  

@Steve.... We've all been there... It's frustrating trying to get something to work that shouldn't be that hard in the first place.... been there, done that... Relax, have a beer and know that tomorrow will be a way better day...

United Kingdom
#22  

@Richard.

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. :P

#23  

Ahh man, that has been a crappy day. Sorry about that dude... Andrew, better make it two Buds for Steve.... :)

United Kingdom
#24  

@Richard.

Now you're talking.:D

Jokes aside, thanks for the kind words. I've just ordered two of the relays you linked to, so it should be all good.