The XBee part of the entire thing works flawlessly no matter how things are being run.
Equipment:
- Laptop
- Arduino Uno
- Sainsmart XBee Shield
- USB XBee Explorer
- 2 x XBee Series1 modules
- Terminal software
What we are doing:
Send data through terminal software using "XBee 1" on a USB explorer, to remote "XBee 2" which is connected to Arduino Uno using the Sainsmart Shield. Arduino sends a reply which we see in the terminal software. (This is basically just using the two XBee modules to eliminate physical RX-TX connections in a simple point to point communication.)
This configuration works perfectly fine when the remote Arduino + XBee are powered by a USB port of a PC (doesn't have to be the same PC - tried with separate PCs, one powering the transmitter and other the receiver.)
The problem:
This configuration does not work if the remote Arduino + XBee are being powered by:
- 9V Battery (brand new)
- 12V, 2A adaptor
- 5V, 2A mobile charger directly supplying through USB
BUT it starts working after pressing RESET (sometimes, very rarely, we have to press RESET 2 or 3 times but it does start working) and keeps working while the supply is not disconnected/turned off.
Important Note 1: As mentioned earlier, the remote XBee always works perfectly fine in all of the above cases as shorting RX/TX shows that the data perfectly and flawlessly echoes back.
Important Note 2: I don't think that the Arduino isn't starting up, as to check that I am blinking pin13 LED which always starts working fine in any of the scenarios listed above.
Please help. Having to RESET every time after power up makes the whole thing pretty useless for any real world application.
When I say that does not work, I mean I don't get a reply from arduino when I send a query over terminal.
After pressing Reset, it begins working, i.e. I start getting a reply.
But I don't think that Arduino isn't startup because Pin 13 LED blinks as expected which is something I put just to check whether Arduino code starts running.
As far as circuit, it is nothing but XBee Explorer USB plugged into my laptop and arduino with ready made XBee shield plugged into another USB port (which is when it works). Powering Arduino from a USB port of a different PC also gives no issues.
Only when Arduino is powered by external power source like an adapter or phone charger or 9V battery (literally tried all 3) does it not work automatically and I have to Reset the Arduino after which it starts replying.