|
|
Dee Why NSW
Offline
God Member
Karma: 12
Posts: 627
|
 |
« Reply #1 on: February 09, 2013, 08:35:15 pm » |
Assuming you want to use more than one sensor at a time, simply wiring them into the headers of the shield is not really enough and proper terminals are required.
I know nothing about Xbee shields. I assume they are made to take the Xbee module and therefore you have that side of things sorted. I think the sensor adapter is just a piece of junk. The two others are much the same as each other. I have the second one, you can get that for half the price on eBay. I found it useless. Quite aside from the fitting problems, I have never seen any plugs that fit in the sockets provided and I could do a better job making my own. You probably would too.
Googling Xbee shield, I see the red Sparkfun looks fairly, if not very, sensible. It has a prototyping area on which you can put your own headers to take your own sensors. If your shield is one of those or similar, you don't need to waste your money on the other stuff.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Dee Why NSW
Offline
God Member
Karma: 12
Posts: 627
|
 |
« Reply #3 on: February 09, 2013, 09:25:47 pm » |
But i think this is the one i should have bought
So what are we supposed to do to connect sensors as well as communicate (with xbee shield + module) over the uno?
Um, yes, well... A principle reason why I don't know much about Xbee is that the only thing I do know is that the Xbee shield manufacturers have no idea about what they are doing, and your first example is fair evidence of that. Having said that, your second example looks fine to me, and I'm sure you are right. Perhaps not perfect in theory, but it has the three vital assets 1. a row of proper holes for wiring to the headers 2. twelve holes across means four 3-wire headers in a row. 3. stackable headers. Most importantly, it has other relevant peripherals that would deter me from making my own. The main reason why I don't know about Xbee is that I have managed to avoid it - so far. If I eventually have to indulge in it, this is the sort of board I would get. Thank you.
|
|
|
|
|
Logged
|
|
|
|
|
New River, Arizona
Offline
God Member
Karma: 15
Posts: 876
Arduino rocks
|
 |
« Reply #4 on: February 10, 2013, 12:08:00 am » |
I've been where you are and made a bunch of mistakes, so a couple of suggestions: I like this board for an XBee shield http://www.ebay.com/itm/XBee-shield-for-Arduino-/220982906382?ssPageName=ADME:L:OC:US:3160It lets you connect the serial input on the XBee to any pin on the arduino, and if you use a mega2560, you add a couple of wires and can get to any pin on it as well. It has leds, reset switch, and prototype area so you can mess around a bit on the board itself. You can piggy back another shield on top of it also. As for sensors, visit Terry King's site at http://arduino-direct.com/sunshop/ , he has a bunch of sensors, shields, and most importantly, examples of using a lot of the stuff. Even though you already have some items, the articles and description of the devices will help you understand how this stuff works. XBee, I didn't see where you mentioned which XBee you got, but I hope it's a Series 2 or 2.5 device. The series 1 are marginally easier to use, but they don't have anywhere near the capabilities of the later devices. To get you started, decide what you want to do. Maybe measure the temperature in your main room. For this you need a temperature sensor to plug into the arduino. Then you will want to see what it's reading, so you'll probably want to get an LCD display. Then you'll want to do something else. As you decide what you want to monitor or control, you'll understand what you need to have to do it. As for multiple sensors, yes you can have multiple sensors. The arduino can sample a number of them and then format a message to send through the XBee to another one hooked to some device you want to get the data to. Basically, think about what you want to do, gather some information on doing it, then go have fun.
|
|
|
|
|
Logged
|
|
|
|
|
New Jersey
Offline
Edison Member
Karma: 26
Posts: 2455
|
 |
« Reply #5 on: February 10, 2013, 06:21:21 am » |
With your xBee shield, it looks like you need it to be on top of your shield stack, with whatever stackable sensor shield you can find making the filling in an arduino/xBee sandwich. I used the Sparkfun prototyping shield for this purpose, to mount a temperature sensor. I don't like that shield much - the prototyping area was hard to use because all the nodes are electrically separate so it was a very fiddly job wiring it up. Much more durable than the breadboard it replaced though!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 18
|
 |
« Reply #6 on: February 11, 2013, 03:22:16 pm » |
Thanks guys...the sandwich according to me should be arduino board + sensor shield + some headers (to raise the level up a little bit to allow enough room for multiple sensors) + xbee shield + xbee module. What do you guys think?
|
|
|
|
|
Logged
|
|
|
|
|
New River, Arizona
Offline
God Member
Karma: 15
Posts: 876
Arduino rocks
|
 |
