Category Archives: project

Caterpillar iPhone App

shapeimage_1I was hired to add functionality to an existing iPhone app for Caterpillar’s tree harvesting service. The goal is to give Caterpillar the ability to track and record data about their equipment during use.

Data is stored in an Entity model using SQL Lite and the iPhone’s Core Data framework. The app follows a walk-through model, where a user proceeds to add data to a “study” (represented by an entity in the database) and record measurements for that study. The user can also view a history of all studies on the device.

01_1 cat_new_1

MultiType Eclipse Plugin

multitype_ss

As part of this team project for my CS 307 software engineering course, we developed a collaborative editor plug-in for the Eclipse environment. Users are able to share source code files with other users, who can view changes made to a document by other users in real-time, and make their own viewable modifications.

The plug-in integrates seamlessly with the Eclipse IDE, and features an independent server that can be run on any port-forwarded connection. Future versions will support additional editors, with more customizable features.

Update (5/7/11)

Test-drive the plug-in and browse the source code at our project homepage, hosted on Google Code here.

Arduino-controlled Robotic Arm with Android Interface

owi535large

Project hosted on Google Code [LINK].

Continuing my trend of Arduino projects, I decided to toy around with this robotic arm I got for Christmas. The arm is not the best construction, using DC motors instead of servos, but with Adafruit’s motor/stepper/servo shield kit, I think I can make it somewhat more useful.

First to go is the flimsy plastic controller. The motor shield allows up to four of the of five motor joints to be controlled with the Arduino. I want to use this opportunity to explore the Java serial libraries to communicate with the Arduino over the Internet in a Java applet *or* purchase an Arduino ethernet shield and send commands directly to the device (see below).

I suppose, as an overall goal, I would like to be able to feed my fish while away with the use of a webcam and this robotic arm.

Completed Robotic Arm connection to motor

IMAG0138_1 IMAG0135_1

This setup allows control of the maximum of four motors.  I’d rather have everything integrated into one cable, but the supplied cable didn’t have enough pins to handle 4 motors and power and ground.  That’s why I added the red/black leads shown above.  Here’s how everything looks hooked up to the freshly soldered motor shield:

IMAG0140_1

 

Right now the Arduino is powered by USB, and the motors are powered by the arm’s original DC power source — 4 D batteries. This can easily be changed to have the arm run off of a DC adapter.

Next up: Due to the number of pins that the motor shield requires, I won’t be able to use an ethernet shield with this project. So, Java-based serial communication it is!

Update 4/16/11

I wrote a Java application with SWT to handle the serial communication with the Arduino’s motor controller. Essentially, it relays messages over the serial line about what motor to enable. The “speed” of the motor is an illusion by using a custom TimerTask to repeatedly send requests to enable the motor (every 10ms) and then sleep the thread for a duration between each task interval, until the button is no longer pressed. This solution makes the robotic arm much more useful as it can now make very controlled movements (<1mm).

Here is a screen shot of the user interface:

ss

 

Update 9/7/12

I’ve started working on this project again! I decided to clean up some of the code and create an Android app that can control the arm wirelessly (as long as it’s connected to a host PC).

diagram

Project hosted on Google Code [LINK].

Arduino OBD-II Interface

IMAG0131_1

For my CS 497 Spring 2011 course, I worked on an independent study project creating an Arduino-based OBD-II (vehicle onboard diagnostic) interface written in C.

First, I assembled an interface between an Arduino Uno and the ISO9141 bus that most vehicles prior to 2008 use. An open-source project called OBDuino describes how to assemble such an interface, available here. Second, I wrote software for the Arduino to poll information from the vehicle’s engine control unit (ECU), such as instantaneous information like RPM and vehicle speed, and also diagnostic feedback, and display it in real time on an attached LCD screen. Third, I added an Arduino data-logging shield to allow the capturing of long-term data from a vehicle in a spreadsheet-ready format.

Download the presentation I gave on this project.

Download the source code used for this project.

Update – 3/27/11

Since my last progress update, I have written software for the Arduino to:

  • Interface with my automobile’s ISO-9141 bus, and
  • Begin polling for parameter IDs (PIDs)

Before the Arduino can begin polling data from the automobile’s ECU, it must first establish a serial connection. The initialization sequence was adapted from ISO standard 9141-2:1994, available at the Engineering library. Once started, it sends address 0x33 to the ECU at 5-baud to “bit-bang” the ECU and establish a serial connection. The Arduino then switches into normal serial communication at 10.4kbps and waits for a return address of 0x55 from the ECU followed by two keywords. The Arduino sends back the inverse of the second keyword and, upon a response of 0xCC (the inverse of 0x33) from the ECU, the Arduino displays “Init. Success!” on its LCD screen. Initialization usually takes a few seconds to complete, and the connection must be re-initialized if the ECU is not polled for data within 5 seconds.

Screen shot 2011-03-27 at 11.12.07 PM

 

Displayed on the LCD screen above are instantaneous readings from the four PIDs currently polled by the Arduino. Clockwise from the top-left corner, these include:

  • Engine RPM
  • Vehicle speed
  • Mass airflow (MAF) sensor, which can be used to calculate instantaneous MPG
  • Engine coolant temperature

Values update every 200ms on the LCD. Polling for PIDs involves sending a byte-encoded message to the ECU requesting a value for a PID defined in the SAE J1979 standard. The ECU then responds with a byte-encoded value that the Arduino can decode and extract information from to display on screen. Currently, the system only polls for these four PIDs, but will be expanded to poll for several more.

Upcoming Tasks

In addition to adding more PIDs to poll, I will mainly be focusing on implementing a data logger shield to hold data captured by the Arduino and display in spreadsheet form on a computer.

The data logger shield sits on top of the Arduino unit, and uses pins not used by the LCD or serial communication. The shield also contains a real-time clock to add a timestamp next to data read from the ECU. Data is stored on a 2GB SD card.

droppedImage

 

The ability to log large amounts of data from a vehicle demonstrates the usefulness for this system to offer diagnostic capabilities with a high degree of precision and temporal resolution. Implementing and programming this data logger shield, as well as graphically displaying spreadsheet data, should consume the remainder of the time allotted for myproject.

Update – 4/12/11

I’ve added the data logging shield and a way to compute MPG from the MAF (mass air flow) and VSS (vehicle speed sensor) PIDs.

Here are some Excel graphs plotted from data over a 20 minute period (844 data points). Click for larger graphs.

speedxrpm_1

coolantxspeed_1

CityBus iPhone App

ss1_1

CityBus iPhone is currently in development as part of a Purdue ACM SigApp application. As of now we have a tab-based interface with one tab displaying a MapKit UI with route overlays and the other tab with a UITableView representing the route selections. Certain stops can also be turned ‘on’ via annotations. Touching a bus stop annotation opens a UIWebView to display live data from the CityBus website on a certain stop.

The latest version requires iOS 4.0+ and uses the latest API for MKPolylines to draw overlays on the map.

Visit the project page here.