Need help with Basic stamp 2 and XBee series 2
ad9409
Posts: 8
I'm working on a project using a temperature sensor (LM34) to output voltage (temperature/data) to a transmitter (XBee series 2) and on the other end, a receiver (also XBee series 2) will receive the data and it will go through the basic stamp 2. Then I want to display the temperature on a LCD. This seems fairly simple but after researching about the coding for BS2, I can't seem to figure out where to start.
I know you have to set an input and output pin for the BS2. I'm not too sure where to go from there.
I need a little help getting started on the code to retrieve the data from the XBee (receiver) and display onto a LCD screen.
Many thanks in advance!!!
I know you have to set an input and output pin for the BS2. I'm not too sure where to go from there.
I need a little help getting started on the code to retrieve the data from the XBee (receiver) and display onto a LCD screen.
Many thanks in advance!!!
Comments
On the Stamp with the temperature sensor, get your code to successfully read the temperature and display it with DEBUG on the local Stamp.
When thats working, modify the code so the data is sent to your chosen SEROUT pin. You will use a baud rate the same as that set on the XBEE. Do you have the connection adapters for the XBEE or are you connecting direct to the XBEE circuit board? The adapter board makes it easier to use the 5 volt signals from the Stamp. Use X-CTU to change parameters on the XBEE's.
Now, your data is being sent out into the ether.
Power up the receiving XBEE and you should see data activity on the Rx led on the XBEE/adapter.
On the receiving Stamp, write a simple SERIN loop that will grab any data on the pin of your choice. Display it on the LCD or use DEBUG on the laptop.
No, it probably won't all fall into place the first time. Work from the known and tested towards the unknown, one step at a time.
Cheers,
Your advice is helpful. I'm slowly getting the hang of it. If there is anything to add feel free.
Once again, thank you for your help!
Would it be possible to attach the ADC0831 at the receiving end, connected from the XBee's output to the basic stamp input, instead of connecting the ADC0831 after the temperature sensor in the transmitter?
The analog input range of the XBee ZB is 0V to 1.2V with 10 bit resolution, and that is just about perfect for the LM34 in ambient temperatures.
Both the remote end point and the coordinator have to be programmed with the API version of the firmware. The remote can be set up to transmit the voltage reading either periodically or on a request from the coordinator.