Tag Archive | "xbee"

Arduino, Android and Seeedstudio Bluetooth Bee

Introduction

In this article we examine the Seeedstudio “Bluetooth Bee” modules and how they can be used in a simple way in conjunction with Android devices to control the Arduino world.  Here is an example of a Bluetooth Bee:

For the curious, the hardware specifications are as follows:

  • Typical -80dBm sensitivity
  • Up to +4dBm RF transmit power
  • Fully Qualified Bluetooth V2.0+EDR 3Mbps Modulation
  • Low Power 1.8V Operation, 1.8 to 3.6V I/O
  • UART interface with programmable baud rate
  • Integrated PCB antenna.
  • XBee compatible headers

You may have noticed that the Bluetooth Bee looks similar to the Xbee-style data transceivers – and it is, in physical size and some pinouts, for example:

The neat thing with the BtB (Bluetooth Bee) is that it is compatible with Xbee sockets and Arduino shields. It is a 3.3V device and has the same pinouts for Vcc, GND, TX and RX – so an existing Xbee shield will work just fine.

In some situations you may want to use your BtB on one UART and have another for debugging or other data transport from an Arduino – which means the need for a software serial port. To do this you can get a “Bees Shield” which allows for two ‘Bee format transceivers on one board, which also has jumpers to select software serial pins for one of them. For example:

Although not the smallest, the Bees Shield proves very useful for experimenting and busy wireless data transmit/receive systems. More about the Bees Shield can be found on their product wiki.

Quick Start 

In the past many people have told me that bluetooth connectivity has been too difficult or expensive to work with. In this article I want to make things as simple as possible, allowing you to just move forward with your ideas and projects. One very useful function is to control an Arduino-compatible board with an Android-based mobile phone that has Bluetooth connectivity. Using the BtB we can create a wireless serial text bridge between the phone and the Arduino, allowing control and data transmission between the two.

We do this by using a terminal application on the Android device – for our examples we will be using “BlueTerm” which can be downloaded from Google Play – search for “blueterm” as shown below:

gplay1

In our Quick Start example, we will create a system where we can turn on or off four Arduino digital output pins from D4~D7. (If you are unsure about how to program an Arduino, please consider this short series of tutorials). The BtB is connected using the Bees shield. This is based on the demonstration sketch made available on the BtB Wiki page – we will use commands from the terminal on the Android device to control the Arduino board, which will then return back status.

As the BtB transmit and receive serial data we will have it ‘listen’ to the virtual serial port on pins 9 and 10 for incoming characters. Using a switch…case function it then makes decisions based on the incoming character. You can download the sketch from here. If you were to modify this sketch for your own use, study the void loop() section to see how the incoming data is interpreted, and how data is sent back to the Android terminal using blueToothSerial.println.

Before using it for the first time you will need to pair the BtB with your Android device. The PIN is set to a default of four zeros. After setting up the hardware and uploading the sketch, wait until the LEDs on the BtB blink alternately – at this point you can get a connection and start communicating. In the following video clip you can see the whole process:


Where to from here?

There are many more commands that can be set using terminal software from a PC with a Bluetooth adaptor, such as changing the PIN, device name and so on. All these are described in the BtB Wiki page along with installation instructions for various operating systems.

Once again I hope you found this article interesting and useful. The Bluetooth Bees are an inexpensive and useful method for interfacing your Arduino to other Bluetooth-compatible devices. For more information and product support, visit the Seeedstudio product pages.

Bluetooth Bees are available from Seeedstudio and their network of distributors.

Disclaimer – Bluetooth Bee products used in this article are promotional considerations made available by Seeedstudio.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

Posted in android, arduino, bluetooth, cellular, INT119B2P, lesson, seeedstudio, tutorial, WLS125E1P, xbee

RF Wireless Data with the Seeedstudio RFbee

Introduction

In this article we examine the Seeedstudio RFbee Wireless Data Transceiver nodes. An RFbee is a small wireless data transceiver that can be used as a wireless data bridge in pairs, as well as a node in mesh networking or data broadcasting. Here is an example of an RFbee:

You may have noticed that the RFbee looks similar to the Xbee-style data transceivers – and it is, in physical size and some pinouts, for example:

comparison

