The wireless communication via Xbee between a moving 6 wheel robot controlled by an Arduino and a desktop computer with Labview will become very slow as soon as a wireless network with an IP camera is added. This becomes an issue when steering the robot in real time. Therefore Labview & Arduino communication via ethernet is desired.
As many posts in several forums already stated the LabVIEW Interface for Arduino Toolkit is not setup to support communication via ethernet. It only supports serial communication via Xbee or USB.
The problem can be solved by using a wireless USB sharing station as part of an existing wireless network.
The setup and configuration I used are described below.
Windows 7, Netgear WNA3100 N300 Wireless USB Adapter, Labview student edition 2011 installed, Arduino software incl. driver installed.
Wireless Network: Router Linksys WRT54GL, IOGEAR Wirless 4-Port USB Sharing Station GUWIP204
1. Upload the LIFA to the Arduino while it is connected via USB cable to one of the computers USB ports. I am using an Arduino UNO.
2. Setup your wireless network, if not already done.
3. Install the USB Sharing station as described in the manufacturer’s setup instructions.
Use the Arduino as USB device and connect the Arduino’s USB port to one of the USB
ports of the USB Sharing Station.
4. Open the IOGEAR Wireless USB Sharing Station software.
The IOGEAR software will recognize the Arduino.
5. After installation, the Arduino has to be connected manually, using the IOGEAR software.
6. Check in the Windows device manager which port has been assigned to the Arduino.
in this example COM Port 6 is used for the Arduino Uno.
7. Update the Labiew vi and set to the correct USB port and speed.
Run your vi, application,….
The I/O expander described in this post provides a total of 24 digital I/O ports as well as 16 analog ports. Each MCP23017 provides 16-bit, general purpose parallel I/O expansion for I2C bus or SPI applications. The 74HC4051 is a 8-channel analog multiplexer/ demultiplexer. The PCB shown below includes 2x MCP23017 and 2x 74HC4051.
The Arduino sketch is based on the wire library and the MCP23017 library from Adafruit. In this application the Analog In pins A0 and A1 of the Arduino board are used as inputs for the data from the analog mux/demux. The addresses for the 4051 and the ports are selected by utilizing the GPA port of one of the digital IO expanders MCP23017 and the I2C bus.
MUXREV1: PCB assembled
MUXREV1: PCB Layout
Resistors at ports X0 – X7 of the 74HC4051: The assembly and the values of these resistors at the individual ports depend on the application. For example, if used to read voltages in combination with an Arduino UNO, the voltage at the port should not exceed 5V, unless the settings for the AREF pin have been changed. The values in the schematic are only examples. The values of the resistors that have been assembled have to be entered into the sketch to enable the calculation of the actual voltage at the terminal.
The VEE pin of the 74HC4051 is connected to GND via resistor R9: 0 Ohm, since only voltages >0V will be measured.
IC5, IC6: MCP23017 The addresses for IC5 and IC6 are hardwired on the PCB, they are also shown on the silkscreen of the PCB. Interrupts A and B for each MCP23017 (IC5, IC6) are available at terminals, if needed. The RESET pins of IC5 and IC6 are connected to VCC.
An Arduino with L293D dual h-bridge and a TV IR remote control are driving a pan tilt head with video camera.
The schematic of this PCB is based on the Arduino Duemilanove PCB with 5V voltage regulator, serial interface and ISP interface to program the bootloader.
In addition it includes the circuitry needed to control a video camera via LANC, as well as two motor controller L293D and an IR receiver. The first L293D is configured to drive two DC motors, in this case the pan and tilt motors of the DAIWA pan tilt head that has been described in a previous post. The second motor controller is configured to drive a stepper motor. There is also a breadboard area on the PCB for modifications and extensions.
Setup & Operation:
After the controller is turned on the pan tilt head moves during boot up into a horizontal position. The LEDS will light up to indicate when the setup is completed. They will also show if the 25 pin cable is connected correctly or not, in this case the setup will stop and only continue once the error has been corrected.
Two analog input pins of the Arduino are reading the voltages from two potentiometers in the DAIWA head. This allows to control the actual position of the head, avoiding damage to the motors and gears by stopping the movement before the end positions are reached.
One LED will also start blinking if the battery voltage drops below 8.2 Volt.
Running the motor controller for the pan tilt head via IR without the program part/code for the LANC works fine. The LANC commands are also executed without problems as long as the serial connection is used and the IR library is not implemented, but integrating the code for both applications and driving the head and the camera together via IR does currently not work.
Here is the code for the IR remote control of the pan tilt head: L293D-IR
The dual H Bridge L293D, in combination with an Arduino Uno, can drive the DAIWA APT-3DCP2-B Pan Tilt head, which is also described in this blog.
The PCB includes a 5V regulator to create the required logic voltage for the L293D.
In the photos below you can also see the 25 pin connector for the DAIWA pan tilt head.
PCB with L293D, Voltage regulator and 25 pin Sub D connector
In this application both enable pins of the L293D are connected to +5V.
This PCB/Circuit is a modified version of the schematics and code shown in Tom Igoe’s blog. Instead of one stepper motor, the two DC motors of the Pan-Tilt head are driven by this chip. For more information regarding H bridges, stepper motors, the L293D & Arduino visit the blog of Tom Igoe
6 Wheel Robot Experiment
(This is more a wordpress experiment than a robotic experiement)
6 wheel robot
Main components of the robot:
Micro Controller Board: Arduino Duemilanove,
Motor Controller: TReX Jr,
Prototype Shield for Arduino
Blinking LED Panels,
3 Double Gearboxes, 2 Batteries: 9.6V
Motors with capacitors
For noise reduction a 0.1uF capacitor has been soldered across the terminals of each motor.
Two ferrites are also inserted in the power line to the motor controller to reduce the interference of the micro controller by noise coming from the motors.
Arduino & stand offs
Microcontroller Board Arduino Duemilanove:
The micro controller board is mounted to a prototype PCB for easier handling, assembly/dis-assembly or moving to another project without interfering with the controller. Mounting the micro controller as well as the motor controller on prototype PCBs also allows the stacking of multiple PCBs with different dimensions on top of each other.
Motor Controller: TReX Jr:
Similar to the micro controller board, the motor controller is mounted to a prototype PCB. The TreXX Jr. from Pololu is a DC motor controller that can control two bidirectional motors and one unidirectional motor. For this robot the controller is configured to drive the three gearboxes on the left and right side of the robot independently via the asynchronous serial control interface.
Components of the breakout board:
C1: 10μF electrolyt. capacitor
C2: 10μF electrolyt. capacitor
C3: 0.1μF ceramic cap.
IC1: 5V Voltage regulator, used as power supply for servos.
Q1, Q2 2N7000 transistor,driver transistors for terminals
(J12,J13), in this application used to switch the LED
D1, D2: 2N4001 or 2N4007
S1: Main switch
J1-J13: Terminals (as available)
R1: 1KΩ resistor
R2, R3: 220Ω resistor
LED1: LED (color as available)
J1-J6: Terminals for up to 6 servos.
J8-J11: Terminals to connect other loads to the battery .
J7: Main terminals to connect the power supply/battery.
The Arduino software has been installed on a desktop computer as well as on a net book for mobile application. Computer and robot are communicating via two Xbee modules and the Serial Monitor of the arduino software.
Blinking of the LED Panels is realized by calling a function at the beginning and at the end of the main program loop. The LEDs toggle between ON and OFF each time this function is called. The program is about 80ms long, this creates the blinking effect.
The wireless camera is mounted on two servos. The camera can switch between pan mode or fixed mode, pointing forward, when driving. Switching between modes is done by pressing “p” key on the keyboard.
Forward/backward driving and turning of the robot is also handled via the keyboard of the connected computer.