Final Project – AustinT

Final Project – AustinT

 

Walking can be such a drag, especially when you’re pressed for time. For busy college students, walking from class to class can be quite the hassle. If you’re a commuter and your class is across campus, it usually makes sense to hop back in your car and drive to your next class. Even then, you have to deal with traffic and parking. Beyond just the time it takes and the frustration it causes, these minutes spent driving each day to equate to a lot of time idling and a lot of unnecessary greenhouse gas production. It is estimated that 1/5th of the U.S.’s contribution to climate change comes from automobile emissions.

Luckily, if you want to get across campus fast, not have to find a parking spot, and not emit a bunch of greenhouse gases, you can just ride a bike. Don’t have one?  What if you could take a quick look at your phone, locate a bike near you, and ride it to your next class? That’s our goal with ReCycle.

With ReCycle, all you have to do is swipe your membership card and one of the bike locks on the rack opens via a solenoid motor. You grab your bike, ride to the next rack closest to your destination, swipe your card again, and then put the bike in that new rack. Simple as that. Each rack accommodates a high number of bikes, ensuring you can always find a place to park it.

What sets ReCycle apart from similar projects is that it uses supersonic sensors on each spot. These sensors send data to an Arduino to determine if a bike is parked there or not. The status of each spot is constantly sent to a server that represents this data in a phone application. This way, you can view a map of what spots are available on your campus / in your city.

We initially wanted to create a more efficient campus environment that would both benefit the students, as well as reduce motorized vehicles. Joline introduced us to a project that has been attempted before and asked us to further develop the idea, in which we now call ReCycle.

When asked, 97/106 students said they would be interested in a system like this.

For my final project, I wanted to write the code, with the help of Ian Donnelly, for the bike rack technology. Using Arduino, we created the code for an ultrasonic distance sensor module. If the bike is within 6 centimeters of the sensor, the light will blink green, indicating that there is a bike in that bike rack. If there is nothing within the 6 centimeters the led will shine red indicating that there is no bike available to be taken from that bike rack position.

Budget:

1 Bike rack – ~$500

Arduino Uno w/ Wifi Shield – $45

Solenoids – ~$100

Buttons, LEDs – ~$20

RFID Reader – $10

Welding/Fabrication – ~$200

 

Code for Bike Rack Technology:

 

//This code is for an Ultrasonic Distance Sensor Module. This is being used for a bike rack that will indicate if a bike rack has a bike in it or not, for renting out bicycles. If there is a bike within 6 centimeters of the sensor then the light will shine green indicating there is a bike available. If there is nothing in 6 centimeters by the sensor, the LED will shine red indicating there is no bike to take out from that rack

 

*/

// defines pins numbers

const int trigPin = 9;

const int echoPin = 10;

// defines variables

long duration;

int distance;

// define green led to be lit

int gled = 13;

// define red led to be lit

int rled = 12;

 

void setup() {

 pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output

 // initialize the digital pin as an output.

 pinMode(led, OUTPUT);

 pinMode(echoPin, INPUT); // Sets the echoPin as an Input

 Serial.begin(9600); // Starts the serial communication

}

void loop() {

 // Clears the trigPin

 digitalWrite(trigPin, LOW);

 delayMicroseconds(2);

 // Sets the trigPin on HIGH state for 10 micro seconds

 digitalWrite(trigPin, HIGH);

 delayMicroseconds(10);

 digitalWrite(trigPin, LOW);

 

 // Reads the echoPin, returns the sound wave travel time in microseconds

 duration = pulseIn(echoPin, HIGH);

 // Calculating the distance in cm

 distance = duration * 0.034 / 2;

 

 //if distance is less than 6cm then bike is present

 if (distance < 6) {

   Serial.Println(“Bike Present”);

   digitalWrite(gled, HIGH); //turn green light on

   digitalWrite(rled, LOW);  //turn red light off

   

 }

 //if distance is more than or equal to 6cm then bike is absent

 if (distance >= 6) {

   Serial.Println(“Bike Absent”);

   digitalWrite(rled, HIGH); //turn red light on

   digitalWrite(gled, LOW);  //turn green light off

 }

}