However this is where the similarity ends. The RFbee is in fact a small Arduino-compatible development board based on the Atmel ATmega168 microprocessor (3.3V at 8MHz – more on this later) and uses a Texas Instruments CC1101 low-power sub1-GHz RF transceiver chip for wireless transfer. Turning over an RFbee reveals this and more:

But don’t let all this worry you, the RFbee is very simple to use once connected. As a transceiver the following specifications apply:

  • Data rate – 9600, 19200, 38400 or 115200bps
  • Adjustable transmission power in stages between -30dBm and 10 dBm
  • Operating frequency switchable between 868MHz and 915MHz
  • Data transmission can be point-to-point, or broadcast point-to-many
  • Maximum of 256 RFbees can operate in one mesh network
  • draws only 19.3mA whilst transmitting at full power

The pinout for the RFbee are similar to those of an Xbee for power and data, for example:

There is also the ICSP pins if you need to reprogram the ATmega168 direcly with an AVRISP-type programmer.

Getting Started

Getting started is simple – RFbees ship with firmware which allows them to simply send and receive data at 9600bps with full power. You are going to need two or more RFbees, as they can only communicate with their own kind. However any microcontroller with a UART can be used with RFbees – just connect 3.3V, GND, and the microcontroller’s UART TX and RX to the RFbee and you’re away. For our examples we will be using Arduino-compatible boards. If Arduino is new to you, consider our tutorials first.

If you ever need to update the firmware, or reset the RFbee to factory default after some wayward experimenting – download the firmware which is in the form of an Arduino sketch (RFBee_v1_1.pde) which can be downloaded from the repository. (This has been tested with Arduino v23). In the Arduino IDE, set the board type to “Arduino Pro or Pro Mini (3.3V, 8MHz) w/ATmega168”. From a hardware perspective, the easiest way to update the firmware is via a 3.3V FTDI cable or an UartSBee board, such as:

xbs4

You will also find a USB interface useful for controlling your RFbee via a PC or configuration (see below). In order to do this,  you will need some basic terminal software. A favourite and simple example is called … “Terminal“. (Please donate to the author for their efforts).

Initial Testing

After connecting your RFbee to a PC, run your terminal software and set it for 9600 bps – 8 – None – no handshaking, and click the check box next to “+CR”. For example:

term1

Select your COM: port (or click “ReScan” to find it) and then “Connect”. After a moment “OK” should appear in the received text area. Now, get yourself an Arduino or compatible board of some sort that has the LED on D13 (or substitute your own) and upload the following sketch:

Finally, connect the Arduino board to an RFbee in this manner:

  • Arduino D0 to RFbee TX
  • Arduino D1 to RFbee RX
  • Arduino 3.3V to RFbee Vcc
  • Arduino GND to RFbee GND
and the other RFbee to your PC and check it is connected using the terminal software described earlier. Now check the terminal is communicating with the PC-end RFbee, and then send the character ‘A’, ‘B’ or ‘C’. Note that the LED on the Arduino board will blink one, two or three times respectively – or five times if another character is received. It then reports back “Blinking completed!” to the host PC. For example (click to enlarge):
term2

Although that was a very simple demonstration, in doing so you can prove that your RFbees are working and can send and receive serial data. If you need more than basic data transmission, it would be wise to get a pair of RFbees to experiment with before committing to a project, to ensure you are confident they will solve your problem.

More Control

If you are looking to use your RFbees in a more detailed way than just sending data at 9600 bps at full power, you will need to  control and alter the parameters of your RFbees using the terminal software and simple AT-style commands. If you have not already done so, download and review the RFbee data sheet downloadable from the “Resources” section of this page. You can use the AT commands to easily change the data speed, power output (to reduce current draw), change the frequency, set transmission mode (one way or transceive) and more.

Reading and writing AT commands is simple, however at first you need to switch the RFbee into ‘command mode’ by sending +++ to it. (When sending +++ or AT commands, each must be followed with a carriage return (ASCII 13)). Then you can send commands or read parameter status. To send a command, just send AT then the command then the parameter. For example, to set the data rate (page ten of the data sheet) to 115200 bps, send ATBD3 and the RFbee will respond with OK.

You can again use the terminal software to easily send and receive the commands. To switch the RFbee from command mode back to normal data mode, use ATO0 (that’s AT then the letter O then zero) or power-cycle the RFbee.

