Arduino wireless communication - arduino

So what is the easiest way to get started? There are so many options available it's hard to decide, from a beginner's standpoint, which is the best.
What is the best option for simple wireless communication? That is, communication from a controller to move a robot, or from an arduino to relay information back to a computer for processing.
Drawing from your experiences, what's the 'best' option in your opinion?

Bluetooth would be the most flexible, however I believe xbee to be the easiest. Software wise xbee is exactly the same as serial an even allows for wireless reprogramming and the higher end ones have some serious range.

Bluetooth can be easy if you have a Bluetooth device you're trying to talk to (e.g. Mac-book or Smartphone). The problem is that Bluetooth radios for the the Arduino are still (in 2013) expensive. A Bluetooth radio usually costs more than an Arduino! Low Power Bluetooth may be an option as well. Essentially, Bluetooth is a simple serial transfer of data so you have to create your own protocol on both sides.
Bluetooth Low Energy BLEis an emerging technology and is available on some new devices (recent iPads, macbooks etc: Supoorted Devices ), this may or may not meet your requirements.

Related

Porting Arduino serial communication to standalone atmega328

I have a fairly complex project done on Arduino2560, which I want to port to a standalone Atmega328. My problem is that one feature in the project is that it can communicate with my computer via serial (I made a C# program to handle it on the computer side, using the COM3 port). However, Arduino uses the USB communication for a virtual serial port, and I got a bit confused about how it could be done for the Atmega. It has the RX-TX lines, but what's next? Maybe use some serial-USB converters? What's the best approach for this? Is there anything I should be careful about?
Thanks.
Considering you mention a specific port COM3 on your computer I guess we can assume you have a native RS-232 port (one of those with the sub-D9 male connector that we were used to in the old days but are not so common anymore).
If that's the case, then you can get an RS232 level shifter. You'll just have to make the connections to RX, TX, Vcc, and GND and this device will change the RS-232 voltage levels to whatever your board requires (most likely 5V or 3.3V). Some (maybe most) high-end development boards include this kind of level shifter so maybe check yours in case you already have it (if you do you'll probably see a MAX232 IC somewhere). Or if you are crafty you can also DIY.
If you prefer to connect to a USB port (then, of course, it won't be COM3unless you explicitly change the configuration on Windows Device Manager) you can go for a USB-to-serial adaptor. On that front, you have many choices, starting from the cheapest at maybe 5$, but I'd rather choose one based on the FTDI chip, which is nowadays quite ubiquitous and has proven its reliability. This one is a good example, and at the same cost as the level shifter.
Now, are there any differences between using the native RS-232 or the USB adaptor? The answer is, for most practical purposes, no. If you go to the fine details, like buffer sizes, there will be differences, but if you need to go there you'll need to study the details in both cases to see if the port you have (or the one you're planning to add) meet your needs. For most scenarios, I would choose the USB, if only because you have it everywhere (most laptops don't have a native RS-232).
All of the above (based on RS-232 and/or USB) will work fine for cables running up to 5 meters (~15 ft.) for USB or maybe 10 to 15 meters (~30-45 ft.). This should be enough for most hobbyist or at-home projects. If you want to run longer cables you'll have to go for something like RS-485.
If you choose now the USB adaptor and you think you might need to relocate your board in the future to end up more than 20 meters (15 of RS-232 + 5 of USB) away from your computer just make sure your adaptor includes a TX Enable signal (TXEN). Most adaptors based on the FTDI chip will have this signal on a pin (like the one I linked above), and that will make your life way easier if you want to use RS-485 on a two-cable half-duplex bus.
EDIT: based on the feedback below there is new info that deserves a quick update.
First, you don't have an old school RS-232 port on your PC and second you have to design the connection on the microcontroller's side.
With that in mind it's clear you have to go for the USB solution. But you need to choose if you shift both sides to RS-232 levels or you stay at TTL. That decision depends again on the length of your bus. If it'll be really short (up to 2 meters) then you can stay on TTL, otherwise better shift to RS-232 to be on the safe side. There are many people who will tell you they have much longer serial links but how reliable they are you'll never know.
Since you have to design the board, I guess it makes sense to integrate the MAX232 and a sub D-9 connector there and get the cable you mentioned for your PC.
Or, you can add only a connector on the board and get the Sparkfun level shifter I linked above for the micro's side plus the same USB to RS-232 for your PC.

Raspberry communication with multiple Arduino's over long distance wire

Recently i was digging information about communication between RaspberryPi and multiple Arduino slaves over long distance wire (10-15 meters). My initial thought was to use I2C, but after doing some research i have found out that wire length is a problem since it does not capable to transit/receive data over such a distance. Maybe someone would have any suggestions?
I was thinking about another approach - communication over ethernet (using shields). I would place a switch between all the Arduino nodes and Raspberry with multi threaded TCP server on RPI. Does it sound reasonable?
P.S. Wireless communication methods are not allowed.
You can use one of many standards for communications, such as RS-485 or CAN-bus. Both of those allow for "long" distances, but the longer the wire, the slower the speed.
You will need transceivers for each device, but you can buy pre-made modules for quite cheap.

Whether ibeacon and sensortag are same?

I know both are bluetooth smart devices. I need to know whether both can be used for the same applications. If not what do they have in common and what is different about them?
A sensortag can be configured to be an iBeacon, but it is designed to be a more generic Bluetooth LE device that can be put to many other uses as well, providing many other Bluetooth services.
An iBeacon is a very specific type of Bluetooth LE device, and many types of iBeacons can only perform that one function.
Because a sensortag is so generic, it is not optimized to be an iBeacon. Its battery, for example, will not last a super long time when acting as an iBeacon.
A TI "Sensortag" is basically just an eval board for the CC2540 / CC2541 BLE chips.
Most hardware "iBeacon" implementations use either that chip, or the competing NRF51822, on a more specialized custom board.
In either case, the transmission of "iBeacon"-formatted BLE advertising packets is controlled by the custom firmware loaded into the device.
The duty cycle, which is the major determination of power consumption, is also determined by the firmware. The Sensortag does have some other onboard peripherals, but if the design is sane it should be possible to get those into a negligible powered-down state.
Answering #TimTisdall comment (below), the following link is a 3rd party, non-official iBeacon-enabled firmware update for TI's 2541DK SensorTag hardware:
hex firmware files, demonstrating iBeacon on the cc254x
For more info regarding SensorTag, see:
http://www.ti.com/ww/en/wireless_connectivity/sensortag
&
http://www.ti.com/tool/CC2541DK-SENSOR
This question was a bit ahead of the time and here are some updates: The SensorTag now officially supports iBeacon technology. Information on how to configure it to act as an iBeacon is described in the wiki.
As davidgyoung already pointed out: it wasn't build to solely work as an iBeacon, so it may come with reduced battery life. On the other hand, it provides more functionality, which makes it a valuable tool for development at a good price tag.
As noted before the SensorTag has many other sensors on board. Using a "generic" iBeacon firmware on the SensorTag results in a high current consumption. The unused sensors need to be put into sleep mode (I believe it was the Gyro implementation, which eats a lot of power when not configured correctly in sleep mode).

A relatively large Bluetooth network

Is it possible and will it be efficient to build a large network of mobile devices over Bluetooth?
For example all Bluetooth enabled devices in a large building so that any device can exchange a small object with any other device in the network through some devices that are in between?
Bluetooth is not meant for that. Interference will be a problem if the devices use a high enough TX power level so that all of them can communicate with each other. You can come with a smart application that can forward messages and restrict range of communication to a smaller area, but you'd be reinventing the wheel.
Look into Zigbee or XBee radios instead, this is exactly the scenario they were designed for.

How do I use Zigbee to communicate to a laptop?

What I have in mind is having a number of sensors (temperature, accelerometer, sound level meter) that are controlled by a micro controller. What I want to do is take this information and transmit it wireless to a laptop that will take this information and put it on to a web server using Zigbee. I don't know where to start.
Since you don't have any hardware as of yet, you might want to give the Arduino a try. The hardware is affordable, can be connected to your system via USB while being programmable in-system.
The basic board can be extended via so called "shields", which offer additional features. In your case, the XBee shield would be appropriate. Connecting your laptop to a XBee module is as simple as using Sparkfun's breakout board and a mini-USB cable.
The Arduino has a large community, so you will find a lot of resources, like books, online material, example code etc.
We also provide wireless modules that can be used for serial data transmission. They can be found at www.starmanelectric.com Our modules are very similar to the xbee, but more plug and play. They can be a great for going wireless for the first time. Our devices are designed to function like a "wireless cable" so if you're used to using wires then you'll be up and running in no time at all. We also have circuit examples for transmitting to a laptop serial port or USB. Any micro-controller will be fine for this application, as long as it has a serial port and a few ADCs to sample your data. Our modules also provide simple analog in/out which can run in parallel to the serial. If you want to compare to other systems, I would google "wireless serial modules"
Regards,
Michael
Starman Electric

Resources