Outdoors wireless commumication between PICAXEs

EquipoiseBob

New Member
Hi all

One of my A level students wants to build a system that has several (initially 5) units. Each unit to be equipped with a lamp and a button switch. On a command issued from the master unit the appropriate slave lights up until the user pushes the button on the slave unit. The master unit registers the user's action and send the signal to activate another (possibly randomly selected) slave unit. A desirable feature of the system would be the ability to log the number of successful user actions in a set time.

Constraints:

The system must be able to work outside in direct sunshine

The units must be fully self-contained. No wires linking the units.

Assume a maximum working range between the master and slave units of 20 metres.

Any ideas how PICAXE technology could be used to achieve this?

Many thanks.

Bob
 

lbenson

Senior Member
Could depend on how long it needs to run, but dumb 433mHz transmitters and receivers should work for this task, with the picaxe running off of 3 AA batteries.
 

g6ejd

Senior Member
You'll need to establish a wireless link between the master and slaves, either using infrared or wireless transceivers, both of which are freely available and reasonably straightforward to use. However the IR solution is going to be quite directional, so favouring an RF solution, of which there are many 433 RF link units available, so you could use one TX and many receivers.

On the PICAXE your receiving units will need to only respond to their specific address, so a simple 01, 02 addressing scheme would be adequate for these purposes. Something like if input = this device address then process the command else ignore it.

An interesting. project that tests and challenges a few concepts.

Programming should be straightforward and each Rx can be the same with just a different address to test against.
 

EquipoiseBob

New Member
Last edited:

lbenson

Senior Member
If you need no more than call and response, that's pretty simple:

sender: serout pin,n2400_4,("1") ' or 2,3,4 etc for the other receivers

receiver1: serin pin,n2400_4,("1")

"SERIN" is blocking, so it will not move to the following statement until it sees a "1" in the transmission stream--no additional characters needed if there is only one command to be sent to a receiver.

Check this post for important information about successful sending with dumb 433mHz transmissions: http://www.picaxeforum.co.uk/showthread.php?11531-433-MHz-wireless-link-trick

Reverse the process for the master to get the response, but you may want to send a "prefix" and slave ID since multiple slaves might send at about the same time (or not depending on your process):

slave1: serout pin, n2400_4,("pxHome","1")

master:
Code:
serin pin, n2400_4,("pxHome"),b27
select b27
  case "1"
    ' do something
  case "2"
  case "3"
  case "4"
endselect
Check out the manuals for additional details concerning serin and serout, including timeouts.
 

g6ejd

Senior Member
Yes, so needs a TX/RX for the Master and a pair for each Slave, all working on the same frequency, then a simple protocol to detect which unit is currently being commanded, to hold off the others.
 

Paix

Senior Member
It strikes me that for a master to both send and receive, then each node, master and satellites need to have both transmit and receive capability, so five tx and 5 rx would be required. The master would have to initiate proceedings and then listen for responses.

From what has been said about the application, then only one satellite would be expected to respond, be it the right one or not. It sounds like a distributed version of the agility light reaction boards, where the lamp/switches light at random and the contestant has to hit the right one at an ever increasing rate.

= = = Sorry folks, it seems that I was just about on frequency, but running a little late.
Master transmits and then listens. Satellites all listen, but the selected satellite is transmit enabled when the switch it pressed. With one "User" and not "Users", then there will be no contention problems if there is anything like an average of 10m between them . . .

A protocol case of speak only when spoken to.
 
Last edited:

AllyCat

Senior Member
Hi Bob,

For 5 slaves you would need a total of 6 receivers and transmitters, but maybe not much greater cost because the transmitters tend to be cheaper than (reasonable quality) receivers, particularly if "bundled" as transmitter-receiver pairs.

cost will be a major consideration with the project requiring 5 transmitters and 5 receivers. Would you consider this a suitable option http://www.ebay.co.uk/itm/Super-Mini-3-6-5-5V-RF-ASK-OOK-Wireless-Data-Transfer-RX-TX-Remote-Module-433M-/280968944347?pt=LH_DefaultDomain_0&hash=item416b0ddadb?
Yes, those pairs look reasonable, if you're prepared to wait up to a month (or more) for them to arrive (I've just waited 5 weeks) and beware that £16 is just into the region where you might get hit for Duty, VAT and a collection fee, potentially another £10.

