Introduction: Marble Coaster

This Marble Roller Coaster features a track filled with twists for marbles to travel down and a wheel that can lift the marbles back to the starting position. The wheel can be controlled through an IR remote allowing the user to remotely enable the system

This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com)

Step 1: Components

3D Printed

Track

Wheel

Wheel Cover

Wheel Cover Mount

Motor Mount

Track Base

Electrical

Arduino Uno

330 Ω Resistor

Red LED

Jumper Cables

IR Remote Sensor

IR Remote

Geared 5V Motor

11.1V 2S LiPo Battery


Miscellaneous

13" x 10" Sheet of Plywood

Hot Glue

Step 2: Assembly and Wiring

General Assembly

After printing all the parts assemble them as shown above on your sheet of plywood. Place the track on top of the track base and hot glue it on. Align your wheel cover to match its holes with the entrance and exit points of the track. Then place the wheel cover mount onto the track base and hot glue it to the wheel cover so it is situated properly and the alignment is maintained. Then hot glue the wheel cover mount to the track base and the wheel cover should be properly fixed. Attach three jumper cables to the IR sensor and glue the sensor to the hole present in the track base. Feed the wires of the motor to the bottom of the motor mount and hot glue the motor into its seat ensuring that the protrusion of the motor aligns with the holes in the motor mount. Simply attach the wheel onto the motor then and glue the motor mount assembly onto the plywood. Then align the track base - track assembly with the wheel. Once you have your alignment hot glue it onto the sheet of plywood.

Wiring

To wire the Arduino and motor controller begin by plugging in the inputs of the left motor controller into Arduino digital ports * and 7. The motor enable will be plugged into port 6. The IR sensor will be plugged into digital port 12 and its respective 5V and GND pins will be plugged into the Arduino. The Arduino will be powered by the LiPo battery which is connected to the motor controller. This means that we will need to take the 5V output from the motor controller and wire it into the Vin and GND of the Arduino. Lastly, the motor will be plugged into the K2 port of the motor controller.

Step 3: Arduino Sketch

The Arduino sketch is the code necesarry for the Arduino to properly run the coaster. The code is posted below.

#include

int RECV_PIN = 12; IRrecv irrecv(RECV_PIN);//instantiate a IR receiver object decode_results results;//instantiate a decode_results object. This object is separate from the IR receiver.

void setup() { // Initializing ports and setting default 0 values to clear transistors Serial.begin(9600);

pinMode(12,INPUT);// IR pin is input

pinMode(7,OUTPUT);// H-bridge pin pinMode(8,OUTPUT);

pinMode(6,OUTPUT);//Enable pin

pinMode(9,OUTPUT);//LED pin

//Setting all values to 0 digitalWrite(7,1); analogWrite(6,0); digitalWrite(8,0); digitalWrite(9,0);

irrecv.enableIRIn(); // Start the receiver }

void loop() { if (irrecv.decode(&results)) {//has a transmission been received? Serial.println(results.value);//If yes: interpret the received commands... if(results.value==16718055){ //When up button is pressed input pwn for enable of motor and turn LED on analogWrite(6,50); digitalWrite(9,1); } if(results.value==16730805){ // When down button is pressed disable pwm for enable of motor and turn LED off analogWrite(6,0);

digitalWrite(9,0); }

irrecv.resume(); // Receive the next value } }