i look for a stable solution to transmit the state of a pin fro one arduino to a other over a wireless connection, important is that the latence is very low, or always the same, rolling code or rolling chanel would help i guess, but i am fairly new to this so i look for advice how to do that, maybe some one had done sth similar and could tell me what he used .
Thanks a lot!
Use simple 433 MHz type Tx & Rx module with VirtualWire library.
On Tx side, read the 3 ports, send the info out. Say you read them 10 times a second.
On Rx side, receive the 3 bytes of info and do whatever you're going to do.
http://www.airspayce.com/mikem/arduino/VirtualWire/index.html
3 times a second is way to slow, i would need that to be 100 - 1000 times a second happen, as it si used for a photocell on a timing machine.
It would have been best if you had described the criteria for critical timing in your first post,along with any other important details, correct ?
If you can not use wires or cables to connect the two ends, then your choices are electromagnetic of some form, be that RF or optical.
Can you confirm the photocell you mention, with its circuit is capable of working at the rates you mention of up to 1000 detections or operations per second ?
There are many RF solutions available out there online to use, depending on your exact needs and available budget.
You could also use the higher end of the spectrum, such as microwave or higher still and use optics, say laser, but we don't currently have much of an idea of the context of your situation., except you say in your title 'free field' what ever that might infer.
What Crossroads suggested doesn't mean to infer that that concept is limited to 10 times per second. Best go and research and read. And here is some more to read, Radiohead Library
Paul
You can send more frequently.
Download the library, write a little loop to send as fast is can, and time it. Won't take long to send 3 bytes.
// transmitter.pde
//
// Simple example of how to use VirtualWire to transmit messages
// Implements a simplex (one-way) transmitter with an TX-C1 module
//
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley (mikem@airspayce.com)
// Copyright (C) 2008 Mike McCauley
// $Id: transmitter.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $
#include <VirtualWire.h>
void setup()
{
Serial.begin(9600); // Debugging only
Serial.println("setup");
// Initialise the IO and ISR
// vw_set_ptt_inverted[/iurl](true); // Required for DR3100
vw_setup[/iurl](2000); // Bits per sec
}
void loop()
{
const char *msg = "hello";
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);
}
Change this to create a 3-byte array to send out:
const char *msg = "hello";
msg[0] = PINB; // D13-12-11-10-9-8, D11-12 used by default as the Rx/Tx pins
msg[1] = PINC; // D19-18-17-16-15-14 (A5 to A0)
msg[2] = PIND; // D7-6-5-4-3-2-1-0
// receiver.pde
//
// Simple example of how to use VirtualWire to receive messages
// Implements a simplex (one-way) receiver with an Rx-B1 module
//
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley (mikem@airspayce.com)
// Copyright (C) 2008 Mike McCauley
// $Id: receiver.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $
#include <VirtualWire.h>
void setup()
{
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
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.print(buf[i], HEX); // after confirming you are getting good data, can revise this section to
// have outputs match:
// PORTD = buf[2]; PORTC = buf[1]; PORTB = buf[0]; mask off 11/12 to not interfere with comms
Serial.print(" ");
}
Serial.println("");
digitalWrite(13, false);
}
}
Wow, that got messed up with cut & pasting. Will see if I can clean it up ...
Need to define the latency requirement.
Those cheap 433 Mhz radios wont provide stable latency due to the way the receiver works, especially the AGC attack time.
FM radios would be better.
Yeah fm Modul would do better I think, the Latenz should be pretty constant, or under 1millisecond in a ideal case.
any sugestions how to use the NRF24L01 ?
There are plenty of RF Solutions based on your exact needs. You can go with the higher end of the spectrum like microwave, laser, etc.