Using two AXE213 sets to received seperate signals; is there a way?

I wonder if someone can help me. I am making a project with two young boys to detect two seperate switches (tilt switches) and am trying to keep it simple. I purchased two sets of AXE213 modules and programmed one of them to work successfully; counting the switch signals on a OLED screen, programme and photo below. (The programme only allows 1 signal to be received every second, as we require for this project). I now want to use the second AXE123 set/module to count the signal from a second switch. Presently, the second transmitter is also received by the first receiver (as expected). Is there a way of solving this problem please?

serout 7,N2400, (254,1) ; clears text
pause 30
serout 7, N2400, (254,128)
serout 7, N2400, ( "Ready to count" )

setint %00000100,%00000100 ; activate interrupt when pin 2 (switch) only goes high

symbol Throw = w0 ;a Throw is a positive signal from the switch

init:
let throw = 0

main:
if pin1 = 1 then
let throw = throw + 1 ; adds a throw to the last one
goto send_data
else
endif
goto main

send_data:
debug
serout 7,N2400, (254,1) ; clears text
serout 7, N2400, (254,128)
serout 7, N2400, ( "Counter " )
serout 7, N2400, (254,136)
serout 7, N2400, ( #Throw ) ; displays throws
pause 1000 ;pause to give the tilt switch chance to settle - delay is no problem
goto main

interrupt:
resetIMG_5323.jpg
 
Last edited:

hippy

Senior Member
Generally all receivers will receive from all transmitters so, if one wants to create paired links, the usual way to do that is to add an ID byte to every message sent.

For example one sensor transmitter may send "A" and their data, the other "B" and their data.

Then both receivers will wait for messages; one discarding everything but "A" tagged messages, the other ignoring anything but "B" tagged messages.

As your code stands it appears you are simply counting any RF received. You will probably need to have a more complicated means of receiving the data sent.

You also seem to be using the transmitters without any PICAXE, presumably using the tilt sensor to function as a test button which sends an incrementing "Test $xx" message. Without any ID or any means of adding one it's going to be tricky to determine which is transmitting.

From the count received, and the previous received, you might be able to determine whether it's from one or the other transmitter, but it would be hard to determine which was from which, and it wouldn't necessarily be reliable.

You are probably going to have to add a PICAXE to the transmitters which reads the tilt switch and sends out a message which is more easily identified when received.
 

AllyCat

Senior Member
Hi,

At the very minimum the tilt switch should drive a "monostable" circuit (e.g. using a "555 timer") to prevent continuous transmission (which is illegal and will at least prevent the other transmitter being detected) if the tilt switch stays active. A simple solution could be to transmit pulses of two different durations to allow them to be recognised separately by the receiver. But really, we should encourage you to use an 08M2 for each transmitter. ;)

Cheers, Alan.
 
Thanks for the advice hippy and Ally. I am starting to understand. So, I would need to add (x2) a 08M2 between the tilt switch and the AXE213 recever module to receive the signal from the Tilt switch and output it from the 08M2 using pulseout command. At the receiver end, I would use the pulsein command to pick it up. This would be a modified version of my programme above. Is this correct or do I use a different command? Maybe I have got it all wrong.
 

AllyCat

Senior Member
Hi,

Yes, that could be a good way to start. But the advantage of a PICaxe is that we can be much more "clever". To resist "interference" (there can be a great deal of other stuff on the 433 MHz radio band), you might use SEROUT and SERIN (perhaps with a "qualifier"). Also, I believe it's been suggested that IROUT and IRIN might be used with radios (although I have my doubts) because the normal RFOUT and RFIN commands are omitted from the 08M2 chips (only).

EDIT: Ah, I see that the AXE213 boards already include the NKM2401 "encoder" chip (which uses the protocol that the RFIN and RFOUT commands use), so reliable communications should be quite easy to develop, even with 08M2s.

Cheers, Alan.
 
Last edited:
Thank you Alan,
I have just ordered some 08M2s and will have a go during the week, following your advice. I will have to do a little more research as I have to honest and say it is a little above my head at present. However, anything is possible!
Cheers, Nick
 

hippy

Senior Member
Hardware-wise for each tilt switch transmitter -
Code:
 .--.   .--------.    .---------.    .-------.   \|/
 O  `---|        |    |         |    |       |    |
\       | PICAXE |--->| NKM2401 |--->| RF TX |----'
 O  .---|        |    |         |    |       |
 `--'   `--------'    `---------'    `-------'
                      :                      :
                      `--- AXE213 Connect ---'
For each LCD display receiver -
Code:
\|/   .-------.    .---------.    .--------.
 |    |       |    |         |    |        |    .-----.
 `--->| RF RX |--->| NKM2401 |--->| PICAXE |--->| LCD |
      |       |    |         |    |        |    `-----'
      `-------'    `---------'    `--------'
      :                      :
      `--- AXE213 Connect ---'
Software-wise for each tilt switch transmitter you could use something like below; wait for the tilt switch to be activated then use a SEROUT command to send a message. One transmitter would send A's the other B -
Code:
High RF_TX
Do
  Do : Loop Until pinC.0 = 0
  Do : Loop Until pinC.0 = 1
  SerOut RF_TX, T4800, ( "AAAAAAAA" )
  Pause 1000
Loop
And for each receiver, one looking for "A" messages, the other looking for "B" messages, something like -
Code:
Do
  SerIn RF_RX, T4800, ("A") ; Just wait for the qualifier
  counter = counter + 1
  Gosub ShowCountOnLcd
  Pause 1000
Loop
As noted; the NKM2301 part could be skipped entirely if using RFOUT (14M2, 18M2, 20M2) and RFIN (14M2, 20M2).

Note the 08M2's don't support either, but can be used with the AXE213's you have.
 

AllyCat

Senior Member
Hi,

Note that these transmitters use the "shared" 433 MHz frequency, which is also used by many devices such as amateur weather stations, central heating thermostats, doorbells and car keyfobs etc.. So there is always the risk of a "collision" with any of these (and of course between your two transmitters) which will probably cause the data packet(s) to be "lost", For relatively constant data (such as a temperature) the loss of a few data packets is irrelevant (and a keyfob can be tried again), but if you want an accurate "count" then you need an alternative strategy:

Weather station rain gauges count each time that a (tiny) "bucket" fills and self-empties, to record typically each 0.1mm of rainfall. Any "lost" transmissions would reduce the accuracy, so the transmitters actually do the counting and send the present numerical value to the receiver. Typically, this would be a 16-bit (word) value, which can be easily transmitted in two bytes, in addition to one byte as an "identifier" (and perhaps a "checksum" of the bits). The receiver can "Reset" the count by recording the present value and subtracting it from all subsequent received values (as might be done at the start of each day for a rain gauge), Also, a single receiver could process the signals from both (or more) transmitters if required.

Cheers, Alan.
 
Top