Hey.
After a while "playing" with arduino I have started to tinker with the xbee modules.
Now try to make a small project with a number of sensors (simulated 3sensores + 1) data generated and by a module zigbee send this data in a buffer to another zigbee module that is connected to the PC. Once these data reaches the pc's would try for an android app's shew in "real time".
The question I have not been able to send a buffer of a zigbee to another and have not gotten internet to find any track or anything. The problem I have is the code and I guess I comentido no error but the connections are secure.
I leave a picture of the architecture I have done to accomplish this:
If someone could help me would appreciate it.
Thank you very much.
Regards
And the problem is that only you can see that code.
Well, aside from the fact that you haven't told us what kind of XBees you have and how they are connected to the Arduino and the PC (your picture does not show up for me at work) or how they have been configured.
I have not been able to send a buffer of a zigbee to another
That's your problem, then. Not being able to receive a buffer on another XBee is quite a different matter. We need to see the code, and to know what kind of XBees you have, how they are attached and how they are configured, if we are to help you.
What is shown in the image are 3 sensors and a push button to send data. Below I show the code that made ??to send data through the serial port.
This code sends the data to the PC, with the arduino connected to PC by USB port. I intend to send that same but it is for zigbee
#include <math.h>
/**********************/
/* INPUT PINs */
/*********************/
//Temperature sensor
int PinTemperatura = 5;
int PinLuminosidad = 4;
int PinRuido = 3;
int PinPulsador = 7;
/*************************/
/* Temperature */
/*************************/
float Vin=5.0; // [V] Voltaje de entrada
float Raux=10000; // [ohm] Resistencia Secundaria
float R0=3000; // [ohm] Resistencia a 25ºC
float T0=293.15; // [K] Temperatura a 25ºC
float Vout=0.0; // [V] Voltaje de salida
float Rout=0.0; // [ohm] Resistencia de salida
float T1=273; // [K] Temperatura a 0ªc en a grados Kelvin
float T2=373; // [K] Temperatura a 100ªc en a grados Kelvin
float RT1=19750; // [ohms] Resistencia a 273K (0ºC)
float RT2=2150; // [ohms] Resistencia a 373K (100ºC)
float beta=0.0; // [K] Parametro Beta
float Rinf=0.0; // [ohm] Rinf
float TempK=0.0; // [K] Temperatura en grados Kelvin
float TempC=0.0; // [ºC] Temperatura en grados Celsius
/***********************/
/* Luminosity */
/***********************/
float Luminosidad = 0.0;
float PorcentajeLuminosidad = 0.0;
/*****************/
/* NOISE */
/*****************/
float Ruido = 0.0;
float PorcentajeRuido = 0.0;
/****************************/
/* PUSH BUTTON */
/***************************/
int pulsador = 5;
void setup() {
// Inicializamos el puerto serie a 9600 bps
Serial.begin(9600);
// Declaramos los pines de entrada
pinMode(PinTemperatura, INPUT); //Pin Conectado al Sensor de Temperatura
pinMode(PinLuminosidad, INPUT); //Pin Conectado al Sensor de Luminosidad
pinMode(PinRuido, INPUT); //Pin Conectado al Sensor de Ruido
pinMode (PinPulsador, INPUT); //Pin conectado al Pulsador
// Calculo de Beta y Rinf para los calculos de temperatura
beta=(log(RT1/RT2))/((1/T1)-(1/T2));
Rinf=R0*exp(-beta/T0);
}
void loop() {
// Calculo de la temperatura
Vout=Vin*((float)(analogRead(PinTemperatura))/1024.0);
Rout=(Raux*Vout/(Vin-Vout));
TempK=(beta/log(Rout/Rinf)); // Temperatura en Grados Kelvin
TempC=TempK-273.15; // Temperatura en Grados Celsius
// Calculo de la luminosidad
Luminosidad = (float)analogRead(PinLuminosidad);
PorcentajeLuminosidad = (Luminosidad * 100)/1024;
PorcentajeLuminosidad = (PorcentajeLuminosidad-100)*-1;
// Calculo del Ruido
Ruido = (float)analogRead(PinRuido);
PorcentajeRuido = (Ruido * 100)/1024;
PorcentajeRuido = (PorcentajeRuido-100)*-1;
// Calculo de pin del pulsador
pulsador = digitalRead(PinPulsador);
// Mensaje de salida de la temperatura
Serial.print("Temperatura: ");
Serial.print(TempC);
Serial.println(" ºC");
// Mensaje de salida de la temperatura
Serial.print("Luminosidad: ");
Serial.print(PorcentajeLuminosidad);
Serial.println("%");
// Mensaje de salida del ruido
Serial.print("Ruido: ");
Serial.print(PorcentajeRuido);
Serial.println("%");
// Mensaje de salida del pulsador
Serial.print("Pulsador: ");
Serial.println(pulsador);
delay(5000);
}
What I want is to send data from a zigbee module (the one on the board) to other zigbee module connected to the PC.
What I want is to send data from a zigbee module (the one on the board) to other zigbee module connected to the PC.
You're in luck. The code is exactly the same, if the XBee is connected to pins 0 and 1.
and is connected properly with the tx and tx with rx rx.
Power and Ground are connected, too, right? Tx and Rx are crossed, right? What the XBee transmits the Arduino receives, and vice versa.
Zigbee modules I use are the 2MW XBEE SERIES 2 (ZB)
How have you configured them? The Arduino one needs to be a router or end-device. The PC one needs to be a coordinator. Other attributes may need to be set, too. Jack Christensen's better with the Series 2 models than I am.
Hi
i want to use modules zigbee to communicate between arduino and PC,my question is
how to connect the two zigbee modules and how we con transfer the data?
after using zigbee ,i want to see the result in my arduino tablet so
how release the connection between the module zigbee and android?
thank you for your help