multiple relays with 08m

mango matto

New Member
I am looking for a bit of help designing a layout for a 08m that can operate four relays. I built the single relay project and that was relatively simple but I am not sure how I would add more relays to it. I found a thread from a couple years ago but it involved a larger controller. Any help will be appreciated.
Thanks Mango Matto
 

g6ejd

Senior Member
You may wish to consider the use of a 3-to-8 or 4-to-16 line decoder using 3 lines of your PIC to then drive On/Off 8-lines and if needs be coupling those to even more. A dvice such as the MM74HC138 will give you the idea. The output of these logic decoders can be used to switch a Transistor that then controls a relay. This is a common solution to your problem.
 

mango matto

New Member
As a starter, read
Manual 1 p.27 and
Manual 3 p.8

Then you could use outputs

0, 1, 2 and 4

e
That is how I built the single relay that I am using now. Should I build that circuit three more times and run a 0v and 5v to each of them from one power supply or am I going to need separate power supplies for each one. I would like to be able to program an all on function. Providing power is my main concern.
Thanks Mango Matto
 

dmaxben

Member
The 08m can already control 4 relays (4 outputs)... Either use 4 BCX38c darlington transistors, or you can use something like a ULN2003 darlington array. If you are using the BCX38c's, make sure you use a flyback diode across the relay coil terminals, and a ~1k currrent limiting resistor in series with the PICAXE output leg and the base leg of the transistor.

If you need a 5th output and dont want to move up to a bigger 14 pin PICAXE 14m2, there is a trick you can do with a PICAXE 08m2 to use pin c.3 (listed on the datasheet as an input-only) as an output, utilizing the "pullup" command to produce a weak signal that can then trigger a MOSFET or transistor. Someone outlined this trick procedure a while back, ill see if I can find the thread. Obviously you'll have to buy an 08m2 though; the old 08m's dont support the "pullup" command...

Ben
 

dmaxben

Member
That is how I built the single relay that I am using now. Should I build that circuit three more times and run a 0v and 5v to each of them from one power supply or am I going to need separate power supplies for each one. I would like to be able to program an all on function. Providing power is my main concern.
Thanks Mango Matto
you can build the circuit three more times, or use a ULN2003 darlington array to save space and simplify the circuit. Run them all on the same power supply/common ground, as far as I know
 

Reloadron

Senior Member
You may wish to consider the use of a 3-to-8 or 4-to-16 line decoder using 3 lines of your PIC to then drive On/Off 8-lines and if needs be coupling those to even more. A dvice such as the MM74HC138 will give you the idea. The output of these logic decoders can be used to switch a Transistor that then controls a relay. This is a common solution to your problem.
That is how I would do it. Using only three PIC outputs you get 8 lines using the MM74HC138 3-to-8 Line Decoder and if you wanted to drive relays with higher current or voltage coils you could simply add a ULN2003 simple to use darlington array.

Ron
 

eclectic

Moderator
Re. the output expander.

Rather than adding an extra 18 pin chip, wouldn't it be much easier
to simply use a larger Picaxe?

Adding the ULN2003 will obviously be required to save space and components
instead of single transistors / resistors / diodes

I think we're now waiting for mm to supply more details of his requirements.

e
 

mango matto

New Member
I think the overall economy of the ULN2003 is the way to go on this. Do you have any suggestions where I can find a schematic similar to what I am building. It seems like all I will need is the 08m a few diodes and the ULN2003. Can I eliminate my relays with the ULN2003? I will not be running any current through the relays I just want to open and close wires creating continuity. Thanks for all your help.
 

eclectic

Moderator
I think the overall economy of the ULN2003 is the way to go on this. Do you have any suggestions where I can find a schematic similar to what I am building. It seems like all I will need is the 08m a few diodes and the ULN2003. Can I eliminate my relays with the ULN2003? I will not be running any current through the relays I just want to open and close wires creating continuity. Thanks for all your help.
Big picture please.

What are you building?

The more information you supply,
then the better the replies.

And, you don't need diodes with the ULN2003.
They are already inside the chip. :)

e
 

mango matto

New Member
Big picture please.

What are you building?

The more information you supply,
then the better the replies.

And, you don't need diodes with the ULN2003.
They are already inside the chip. :)