RFbee as an Arduino-compatible board with inbuilt wireless

As mentioned previously the RFbee is based around an Atmel ATmega168 running at 8MHz with the Arduino bootloader. In other words, we have a tiny Arduino-compatible board in there to do our bidding. If you are unfamiliar with the Arduino system please see the tutorials listed here. However there are a couple of limitations to note – you will need an external USB-serial interface (as noted in Getting Started above), and not all the standard Arduino-type pins are available. Please review page four of the data sheet to see which RFbee pins match up to which Arduino pins.

If for some reason you just want to use your RFbee as an Arduino-compatible board, you can do so. However if you upload your own sketch you will lose the wireless capability. To restore your RFbee follow the instructions in Getting Started above.

The firmware that allows data transmission is also an Arduino sketch. So if you need to include RF operation in your sketch, first use a copy of the RFBee_v1_1.pde included in the repository – with all the included files. Then save this somewhere else under a different name, then work your code into the main sketch. To save you the effort you can download a fresh set of files which are used for our demonstration. But before moving forward, we need to learn about controlling data flow and device addresses…

Controlling data flow

As mentioned previously, each RFbee can have it’s own numerical address which falls between zero and 255. Giving each RFbee an address allows you to select which RFbee to exchange data with when there is more than two in the area. This is ideal for remote control and sensing applications, or to create a group of autonomous robots that can poll each other for status and so on.

To enable this method of communication in a simple form several things need to be done. First, you set the address of each RFbee with the AT command ATMAx (x=address). Then set each RFbee with ATOF2. This causes data transmitted to be formatted in a certain method – you send a byte which is the address of the transmitting RFbee, then another byte which is the address of the intended receipient RFbee, then follow with the data to send. Finally send command ATAC2 – which enables address checking between RFbees. Data is then sent using the command

Where data is … the data to send. You can send a single byte, or an array of bytes. length is the number of bytes you are sending. sourceAddress and destinationAddress are relevant to the RFbees being used – you set these addresses using the ATMAx described earlier in this section.

If you open the file rfbeewireless.pde in the download bundle, scroll to the end of the sketch which contains the following code:

This is a simple example of sending data out from the RFbee. The RFbee with this sketch (address 1) sends the array of bytes (testdata[]) to another RFbee with address 2.  You can disable address checking by a receiving RFbee with ATAC0 – then it will receive any data send by other RFbees.

To receive data use the following function:

The variable result will hold the incoming data, len is the number of bytes to expect, sourceAddress and destinationAddress are the source (transmitting RFbee) and destination addresses (receiving RFbee). rssi and lqi are the signal strength and link quality indicator – see the TI CC1101 datasheet for more information about these. By using more than two RFbees set with addresses you can selectively send and receive data between devices or control them remotely. Finally, please note that RFbees are still capable of sending and receiving data via the TX/RX pins as long as the sketch is not executing the sendTestData() loop.

I hope you found this introduction interesting and useful. The RFbees are an inexpensive and useful alternative to the popular Xbee modules and with the addition of the Arduino-compatible board certainly useful for portable devices, remote sensor applications or other data-gathering exercises.

For more information and product support, visit the Seeedstudio product pages.

RFbees are available from Seeedstudio and their network of distributors.

Disclaimer – RFbee products used in this article are promotional considerations made available by Seeedstudio.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

Posted in arduino, education, lesson, RF, rfbee, seeedstudio, tutorial, wireless, WLS126E1P, xbee

Review: The Gravitech Arduino Nano family

Hello Readers

In this article we will examine a variety of products received for review from Gravitech in the United States – the company that designed and build the Arduino Nano. We have a Nano and some very interesting additional modules to have a look at.

So let’s start out review with the Arduino Nano. What is a Nano? A very, very small version of our Arduino Duemilanove boards. It contains the same microcontroller (ATmega328) but in SMD form; has all the I/O pins (plus two extra analogue inputs); and still has a USB interface via the FT232 chip. But more on that later. Nanos arrive in reusable ESD packaging which is useful for storage when not in use:

Patriotic Americans should note that the Nano line is made in the USA. Furthermore, here is a video clip of Nanos being made:

For those who were unsure about the size of the Nano, consider the following images:

