Control 5V relay from mbed LPC1768

Share unrelated electronics stuff, ideas, rants, etc!
Post Reply
kayden
Posts: 1
Joined: Mon Feb 27, 2017 3:21 am

Control 5V relay from mbed LPC1768

Post by kayden » Mon Feb 27, 2017 7:05 am

I want to connect up a relay module (wired up to control a normal desk lamp) to an mbed LPC1768 board. I have the circuit connected up successfully using an Arduino via the Arduino's 5V pin. From the control perspective, all I am doing is turning on/off the lamp; I have no problem from the code side, just the electronics!
Mains voltage-->relay module-->lamp
^--mbed
From what I have read, the mbed's Vout is 3.3V. Some of the other pins are 5V tolerant, but looking at this datasheet, it seems to say that the pin has the same tolerance as Vdd(3v3), which has a max voltage of 3.6V.

The other option I have seen is using the VU pin. As far as I can tell, it is a 5V Out pin as long as the board is connected up via the USB cable. If so, then that makes life a lot easier. I have read mixed accounts of whether it is Out or In, but most people seem to be using it to power 5V peripherals, so I assume I can do that then. I couldn't find confirmation of this in the documentation, though, so if anyone knows more about this I would be grateful.

Fail this, then I would appreciate any suggestions on the best way to boost the voltage to run the relay. I imagine I will need a MOSFET or similar, but I know very little about how to wire them up. I saw this, but it blew my mind a little...

I am also not sure on the current requirements, but as it runs from the Arduino without a problem then I don't think it is too much to imagine that it would also run from the mbed. Feel free to berate me for assuming anything if incorrect!

User avatar
Artcfox
Posts: 944
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Control 5V relay from mbed LPC1768

Post by Artcfox » Mon Feb 27, 2017 4:03 pm

I'm still enough of a newbie that personally (and for safety's sake) I would not feel comfortable to recommend to another person any circuit that is using mains voltage, because one small mistake (or a mislabeled eBay component that says it can handle X Amps, but really can only safely handle less), might end badly, and I would not want to be responsible for even indirectly causing that to happen due to my inexperience.

Would something like the Power Switch Tail II work for what you are doing? That is UL listed, and opto-isolated from the control circuit (so no chance of mains voltage finding its way back into your circuit if something goes wrong) and it should be able to be controlled from 3 or 5 volts no problem.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests