Archive for 'arduino'

Arduino with Sparkfun 7-segment Serial Display

Here’s a quick example of getting an Arduino working with a Sparkfun 7-Segment Serial Display. This short example just counts up from zero to 9999.

Connections

  • Arduino 5v pin to “VCC” on LED module
  • Arduino GND pin to “GND” on LED module
  • Arduino TX pin to “RX” on LED module

Source Code


int i = 1;
char buf[12];

void setup() {
Serial.begin(9600);
Serial.print("v");
}

void loop() {

sprintf(buf, "%04d", i);
Serial.print(buf);

if(i<9999) i++;
delay(1000);
}

Serial connection to Seagate Dockstar via FTDI USB-Serial Cable

Here’s a quick summary of how to use a FTDI data cable to connect to a Seagate Dockstar.

Requirements

Making the Connector

  1. Cut the cable of the Xbox power connector in half.
  2. You’re interested in the 3 pins at the top left (looking from behind), so seperate these and strip them.
  3. Snap a strip of male header pins so that you have 5 pins. Remove pins #2 and #3
  4. Solder the top left-most pin (GND) to header pin #1
  5. Solder the top next pin (TX) to pin #5
  6. Solder the top third pin (RX) to pin #4

Connecting

  1. Plug pin #1 of the header pins into the socket to connect to the black cable of the USB-serial cable
    (this will mean that pin #4 goes to the orange, and #5 to yellow)
  2. Open your dockstar and plug the xbox connector onto the header pins (if you orientate your dockstar so the header pins are at
    the top, the xbox top-left wire connects to the dockstar top-left pin)
  3. Plug in your USB-serial cable to your PC
  4. Open putty and use the following connection settings: -
    Serial
    Serial line: COM5 (or whatever COM port the USB-serial adapter has)
    Speed: 115200
    Data bits: 8
    Stop bits: 1
    Parity: none
    Flow control: none
  5. Click “Open” in putty
  6. Power up the Dockstar
  7. Watch the putty window – the boot-up messages should appear.

Connecting an Arduino to a Seagate Dockstar

Here’s a quick summary of how to connect your arduino to a Seagate Dockstar.

Checking connection

1. Install Plugbox Linux on the Dockstar (via http://plugapps.com/index.php5?title=PlugApps:Pogoplug_Setboot )

2. Plug in arduino to Dockstar via USB cable

3. Check arduino recognised

[root@Plugbox ~]# dmesg

The bottom lines should look something like: -

[ 126.200168] usb 1-1.3: new full speed USB device using orion-ehci and address 4
[ 126.382290] usbcore: registered new interface driver usbserial
[ 126.382974] USB Serial support registered for generic
[ 126.383709] usbcore: registered new interface driver usbserial_generic
[ 126.383722] usbserial: USB Serial Driver core
[ 126.401088] USB Serial support registered for FTDI USB Serial Device
[ 126.401283] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected
[ 126.401569] usb 1-1.3: Detected FT232RL
[ 126.401582] usb 1-1.3: Number of endpoints 2
[ 126.401592] usb 1-1.3: Endpoint 1 MaxPacketSize 64
[ 126.401601] usb 1-1.3: Endpoint 2 MaxPacketSize 64
[ 126.401610] usb 1-1.3: Setting MaxPacketSize 64
[ 126.402330] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0
[ 126.403067] usbcore: registered new interface driver ftdi_sio
[ 126.403080] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver

4. Check which device to use

[root@Plugbox ~]# ls -ltr /dev/ttyU*
crw-rw---- 1 root uucp 188, 0 Oct 29 13:17 /dev/ttyUSB0

Communication via Command Line

1. Configure serial port (taken from http://www.arduino.cc/playground/Interfacing/LinuxTTY)

[root@Plugbox ~]# stty -F /dev/ttyUSB0 cs8 19200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts

(19200 should match the baud rate set via Serial.begin(XXXX) in the arduino program)

2. Read data from arduino: -

[root@Plugbox ~]# cat /dev/ttyUSB0

3. Send data to arduino: -

[root@Plugbox ~]# echo "Hello Arduino" > /dev/ttyUSB0

Communication via Minicom

1. Install minicom

[root@Plugbox ~]# pacman -Sy minicom

2. Fire up minicom

[root@Plugbox ~]# minicom -D /dev/ttyUSB0 -b 19200