You can easily see all the pin labels and compare them to your Duemilanove or Uno board. There is also a tiny reset button, the usual LEDs, and the in circuit software programmer pins. So you don’t miss out on anything by going to a Nano. When you flip the board over, the rest of the circuitry is revealed, including the FTDI USB>serial converter IC:

Those of you familiar with Arduino systems should immediately recognise the benefit of the Nano – especially for short-run prototype production. The reduction in size really is quite large. In the following image, I have traced the outline of an Arduino Uno and placed the Nano inside for comparison:

So tiny… the board measures 43.1mm (1.7″) by 17.8mm (0.7″). The pins on this example were pre-soldered – and are spaced at standard 2.54mm (0.1″) intervals – perfect for breadboarding or designing into your own PCB –  however you can purchase a Nano without the pins to suit your own mounting purposes. The Nano meets all the specifications of the standard Arduino Duemilanove-style boards, except naturally the physical dimensions.

Power can be supplied to the Nano via the USB cable; feeding 5V directly into the 5V pin, or 7~12 (20 max, not recommended) into the Vin pin. You can only draw 3.3V at up to 50 mA when the Nano is running on USB power, as the 3.3V is sourced from the FTDI USB>serial IC. And the digital I/O pins still allow a current draw up to 40 mA each. From a software perspective you will not have any problems, as the Nano falls under the same board classification as the (for example) Arduino Duemilanove:

Therefore one could take advantage of all the Arduino fun and games – except for the full-size shields. But as you will read soon, Gravitech have got us covered on that front. If the Arduino system is new to you, why not consider following my series of tutorials? They can be found here. In the meanwhile, to put the size into perspective – here is a short video of a Nano blinking some LEDs!

Now back to business. As the Nano does not use standard Arduino shields, the team at Gravitech have got us covered with a range of equivalent shields to enable all sorts of activities. The first of this is their Ethernet and microSD card add-on module:

and the underside:

Again this is designed for breadboarding, or you could most likely remove the pins if necessary. The microSD socket is connected as expected via the SPI bus, and is fully compatible with the default Arduino SD library. As shown in the following image the Nano can slot directly into the ethernet add-in module:

The Ethernet board requires an external power supply, from 7 to 12 volts DC. The controller chip is the usual Wiznet 5100 model, and therefore the Ethernet board is fully compatible with the default Ethernet Arduino library. We tested it with the example web server sketch provided with the Arduino IDE and it all just worked.

The next add-on module to examine is the 2MOTOR board:

… and the bottom:

Using this module allows control of two DC motors with up to two amps of current each via pulse-width modulation. Furthermore, there is a current feedback circuit for each motor so you measure the motor load and adjust power output – interesting. So a motorised device could sense when it was working too hard and ease back a little (like me on a Saturday). All this is made possible by the use of the common L298 dual full-bridge motor driver IC. This is quite a common motor driver IC and is easy to implement in your sketches. The use of this module and the Nano will help reduce the size of any robotics or motorised project. Stay tuned for use of this board in future articles.

Next in this veritable cornucopia of  add-on modules is the USBHOST board:

turning it over …

Using the Maxim MAX3421E host controller IC you can interface with all sorts of devices via USB, as well as work with the new Android ADK. The module will require an external power supply of between 7 and 12 volts DC, with enough current to deal with the board, a Nano and the USB device under control – one amp should be more than sufficient. I will be honest and note that USB and Arduino is completely new to me, however it is somewhat fascinating and I intend to write more about using this module in the near future. In the meanwhile, many examples can be found here.

For a change of scene there is also a group of Xbee wireless communication modules, starting with the Xbee add-on module:

The Xbee itself is not included, only shown for a size comparison. Turning the module over:

It is nice to see a clearly-labelled silk screen on the PCB. If you are unfamiliar with using the Xbee wireless modules for data communication, you may find my introductory tutorial of interest. Furthermore, all of the Gravitech Nano modules are fully software compatible with my tutorial examples, so getting started will be a breeze. Naturally Gravitech also produce an Xbee USB interface board, to enable PC communication over your wireless modules:

Again, note that the Xbee itself is not included, however they can be supplied by Gravitech. Turning the board over reveals another highly-detailed silk screen:

All of the Gravitech Xbee modules support both series 1.0 and 2.5 Xbees, in both standard and professional variants. The USB module also supports the X-CTU configuration software from Digi.