If you're looking around for other receivers, for 20 metres+ range you should probably avoid "SuperRegen." types. Aim for a "SuperHet." or Synthesiser type (which your linked item might be). However, transmitters at that price will be Surface Wave type, so all will use the same (nominal) radio frequency. You could consider integrated Transceiver modules, but probably only at a higher price point.

Cheers, Alan.
 

EquipoiseBob

New Member
Hi All and thank you for your considered (and prompt) replies.

I think Paix has correctly summed up what the project is about. My student was assuming that the master unit could have a light and a button and the four slaves each have a light and a button. From the user's point of view it is unimportant whether the lamp that is lit is on the master or one of the slave units, all they need to do is run to the selected unit and hit the button. As only one unit will be active at any instant only one success message can be sent to the master. This means that a generic success message can be used to indicate that the user has reached the active unit and pressed the button. The master than (randomly) selects the next unit to target and sends a coded signal to all the slave units. Only the slave unit that has an internal code that matches the broadcast code will respond by becoming active, lighting its light and waiting for its button to be pressed. Once this occurs it transmits the generic success message to the master unit to restart the sequence. The novel feature is that the physical challenge of the task can be increased by varying the distance apart the units are placed and the terrain that the player must cover.

I think out next step is to create a hard-wired model to test the algorithm and once this is agreed move on to adding the wireless links.

(I have brought small electronic components from China before and never had to wait more than three weeks, but maybe I have just been lucky.)

Bob
 

AllyCat

Senior Member
Hi,

Maybe worth getting one pair for a "quick trial", but those receivers are a Super-Regenerative design which I'm not confident will work reliably at the OP's proposed 20 metre range. That they're less than £1 a pair shipped from HK/China may give some indication of their quality/performance. ;)

The receivers look identical to some that I've just received from HK, but mine are bundled with (what I believe/hope to be) a better quality transmitter module, at $6.99 for 5 pairs. I only really wanted the transmitters and looked on the receivers almost as a "free gift". However, I have now "discovered" a use for the receivers, but only need a range of one or two metres. Cheaper (and neater) than a piece of wire with a plug on each end :) .

Cheers, Alan.
 

Goeytex

Senior Member
If cheap is the main specification then you will need 5 sets of ASK/OOK TX & RX modules. The ones you linked to seem ok, BUT search EBAY for "RF Module" to compare. Select a seller with a good rating & history.

Another option to Ebay is AliExpress. NiceRF is a Chinese manufacturer that also sells directly to consumers at good prices. They make some of the modules sold by Dorji RF and other distributors. The Receiver is SRX887 and the low power ASK tramsmitter is the STX888. The higher power TX is the STX887. The STX887 is is a blaster and I doubt that high power level is legal in either the UK or the States. Ten units ( 5 SRX887 and 5 STX888 will cost a total of ~ $20 US. I would suggest getting some spares in case you have an accident and blow some up. Send them a message and get a price for 6 pairs instead of 5 ( in case of a mishap)

I would highly suggest spending the extra $5 and get Picaxe 14M2s instead of 08M2s becasue the 14M2 supports the RFIN/ RFOUT commands and the extra I/O pins wil allow for expansion. The RFIN and RFOUT commands support Manchester encoding and eliminate the need for manually sending preambles & syncwords.

Even better might be to go ahead and use the cheaper 08M2's (if they have enough I/O pins) and add a NKM2401 Encoder /Decoder IC to each unit. The NKM2401 does the same thing as RFIN and RFOUT except that it handles the received data so that the Picaxe can do other stuff while waiting to receive data. Rev Ed sells the NKM2401 for 50 pence each. The combination of a Picaxe (14M2 or 08M2) and the NKM2401 will make a robust and reliable RF Link.


Good Luck
 
Top