Instructables

12VDC/220VAC relay module for Arduino (homemade)

MODUL RELEU SCHEMA.jpg
2013-01-07 08.41.14.jpg
2013-01-07 08.41.23.jpg
2013-01-07 08.41.35.jpg
2013-01-07 08.41.42.jpg
2013-01-07 08.41.53.jpg
Hi there! Few days ago I've made a small relay module for my Arduino. The problem was that I founded in my local electronic parts shop, relays controlled by 12V instead of 5V as it is required by Arduino. So I checked on internet for schematics and I managed to find a simple schematic that I've changed a bit. For my own comfort (I'm actually scared by high-voltages especially when I use a microcontroller) I added a diode before the resistor that commands the transistor to work like a fuse if a short-circuit is happening (I hope not). I know it might be a stupid or useless idea but it's ok for me. For further insulation I covered both sides of the board with hot glue to prevent accidental touching of the soldered side and also to keep the transistor and wires in place.. I want to use this module to control a lamp via IR remote and I'm also planning to build another module for my future garduino-like project. :) P.S.: The value of the resistor is wrong. I've tried combinations with some resistors and I forgot what's the value of the resistor I've soldered on the board. Also I used D2012 transistor because it was sitting without any use in my recycled parts box. You can use 2N2222 I guess ;) Cheers!

Later Edit: Aaaaaaaaand I made a test! It's another project and because of this project I've built the relay module. The module is connected to 220V, supplied by a 9V battery which I will change with a PSU because the relay will drain the battery fast. Arduino it's also supplied with another 9V battery. Arduino is receiving signals from the IR remote control, decoding and if the code of the pressed button is the same with the code set in the program, it will change the corresponding digital port to the HIGH state which means you can turn on the light :D PS: I'm sorry but I did this "review" in romanian language...
CatalinRO1 year ago
...and if you want more isolation, use an optocoupler to drive your relay :) (low voltage and high voltage side). I like that you put the paper with exaplanations on the bottom of the PCB, useful
Timofte Andrei (author)  CatalinRO1 year ago
I know I should use an optocoupler but I cannot find at my local electronic parts shop. Anyway for the moment this is good as it is and if you think about it I only paid for the protoboard, relay and those 3 blue terminals. That paper from the bottom is glued with double sided tape :P Next time I'm gonna print that to look a bit professional :D Thanks for your comment! Cheers!
Many PC power supplies contain optocouplers in them. There are two basic designs, one uses them, the other doesn't. The one that uses them is far more popular though so your odds of finding an optocoupler inside a PSU are pretty good. Look for a place where there is a chip over a slot in the board. If you see that you're looking at an optocoupler.

You could indeed draw your schematic much neater if you laid it out better. Try to line up what needs to be lined up etc. Simplify.
Timofte Andrei (author)  pfred21 year ago
Thanks for your idea! I actually have a spare computer PSU but it's slightly powerful then the PSU I currently use to test my projects and I don't really want to turn it into pieces because it can be useful in other future projects! I made some tests with this module and it's working pretty well! I use a 9V battery instead a 12V PSU to power the module but it's ok for now. When I'm gonna have the right parts I will build an Arduino clone with some relays on the same board.(I'm planning to build a greenhouse with some extra features :D ) Anyways thanks again for your comment! Cheers!
Keep your eyes open for scrap computer power supplies. Usually parts other than the optocoupler go bad in them, rendering them inoperable. The most likely culprits are often the filter capacitors. If you get one of those you can break it apart and not lose anything.
I really like more the hand writing paper style because it makes people think that they can create something as well with what they have around. If you want to print it to look more professional, that may scare people / beginners: OMG, I need to draw something on a computer, I need a printer, I need to scale it, I need... I need... too complicated for me, I'll give up. This is like a signature, a mark of the author on his creation.
Timofte Andrei (author)  CatalinRO1 year ago
I never thought about that before... and actually is a good point! But I don't think that a small piece of printed paper can stop you to make something useful. Any problem has a solution especially when you use your imagination! You don't have to be an engineer, a programmer or something else like that. I study engineering but faculty is too boring for me. I prefer to feel the smell of the fumes made by soldering gun instead of writing thousand of mathematical relations on a blackboard. I love the practical part of the project and less the theoretical part. ;)
Resistor can be 1K to 10K without any problems.
Timofte Andrei (author)  Lectric Wizard1 year ago
i think i've used a resistor between those 2 values.