« Reply #7 on: February 11, 2013, 05:20:25 pm » |
The only way you're going to know for sure is to stack them up and see what happens. The answer will probably be obvious.
|
|
|
|
|
Logged
|
|
|
|
|
Dee Why NSW
Offline
God Member
Karma: 12
Posts: 627
|
 |
« Reply #8 on: February 11, 2013, 05:29:38 pm » |
the sandwich according to me should be arduino board + sensor shield + some headers (to raise the level up a little bit to allow enough room for multiple sensors) + xbee shield + xbee module.
This implies it is appropriate for the sensors to go on the board, and the Arduino will be in the right place to do the sensing. Only you can make that judgement. Similarly, only you can decide on the need for extra stackers. Note though, if you make your sensor shield, extra long legs can be had from here: http://www.ebay.com/itm/130802267649?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649but note also they are not really long enough to clear an EtherNet socket! I put clock modules on standard pinrows and an ordinary shield will just clear it
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 18
|
 |
« Reply #9 on: February 11, 2013, 07:50:25 pm » |
Now i have everything set up...Just a bit apprehensive about whether or not i should put the x-bee module all the way down into the shield...Because it takes quite a lot of effort to pull that thing up and plug into the spark fun explorer to program it...I am scared that it might damage the module if i went doing it for a couple of times.
|
|
|
|
|
Logged
|
|
|
|
|
New River, Arizona
Offline
God Member
Karma: 15
Posts: 876
Arduino rocks
|
 |
« Reply #10 on: February 11, 2013, 08:16:21 pm » |
I plug and unplug mine all the time. After a while, the sockets loosen up enough so that it doesn't take as much force to get it out. Be careful of bending pins on the XBee though, it's really easy for it to let go on one end as you pull it out, bending the pins on the other end. Don't worry too much though if you do bend them, they don't break too easily. Just don't make a habit of it.
|
|
|
|
|
Logged
|
|
|
|
|
Dee Why NSW
Offline
God Member
Karma: 12
Posts: 627
|
 |
« Reply #11 on: February 11, 2013, 08:17:19 pm » |
You are probably just being paranoid and, the more you plug/unplug, the easier it is likely to get. If I understand you correctly, the Xbee module has to go into another device in order to be programmed, and I guess you only do that once anyway.
I have noticed variation int the way a shield installs. I have wondered if some have harder brass in the pins and it takes a bit more to straighten them.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 18
|
 |
« Reply #12 on: February 12, 2013, 12:01:21 am » |
Sure. Maybe over a period of time, will overcome the fear  Also now that i am setting up one arduino to be the sender and the other to be the receiver. What i am trying to achieve is to blink an led on and off on the receiver based on inputs (1's and 0's) from sender. Steps for sender: 1)Write the code for the sender. 2)Compile it. 3)Burn the code into the arduino uno. 4)Load the xbee shield with xbee module Steps for receiver: 1)Write the code for receiver. 2)Compile it. 3)Burn the code into the arduino uno. 4)Load the xbee shield with xbee module. Then plug them onto diferent computers. (Just for power supply i am assuming) But it does not seem to work. I am copy pasting the code below.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 18
|
 |
« Reply #13 on: February 12, 2013, 12:02:16 am » |
Sender:
int data = 0; int ledPin = 13;
void setup(){ Serial.begin(9600); pinMode(ledPin, OUTPUT); }
void loop(){ if(data == 0){ Serial.write(0); digitalWrite(ledPin, LOW); data = 1; } delay(1000); if(data == 1){ Serial.write(0); digitalWrite(ledPin, HIGH); data = 0; } delay(1000); }
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 18
|
 |
« Reply #14 on: February 12, 2013, 12:02:50 am » |
Receiver:
int ledPin = 13;
void setup(){ Serial.begin(9600); pinMode(ledPin, OUTPUT); }
void loop(){ //while(Serial.available() == 0); if(Serial.read() - '0'){ digitalWrite(ledPin, HIGH); delay(1000); } else{ digitalWrite(ledPin, LOW); delay(1000); } Serial.flush(); }
|
|
|
|
|
Logged
|
|
|
|
|
|