Introduction: Robo-cycler

Robo-cycler is a robot designed to detect different materials like metal and nonmetal materials. We use a Redbot, which is a robotic development platform that allow us to integrate sensor for material detection and program them in Arduino environment.

The Robo-cycler has a neuronal network that is trained to receive inputs from sensors and provide the expected material as an output.

Robo-cycler is intended to identify recycling material and help users dispose them in the right recycling place.

Step 1: What Is Needed?


  1. Metal Sensor (Blue): DC6-36V NPN NC 5mm Inductive Proximity Sensor Detection Switch LJ18A3-5-Z/AX
  2. Metal and Non-metal Sensor (Orange): DC6-36V 300mA NO 3-wire Capacitance Proximity PNP Switch Sensor Detector 1-25mm
  3. Buetooth Bee:BTBee HC-06

  4. Redbot


  • Arduino IDE
  • Processing

Step 2: Assemble the Sensors

Each sensor is assembled in the RedBot Mainboard. Robo-cycler, uses port A2 for Metal Sensors (Blue) and port A3 for Metal & Non Metal sensor. The SW Serial port is used by the Bluetooth sensor.

Step 3: Inputs and Outputs

Robo-cycler receives 2 inputs from the two sensors:

  • metal sensor (blue)
  • metal&non-metal sensor (orange)

and returns a binary output depending on the material sensed.

Please see the picture attached as reference.

Step 4: Code

In this section, we summarize the ARDUINO code used to train our RedBot with a Neural Network and a PROCESSING code to handle the RedBot from a remote controller.

The Arduino CODE is embeded in the RedBot. The Processing is in a remote controller (PC). Both devices communicate via Bluetooth.

Arduino Code:

Neural Network Pseudo Code:

  • Train the Neural Network based on pre-processed training data.
  • Initiate the sensors
  • Loop until exit program
    • Detect remote control input (enter key)
      • W = Backward.
      • S = Forward.
      • A = Left
      • D = Right
      • Z = Sense Metal Sensor (Blue)
      • X = Sense Metal&NonMetal Sensor (Orange)
      • C = Activate Neural Network
      • Write Neural Network results in serial port.

Neural Network Back Propagation (NNBP) Functionality:

The NNBP is implemented using two neurons. Each neuron represents a sensor's input. The sensor's input is a binary (0, 1023) that reflects the absence or presence of the material.

Please refer to the code attached - RedBotArduino.cpp

The Remote Controller code is implemented so users can handle the RedBot movements from a keyboard using the up, down, left, right keys.

Please refer to the code attached - RemoteControl.pde

Step 5: Pre-work

  1. Make sure you have all your hardware and software components described in step 1.
  2. Make sure all your sensors are properly installed as described in step 2.
  3. Open Arduino IDE from your computer and save the code described in step 4.
  4. Turn on the Redbot switch.
  5. In Arduino IDE, go to Tools > Port COM6 and make sure COM6 is selected. Please see screenshot (a.)

Step 6: How to Use It? RedBot Commands

To handle RedBot, you will a series of commands to initiate the Neural Network training, sense the materials with the Metal (Blue) and Metal & Non-Metal sensor (Orange), activate the Neural Network, and clean the training variables.

This chart describes the commands and the expected result of each of them.

Step 7: Results

This video shows on high level of how the RedBot works and some materials that can be detected or not.