Finally – leaving possibly the most interesting part until last, we have the MP3 Player add-on board:

and on the B-side:

The MP3 board is designed around the VS1053B MP3 decoder IC. It can also decode Ogg Vorbis, AAC, WMA and MID files. There is a 3.5mm stereo output socket to connect headphones and so on. As expected, the microSD card runs from the SPI pins, however SS is pin 4. Although it may be tempting to use this to make a home-brew MP3 player, other uses could include: recorded voice messages for PA systems such as fire alarm notices, adding sound effects to various projects or amusement machines, or whatever else you can come up with.

Update – We have examined the MP3 board in more detail with a beginner’s tutorial.

The Arduino Nano and related boards really are tiny, fully compatible with their larger brethren, and will prove very useful. Although this article was an introductory review, stay tuned for further projects and articles that will make use of the Nano and other boards. If you have any questions or enquiries please direct them to Gravitech via their contact page. Gravitech products including the Arduino Nano family are available directly from their website or these distributors.

As always, thank you for reading and I look forward to your comments and so on. Furthermore, don’t be shy in pointing out errors or places that could use improvement. Please subscribe using one of the methods at the top-right of this web page to receive updates on new posts, follow on twitterfacebook, or join our Google Group.

[Disclaimer – the products reviewed in this article are promotional considerations made available by Gravitech]

High resolution photos are available on flickr.

Otherwise, have fun, be good to each other – and make something! 

Posted in arduino, ethernet, gravitech, microcontrollers, mp3, nano, part review, xbeeComments (0)

Review – Starman Electric Databridge Wireless I/O Modules

In this review we are going to have a look at some new wireless data modules that have just arrived on the market. They are the Databridge Wireless I/O modules from Starman Electric. Although there are many types of wireless modules out there, such as the discount 315 MHz units that are somewhat unreliable (well for me); and the great XBee series (as we used in Moving Forward with Arduino – Chapter Fourteen) – these Starman modules take it to the next level. How?

The concept of a databridge is a delightfully simple one. The two modules take the place of a wire. Digital, analogue, UART, even PC serial. No firmware settings to adjust, just plug them in and they work!

First of all, there are two physical types of unit, either DIP mount or SMD. The units below are the DIP version, 1mW output power:

topss1

The graph paper is 5mm square, and the module measures 53.85mm by 25.91mm. The DIP packaging (above) is meant for experimenters and prototypes, you can order SMD versions for production runs. There are also two power-output versions, 1mW with a theoretical range of 1km, and a 100 mW with a range of 4km. The higher power modules require the use of an external antenna. They require 3.3 volts DC, with a peak current draw of 37mA for the 1mW, and 120mA for the 100mW. For demonstration purposes I am using a Texas Instruments LP2950 to provide 3.3 volts DC at up to 100 mA.

Although the specification sheet is quite long (and you can download it from here) there are a few features that really stand out, including:

  • Automatic connection – a pair of modules will ‘lock’ onto each other without any extra work by the user;
  • A very high sampling rate of 200 samples per second with a latency of five millisconds;
  • Spread-spectrum radio operation – the modules will skip frequencies themselves for reliable connections;
  • You can have sixteen unique pairs working in the same area without cross-interference;
  • You can have two analogue channels and multiple digital channels simultaneously.

But enough talking, time to put them to the test. I will recreate some examples found in the Getting Started manual available for download here.

As I only have one pair of modules, and somehow I think my neighbours won’t be using any at this point in time, there is no need to set the pair’s unique network ID. However you do need to specify the master and slave in the module relationship (no switches…), which is done with pin 4 – to Vcc for master, and pin 4 to GND for slave. Now on with the show!

The first example of interest is number two in the guide – the wireless digital and analogue I/O bridge. To me this seems like an interesting wireless “repeater” to some Arduino analogue and digital outputs. Here is my test schematic used for the demonstrations in this review:

schematicss4

and my usual messy breadboards:
bboardss

Well this is a temporary test! The slave module board is running from a 9V PP3 battery so I can take it for a walk.

Anyhow, the setup is – four digital out lines from an Arduino, which are either high or low (+5v or GND). These are connected to pins ‘digital signal’ 1~4 on the master Databridge. Furthermore, Arduino analogue pin 1 went to the Databridge ‘analog signal’ pin 1. At the slave side of things, there are four LEDs with current limiting resistors connected to pins ‘digital signal’ 1~4; and two wires each from ‘analog signal’ 1 would be connected to a voltmeter. The digital output pins on slave modules default to ‘high’ unless driven otherwise.

