Photo of the R2-4U Robot

The code for this project can be found on GitHub

I recently worked with two friends of mine on a project we called R2-4U. It is a prototype of an R2-D2 “toy” that is able to capture environmental data, store it on a local microcontroller, and display that data when connected to a computer that is able to run Java.

Components

and of course a small breadboard to solder all of these components together.

By default, this project is set up for an Arduino Leonardo. In order to use other versions of the Arduino or other microcontrollers, some pin configurations may need to change. Please refer to the components links below for details on how to set up each component for your device.

OverView

In order to store specific data, the Arduino EEPROM library is used to manipulate the Arduino’s built in storage space. The program fills the storage up to the 510th address. The other two addresses, 511 and 512, are used as control bits.

The 511th address is used to store the previously written to address. This way, the device can lose power and pick up where it left off recording when plugged back in.

The 512th is used a control bit to tell the program when to write to the EEPROM and when to read from it. If the device is set to read, it will wait until the user opens a Serial monitor before releasing the data. A java program has been written with this library to take the data from the EEPROM and display it in a user-friendly graph.

The java program collects data from the Virtuabotix DHT22 Temperature & Humidity Sensor and creates a graphical representation of the data collected over time.

Usage

In order to use the application, you first need to install Java and set up the RXTX Java library.

Download or clone this project and navigate to the ArduinoToy/sensational_toy.ino file. Load this into your Arduino IDE, compile, and install.

Notes and Customization

This project can easily be customized to match your hardware. All of the function and variable definitions are found in the R24U.h file.

Most of the main values (pin configurations, alert values, and others) can be manipulated using the given “setter” functions found in the R24U.h file.