Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

Reply To: Arduino datalogger

Home Forums Other Data Loggers Arduino datalogger Reply To: Arduino datalogger

#1975
Shannon Hicks
Keymaster

Do you only get that “extra junk” (as you described it) on the serial monitor when the Xbee is attached? It looks to me like you’ve got the Xbee radio on the same serial port as the board communication (the Arduino’s hardware serial port, which is pins 0 and 1), right? The Arduino board is talking to the PC at 57600 baud, but the Xbee has a default speed of 9600. So unless you changed that by programming the Xbee separately (using either the X-CTU program or a terminal and AT commands) then you’re going to get a mis-match between the 2 devices. But more importantly, you can’t have the Xbee on the same hardware serial port as the computer. That’s why I like the Mayfly, it has 2 hardware serial ports. The Mayfly talks to the PC serial monitor on the first one, and the Mayfly talks to the Xbee module on the second one.

If you’re using an Arduino Mega board (it has 3 hardware serial ports) or some of the other newer Arduino boards or derivatives, they sometimes have 2 hardware serial ports. But if you’re using the Uno, then you’ve got to implement a separate software serial port for the processor to talk to the Xbee module so that you can still print stuff to the screen. Otherwise, your Xbee module is going to try to transmit everything that you sketch is printing to the serial monitor and you’ll see random stuff on the serial monitor that’s coming from and going to the Xbee.

If you’re not familiar with Xbee’s and using software serial ports, you’ll need to find some examples of how to set that up.