Finally, there is also an LED and current limiting resistor coming from pin 32 of each unit – the ‘link’ pin. The link pin is a lifesaver. Here is a great feature – when the pair of units are within range of each other and matched as a pair, link goes high (3.3V). Out of range? It goes low (0V). Therefore you can test the range on these modules just by powering them up on a breadboard each, with the LEDs on pin 32, and go for a walk with a unit. When the LED is off – you’re out of range. And when you come back into range, the modules reconnect automatically.

Back to the test. First I just created a loop which turned the digital pins on and off, and the matching LEDs on the slave unit blinked on and off as expected. No extra code, no trying to create wacky functions to multiplex/demultiplex signals – this just works. The modules are like an invisible bunch of wires between two points. Never has anything wireless worked so easily for me.

Here is a quick video clip, first notice the lonely LEDs on each breadboard – the are the link LEDs. When I power cycle the master or slave, notice how quickly they reconnect. Please note that the slave unit retains the state of the digital outputs if connection is lost. So if a pin is high while connected – if the module loses radio contact, the pin will stay high.

The theoretical maximum working range is quoted as 1km for these 1mW modules. My indoor test allowed a distance of 11 metres, with three concrete walls of a thickness of ~110mm in between. Unfortunately living in my area I could not find a flat, open area large enough to test the maximum open-air range – however considering the indoor ‘concrete wall’ test and my experience with other wireless equipment of this power output, it would be accurate in an outdoor, line-of-sight application. As always, conduct your own real-life tests before making any project commitments  and so on.

And as always, I was curious about the current draw of the units while in use. The master module with the link LED on measured 53 milliamps, with the slave at the boundary of the radio range:

macurrss

The current use only dropped around 2 or 3 milliamps when the slave was next to the master. The slave module used 59 milliamps with the link LED on:

slcurrss

Therefore taking the LED current draw into consideration, the power usage of these modules is quite low considering the level of communication between them and the high sampling rate.

The next test was to see how the analogue data lines performed. According to example four in the Getting Started guide, the modules will reproduce an input of between 0 and 2.4 volts DC. So I have placed an 11k ohm resistor in series with a 10k ohm potentiometer with analog input 1, and measured the resulting output from the slave. Notice how I still have the digital data lines in use while using the analogue line.  Here is a short clip of this in action:

Amazing – a multitasking wireless module. Note that you could always use an op-amp to boost the output voltage back to the 0~5V DC range, an example of this is on page nine of the Getting Started guide.

Those above were but two from the many possibilities available when using these units:

  • wireless serial data links
  • remote on/off control of six items
  • robotics remote control
  • microcontroller I/O wireless extension…

Frankly – if you need to wirelessly connect more than one data line simultaneously, you have an excellent solution with the Databridge modules.

Update! – Radio licensing information:

These modules operate in the 2.4 GHz ISM (industrial, scientific and medical) band. For those in the USA, the Databridge is an FCC-approved “class B” device, and is only for use by OEM integrators (see page 16 of the datasheet.pdf). Starman Electric also state that the Databridge is certified for Canada and the EU (ETSI).

For those here in Australia, these units are operated under the conditions of the Radiocommunications (Low Interference Potential Devices) Class Licence 2000, and I feel are classed as “spread spectrum unit” under the preceding license.

Please conduct your own research with regards to radio transmitter licensing in your area. Furthermore, please read the tronixstuff “boring stuff” here.

But enough about that, where you can get them?

Australian customers can purchase these modules from our local distributor – Interworld Electronics; North Americans and the rest of the world directly via Starman Electric.

Remember, if you have any questions about these modules please contact Starman Electric via their website.

[Note – these wireless modules were loan units received from Starman Electric for review purposes]

Posted in databridge, part review, starman, wirelessComments (7)

Kit Review – adafruit industries XBee adaptor kit

Hello readers