e
I run low voltage wiring in homes I had a project where all my labeled wires were cut short by the painters. I had to trace almost five miles of wire to relabel them. I want to build a tool that will help me to trace multiple wires at a time. That particular house was 16 thousand square feet. There were about 500 terminations. The theory is that each relay will produce a different open/close pulse. eg. relay one will close for 1/4 second then open for 2 seconds, relay 2 will close for 1/4 second open 1/4 second close 1/4 second then open for 2 seconds relay 3 will do the same but with three revolutions then a 2 second pause,and so on. Each relay will have a set of alligator clips that I will clip to one pair of each wire that I am trying to trace.on the other end of the wire I will put a continuity tester that has an led that emits when it detects continuity on a wire. The other end of the wire will pulse the led corresponding to the relay that it is connected to. If I have 5 wires that are 2 conductors I connect a set of alligator clips to each pair, then I can go to where all the wires are home run and label each wire without going back and forth five times. I hope this makes sense I am trying to save time by building a circuit that will do all the walking for me.
Thanks
 

westaust55

Moderator
Your chances of there being a ready schematic or board layout for an 08M based 4 relay board is rather slim.
If expanding the concept from one relay to four is difficult for you then maybe you could contemplate a ready made board.

An option is to do a Google search for something like "4 Relay board microcontroller" and see what is available out there.
Here is just one example: http://www.aliexpress.com/product-fm/515329364-4-Channel-relay-expansion-board-5V-relay-module-Microcontroller-development-YW04-Free-shipping-wholesalers.html

Or have a look at the schematic from this Sparkfun board as the basis: http://www.sparkfun.com/products/20

Maybe even:
http://www.pimpmyprop.com/RB4RelayBoardDetails.htm
or
http://www.futurlec.com/Relay_4.shtml
 

mango matto

New Member
I'm more interested in learning how to make one, I assumed there were ready made products out there since I am in the home automation business. I like electronics and really like to learn about how they function. It would be nice to go to school to learn all this stuff but those options are very limited, so I learn a bit here and there by hanging around forums like these, and from people that are willing to share their experiences and knowledge.
Thank you,
Mango Matto
 

premelec

Senior Member
Hi mm - I'm not clear why you need relays - the problem you describe is all too common... and might be solved with a series of tones on the wires... to use your 4 circuit example you could have 4 pins that put out 1, 2 , 3 or four 'dits' [I happen to be a telegraph operator so I know how to code dits and dahs to spell stuff and have built PICAXE thermometers which send Morse temperature readings] . You can also vary the pitch of the tones the PICAXE puts out and trace with pitch variation. A simple salvaged telephone earpiece can 'listen' on the wires for tones. I'm mentioning this possibility as you indicate an interest in learning various methods - not to say relays aren't the way to go... You could also put various DC voltages on the lines either automatically or static for the test and then use a multimeter to read the voltages and discern what is what... whatever works!
 

SAborn

Senior Member
I understand you wanting to build a circuit for this application and as much as i like picaxe, i would take a different approach to solving the problem of wire tracing.

I would use one of these wireless controllers.
http://www.ebay.com.au/itm/12-Channel-Radio-RF-Wireless-Remote-Control-Kit-Toggle-/310379952994?pt=UK_Burglar_Alarms&hash=item4844163b62

You can get them with different number of channels (relays) to suit your needs, a few aligator clips and a test led to locate the active wire and you are set.

If you hunt around you find better prices then the one i listed, but that was the first one i found which showed the relays in the photo, also ensure the unit have the "toggle" mode as some dont. (toggle... press button 1 to switch relay 1 on, press button 1 to switch relay 1 off)
 

srnet

Senior Member
I have one of the wire tracers, the type used by BT engineers to trace pairs of wires in the large cables. Works over a few kM, and has a proximetry function, the receiver just has to be close to the wire.

This would be certainly be worth a try as its so simple;

Use a PICAXE to send an audio tone down the wire (with a series resistor of course) then a simple crystal earpiece touched on the wire at the other end.
 

hippy

Ex-Staff (retired)
A PICAXE driving the wires direct rather than through relays would probably be better, plus easier and cheaper. All it needs is a PICAXE, a bi-colour LED+R and a mode switch.

Mark the LED's green cathode with an "X" on a label, the anode "1".

Mode 1 - Setup. Wire 1 at PICAXE end connects to 0V, other wires to any pins, all pins high. Connect the LED "X" to any wire. Connect the LED "1" to other wires until it lights. If red, swap the LED connections around. You now have "1" indicating wire 1.

Mode 2 - Discovery. Pins pulse a number of times depending on pin. Connect "X" of the LED to any wire and the number of flashes indicates the wire number.
 

premelec

Senior Member
Just a quick note to clarify what I last suggested: assuming you are tracing pairs - take a DC regulated power supply and connect ONE side of each pair to V- then have a string of series resistors to V+ and connect each junction in the string and V+ to the other side of each pair. Now each pair will show a voltage from V- to V+ that is different - and you check this at the far end with a multimeter. A reasonable set up would be 10VDC and 1000 ohm resistors with 10 voltage values available. Happy tracing... :)
 
Top