Hi there,
I'm back with my first prototype. Quite naive until now...
It's just an arduino nano monitoring a reed swith. When a magnet gets close, a message is sent through the transmitter module to a "station base" (the Arduino Uno wired to a receiver) that should interpret who sent the message.

Here's a small movie showing the test I did:
here are the codes that I used:
Transmitter#include <VirtualWire.h>
int reed=2;
void setup()
{
// setting up the reed switch as INPUT
pinMode(reed, INPUT);
Serial.begin(9600); // Debugging only
Serial.println("setup");
// Initialise the IO and ISR
vw_set_ptt_inverted(true); // Required for DR3100
vw_setup(2000); // Bits per sec
}
void loop()
{
const char *msg = "SENSOR 01 DETECTED";
if (digitalRead(reed)==HIGH) {
digitalWrite(13, true); // Flash a light to show transmitting
vw_send((uint8_t *)msg, strlen(msg));
vw_wait_tx(); // Wait until the whole message is gone
digitalWrite(13, false);
delay(200);
}
}
Receiver#include <VirtualWire.h>
void setup()
{
Serial.begin(9600); // Debugging only
Serial.println("Station base start up");
// Initialise the IO and ISR
vw_set_ptt_inverted(true); // Required for DR3100
vw_setup(2000); // Bits per sec
vw_rx_start(); // Start the receiver PLL running
}
void loop()
{
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if (vw_get_message(buf, &buflen)) // Non-blocking
{
int i;
digitalWrite(13, true); // Flash a light to show received good message
// Message with a good checksum received, dump it.
Serial.print("Got: ");
for (i = 0; i < buflen; i++)
{
Serial.write(buf[i]);
//Serial.print(" ");
}
Serial.println("");
digitalWrite(13, false);
}
}
The idea itself seems that would do the job, however, hall sensors and reed switches are not sensible enough for this application. The sensor will be embedded in a RC car 2-3 inches away from the floor and behind aluminum or plastic plates (the car's chassis). I'll not find any magnet strong enough to activate the hall sensor or reed switch. To make it short. I have two possible scenarios:
1). The car sensing the triggering line
OR
2). The triggering line sensing the cars passing through it
What could I use? Note that in the prototype I've built, I'm considering the first scenario.
Thanks for any help
Renato.