Today we are going to examine a small yet useful kit from adafruit industries – their XBee adaptor kit. The purpose of doing so was to save some money. How? I needed another XBee USB explorer board to connect a PC to an XBee (as we have done in Moving Forward with Arduino – Chapter Fourteen), but they are around Au$33. However I already have an FTDI USB cable, so all I really need is this kit, as it will work with the FTDI cable. So this saves me around $20.

As usual the adafruit kit packaging is simple, safe and reusable:

bagss1

The components included are good as usual, including a great solder-masked, silk-screened PCB and an excess of header pins. Got to love a bonus, no matter how small:

componentsss

This did not take very long to assemble at all. After checking the parts against the parts list, it was time to fire up the iron and solder away. As usual the kit is almost over-documented on the adafruit web pages. But that is a good thing…

gettingtheress

Be careful when you place R3, make sure it doesn’t lean in towards the end of the IC too much, otherwise they could touch, or even worse – stop the IC from being seated properly:

closeicresistorss

Regular readers will know I get annoyed when IC sockets are not included with kits – but for the first time it is fine with me. If you use a socket, the IC will be elevated too much and stop the XBee from being inserted onto the board. But apart from R3 almost stopping the show, everything went smoothly. At the time you need to solder in the 2mm header socket strips for the XBee, the easiest way (if possible) is to seat an XBee in the sockets, then into the PCB:

2mmheadersss

Once you have followed the excellent instructions, the last thing to solder is the pins for the FTDI cable. You can either lay them out flat on the PCB, or insert them through the holes. This is my preferred way, and seating the lot in a breadboard to hold it steady is a good idea:

endheadersss

And finally, we’re finished:

finishedss

A quick check with Windows to ensure everything is OK:

And we are ready for communications. This was a very simple and inexpensive board to assemble – and excellent value if you need USB connection to your PC and you already have an FTDI cable.

Well I hope you found this review interesting, and helped you think of something new to make with XBees. You can purchase the kit directly from adafruit industries.

As always, thank you for reading and I look forward to your comments and so on. Furthermore, don’t be shy in pointing out errors or places that could use improvement. Please subscribe using one of the methods at the top-right of this web page to receive updates on new posts. Or join our new Google Group. High resolution images are available on flickr.

[Note – The kit was purchased by myself personally and reviewed without notifying the manufacturer or retailer]

Posted in adafruit, kit review, part review, WRL-08687, xbeeComments (2)

Moving Forward with Arduino – Chapter 14 – XBee introduction

Learn how to use XBee wireless data transceivers with Arduino. This is part of a series originally titled “Getting Started with Arduino!” by John Boxall – A tutorial on the Arduino universe. The first chapter is here, the complete series is detailed here.

Updated 02/03/2013

We will examine the Series 1 XBee wireless data transceivers from Digi in the USA. Although in the past we have experimented with the inexpensive 315MHz transmit/receive pair modules (chapter 11), they have been somewhat low in range and slow with data transmission. The XBee system changes this for the better.

First of all, what is an Xbee module? It is a very small piece of hardware that can connect wirelessly with another using the Zigbee communication protocols. There are many different models, including aerial types and power outputs. In this tutorial we’re using Series One XBees.

From Wikipedia, Zigbee is:

ZigBee is a specification for a suite of high level communication protocols using small, low-power digital radios based on the IEEE 802.15.4-2003 standard for wireless home area networks (WHANs), such as wireless light switches with lamps, electrical meters with in-home-displays, consumer electronics equipment via short-range radio. The technology defined by the ZigBee specification is intended to be simpler and less expensive than other WPANs, such as Bluetooth. ZigBee is targeted at radio-frequency (RF) applications that require a low data rate, long battery life, and secure networking.

Phew. For this chapter I will try and keep things as simple as possible to start off with. Here is an image of a typical Xbee unit:

Note that the pin spacing is small than 2.54mm, so you cannot just drop these into a breadboard. However for the purposes of our experimenting more equipment is needed. Therefore I am making use of this retail package from Sparkfun:

xbeeretailpackopenedsmall

This bundle includes two Xbee modules, an Xbee shield to connect one of the modules to an Arduino Uno-style board. When it comes time to solder the sockets into your shield, the best way is to insert them into another shield that is upside down, then drop the new shield on top and solder. For example:

solder2s

Finally, the bundle also includes a USB Explorer board, which allows us to connect one Xbee to a personal computer. This allows us to display serial data received by the Xbee using terminal software on the PC. One can also adjust certain Xbee hardware parameters by using the explorer board such software.

