Relay board adapter with accessories

I finally got around to make something I have wanted to make for a while…

Those cheap relay modules on ebay are cheap and easy to use, but not easy enough. For an Imp to control it, it still needs a transistor and a resistor too, it could be done on a protoboard, but I never really liked the finished result with those.

Instead I made this, which is a adapter between the Imp and the relay board… Or… It started out as just a simple adapter board, then I added the TMP36 because there was still free pins… Then a friend came along and said he needed something JUST like this, except he needed to pwm some 12V fans… So I added a mosfet… But he needed two separate channels, not just one, and this is where it started to get a bit tricky… Now I was suddenly running low on pins. I could have added a shift register, but I wanted to keep it simple, so instead I made a “mode” selector. This changes between 4 relay outputs and 1 mosfet output, or 3 relay outputs and 2 mosfet outputs.

When I was about to make the outputs I also noticed I had another problem, the power! I started designing it for a 5V supply, but as the fans are 12V and I still would like everything to be simple, I had to add a voltage regulator to bring the 12V down to 5V for the converter on the april board. And I just noticed I forgot everything about the capacitors for the regulator… But here it almost is! My first proper’ish thing for the Imp!

To connect it to the relay board you order some of those female headers with extended legs (used a lot for arduino shields). Put some spacers between the relay board and the adapter plate, put the header on the pins on the relay board, put the relay board and the adapter plate together so the spacers keep them apart, then solder the pins from the female headers on to the adapter plate.

Now I will spend a few days looking at this a few times to find the last mistakes, then send it off to the pcb house to get a hand full made. :slight_smile:

That rocks! I have a couple of half finished Imp breakouts myself. Would you mind sharing the eagle files?

I am going to put the eagle files on github after I have verified it all works as intended. But before that I am going to get some boards made and test them.

I forgot to mention which relay board it is intended for. It is this one http://www.ebay.co.uk/itm/271332309124

Nice work. I did a similar thing to link an April to the 2 relay version of the ebay board, using the MCP23008 i2c port expander.

The next step for me is to build a board for an IMP002 with integrated relays driven by a Darlington array. Really easy to integrate if you use one of those. Might even go for one of the Sharp SSRs too.

This is how the layout is going to be.

5V power supply to the left, relay board where the adapter is going to go on top with cutout for the screw terminals. The Imp is positioned so it will stick up over the adapter about where the copper on the april board also stops, to hopefully not disturb the antenna too much.

What’s the power rating of that psu? I’m using this:

http://uk.farnell.com/myrra/47152/power-supply-4-5w-5vdc-reg/dp/1825779

Nice compact unit which provides plenty of power.

The power supply I am going to use is rated for 2A@5V, the one you use is rated at 900mA max? I have not yet measured how many mA the relay board is drawing when holding the relays on, but the 7805 is settling at 65C when holding 3 of them, so I guess it is 500-600mA for 3 relays, maybe then around 800mA for all four. But I need to measure first to be sure.

Most relays I’ve come across are around 80ma at 5v, including the 2 relay version of the one you’ve got. What do you mean by 65C, temperature?

Yes, the 7805 gets up to 65 degrees C when 3 out of the 4 relays are active.

Can you get a multimeter measuring current on the 5v rail to that board? You should definitely only be looking at 80ma per relay.

I’m using the MCP23008 i2c to GPIO port expander to drive my relay board. Advantage is that it can supply the 20ma required per pin, so no transistors or resistors, code posted here on the forums for the MCP230xx modules works well. Just need the MCP23008 DIL chip and two pull up resistor for SDA/SCL and you’re good to go,

Check your current though, I think you’ll find it lower than you’ve been predicting.

EDIT: sorry, looks like you’ll be trying to power the fans too from this psu, which I didn’t take into account. Personally, I wouldn’t use a linear reg for 12v to 5v as too much power will be burned up in the middle, especially if you’re driving 5v relays at 80ma a pop. A switched reg may be better. I tried designing one for another project, but just settled for a cheap adjustable output one from ebay. A lot easier, cheaper, and less power draw than a linear reg.

I could, if I did not forget to turn it off last time I used it… Need to get a new battery for it, then I can check… I did consider using that expander too, but decided not to to keep code simpler. It is not only me who will use this, and others might not find it easy to work with.

I finally got around to measure the current usage with my new multimeter… with all 4 relays on it reads about 250mA, thermocouple on the 7805 says 82c after 10 minutes, still slowly going up

Picture only shows how I measure the temperature, took it before the temperature stopped going up.

Getting closer to a finished result…

Changed to 12V relays, so the conversion from 12 to 5 isnt needed for the relays any longer, only the two step conversion I have decided on from 12V to 3V3. What is still left is the 12 to 5V, which I am going to make the footpath for now. :slight_smile:

And it is done, mostly… I might still do a bit work on the silk screen.