24 vdc

Hi Everyone,

I need to use a 24 V DC relay for connecting 24 V DC to a digital signal.
Is it possible by April development board?!

Please advise with what could have happened.
Thanks.

You’d generally use a low voltage relay to switch the 24VDC signal.

eg this would do: http://www.amazon.com/JBtek-Channel-Module-Arduino-Raspberry/dp/B00KTEN3TM

You would need to connect the VCC to 5v (as they are 5v relays) but the IN1/2/3/4 relay control signals can go direct to the april pins. Reviews say that this works with the raspberry pi, which, like the imp, is also 3.3v.

That 4 channel relay module is a great choice. Notice it has optic isolators so the 24V will never get to the April board.

Here’s a single one with free shipping:
http://www.ebay.com/itm/3V-Relay-High-Level-Driver-Module-optocouple-Relay-Module-for-Arduino-Raspberry-/121855529059

I find those isolators a bit strange because, well, a relay is isolating too :slight_smile:

Generally I’d prefer to use a 5v relay (vs a 3v one) because the 3v one means you’re running the relay current direct from the 3.3v supply that’s also supplying the imp. This loads down the power supply unnecessarily when there’s a 5v source (USB input) right there. Should work either way though.

Thanks for comments,
I’ve attached a photo and it would be appreciated if you could have a look.
I want to use 24 v dc for relay coil and my circuit, so it couldn’t go back to imp, am I right?!

(I’m a newbie in electronics but here’s my 2c worth) It’s very unlikely that a relay can be driven directly from an IMP IO pin; if that’s the question. There are some solid state alternatives to relays that could be driven directly from the IO pin but even mosfets will probably need some extra jellybean components. There are solid-state relays that can be driven directly from an IMP IO pin but they are more expensive than mechanical relay but maybe it still worthwhile for convenience.

I have access just to 24 V DC!

If you want to isolate your imp from noisy higher voltage systems you could use an opto-isolator instead of a relay (need to read and check specs of course). This breakout might do the trick: https://www.sparkfun.com/products/9118

@nima your circuit is fine. The imp is only turning on the transistor so there’s no noise coupling there from the 24v. You don’t need R2/D1 to make it work, but obviously an LED is sometimes nice.

To pick your R1 value:

A typical 24v relay might be ~20mA coil current, plus a few for the diode. This would be used to set the R1 resistor: the current through R1, multiplied by the transistor Hfe (essentially amplification factor) should be the load current passing through the transistor (collector to emitter).

So, say we put a lot of margin in there and say we want 50mA, and we have a bad transistor with a low Hfe of 50, that means the current into the base of the transistor should be ~1mA.

When turned on the base to emitter junction is essentially a silicon diode, so that’s 0.6v drop. As the emitter is ground, that means the base will be 0.6v.

When on, the imp pin is 3.3v, so we’re dropping 3.3-0.6 = 2.7v through the resistor, and want 1mA to pass.

R=V/I=2.7/0.001=2.7k ohms.

Almost any NPN transistor is suitable for this. It’s not much current.