PICAXE 2 wire controller?

tmack

Member
Hello, Im new to This forum and to picaxes in general. I want to build a controller that can control 12 relays or so using only 2 wires to connect the sender and reciever. I was wondering if it is possible to do this with a couple of PICAXES . I currently have the 8M and 18x types( have only done basic programs with them so far). I was thinking of using the pulsout on the "sender" controlled by various pins in and the pulsin on the reciever causing the pins to go high then through a transistor make the relays trip. Any thoughts? Thanks for any help.
 

MORA99

Senior Member
Do you want the 08M to control the 18X which is connected to 12relays ?
Then you could just use serial with 1wire, the 18X reads from serial (and blocks) then changes relays and reads again.

If the problem is more to how the 18X can control more relays than it has pins, how many out pins would you use ?

A serial latch 595 could control 8relays for 3data pins, and can be daisy chained to control 16 (or more).
 

tmack

Member
I have several 08 and 18s but it sounds like it might be better to use the 595s. Ive never heard of them before. (like i said im new).Anyone know of any good tutorials on using the 595 s and /or explaining how to communicate using serial signals?
 

MORA99

Senior Member
You can do it with picaxes, but 08 and 18 arent the best choices then.

14-M would be better because it can give you 9outputs per chip.
18X can give you 8outputs, but with its price you could get 2-3 14M instead.

74hc595n is cheaper, but can be harder to get working.


I have a guide to its usage here
http://elektronik.codebin.dk/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=7&MMN_position=7:7
Its in Danish, but the code and picture can be used.



If you want to use picaxes connect 2x18X to the relays, and one of their inputs to an output of a master (08 maybe).
Use a output per chip to make it easy.

On the 18X make a simple program that reads 1byte, and then changes the outputs as the bits say, and then reads from serial again.

On the 08M you listen for whatever needs to change the relays and then send the serial command to the 18X.


Serial comm is in the datasheet, its fairly easy.
 

moxhamj

New Member
Yes this is all possible. The control with two wires can be done with Serin and Serout - the manual has the syntax and commands.

For 12 relays a picaxe 18 still won't have enough outputs. But an 08M can control 12 relays if you use two 595's in series. Try building one first - you send the bits in one at a time with a clock signal, and then latch them out. <A href='http://www.geocities.com/drvernacula/lcd_clock_for_controlling_pumps_.htm' Target=_Blank>External Web Link</a> is a circuit I built recently where I found I needed more outputs from an 18X. The code is huge but the relevant bit is the senddatatolatch routine. The outputs will need to change from pin 5 6 and 7 to maybe 0 1 and 2 on an 08M.

Get the 595 datasheet as well if you want to know how it works (search on google for HC595). Do you have a breadboard where you can hook up test circuits and see how things work?
 

tmack

Member
Thanks for the suggestions. I will probly try and do it both ways. Ill have to order the 595s . Ill work on doing it all with picaxes 1st until I get the 595s in. This is a good project to learn how the serin,out works.Thanks agai.n guys
 
Top