Let’s do that now. You will need some terminal software loaded on your computer. For example, Hyperterminal or Realterm. Plug an Xbee into the explorer board, and that into your PC via a USB cable. Determine which port (for example COM2:) it is using with your operating system, then create a new terminal connection. Set he connection to 9600 speed, 8 bits, no parity, 1 stop bit and hardware flow control. For example, in Hyperterminal this would look like:

Once you have established the connection, press “+++” (that is, plus three times, don’t press enter) and wait. The terminal screen should display “OK”. This means you are in the XBee configuration mode, where we can check the settings and change some parameters of the module. Enter “ATID” and press enter. The terminal window should display a four-digit number, which is the network ID of the module. It should be set by default to 3332. Unless you plan on creating a huge mesh network anytime soon, leave it be. To be sure your modules will talk to each other, repeat this process with your other XBee and make sure it also returns 3332. However as this is the default value, they should be fine.

Now for our first example of data transmission, insert one Xbee into the explorer module, and the other into the Xbee shield. With regards to the Xbee shield – whenever it is connected to an Arduino board and you about to upload a sketch, look for a tiny switch and change it to DLINE from UART. Don’t forget to change it back after uploading the sketch. See:

shieldswitchss

We are going to use the two Xbee modules as a straight, one-way serial line. That is, send some data out of the TX pin on the transmit board, and receive it into the terminal on the PC. Now upload this sketch into your Arduino board. This is a simple sketch, it just sends numbers out via the serial output. Then set the switch on the shield back to UART, and reset the board. If you can, run this board on external power and put it away from the desk, to give you the feeling that this is working 🙂

Note: More often that not one can purchase AC plug packs that have USB sockets in them, for charging fruity music players, and so on.

acusbss

Or you might have received one as a mobile phone charger. These are great for powering Arduino boards without using a PC. Now ensure your explorer module is plugged in, and use the terminal software to connect to the port the explorer is plugged into. After connecting, you should be presented with a scrolling list of numbers from 0 to 99, as per example 14.1 sketch:

numbers

How did you go? Sometimes I used to get the COM: ports mixed up on the PC, so that is something to keep track of. If you are powering both Xbees from your PC using USB cables, double-check the terminal software is looking at the explorer board, as an Arduino transmitting serial data through an Xbee shield will still send the same data back to the PC via USB.

Now that we have sent data in one direction, we can start to harness the true power of Xbees – they are transceivers, i.e. send and receive data. Next, we’ll create an on-demand temperature and light-level sensor. Our arduino board will have a temperature sensor and a light-dependent resistor, and using the terminal on the computer, we can request a temperature or light-level reading from the remote board. More about temperature sensors in chapter two. First of all, the remote board hardware setup:

exam14p2boardss

… and the schematic:

exam14p2schemss

 

It never hurts to elevate your other Xbee:

xbeewallss

For the PC side of things, use the explorer board and USB cable. Here is the sketch. It is quite simple. The remote board ‘listens’ to its serial in line. If it receives a “1”, it reads the temperature, converts it to Celsius and Fahrenheit, and writes the result to its serial out line, which is sent over our Xbee data bridge and received by the host computer. A “2” will result in the analogue value of the photocell to be sent back as a “light level”. Once again we use the terminal software to control the system.  Here is a quick video of the terminal in action:

The speed is quite good, almost instantaneous. By now hopefully you can see how easy it is to end some data backwards and forwards over the ether. The range is only limited by the obstacles between the Xbee transceivers and the particular power output of each model. With example 14.2, there were two double-brick walls between them. Furthermore, we can build fully computer-independent systems that can talk to each other, such as more portable remote controls, or other data-gathering systems. In the next few chapters, sooner rather than later.

LEDborder

Have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column, or join our Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

Posted in arduino, learning electronics, lesson, microcontrollers, RTL-11445, tutorial, wireless, WRL-09819, WRL-11215, xbeeComments (9)


Subscribe via email

Receive notifications of new posts by email.

The Arduino Book

Arduino Workshop

Für unsere deutschen Freunde

Dla naszych polskich przyjaciół ...

Australian Electronics!

Buy and support Silicon Chip - Australia's only Electronics Magazine.

Use of our content…

%d bloggers like this: