Bus Buddy
Made by Lillie Widmayer, Jonathan Fortis and Maya Pandurangan · UNLISTED (SHOWN IN POOLS)
Made by Lillie Widmayer, Jonathan Fortis and Maya Pandurangan · UNLISTED (SHOWN IN POOLS)
Created: September 27th, 2019
Overview: Imagine you’re at a coffee shop. You’ve finished your cappuccino and are ready to head home for the night. But, alas! You miss the bus by a minute and have to wait another 45 minutes (and end up spending another $5 on coffee). Our ambient object solves this inconvenience through a real-time, responsive display that reminds people when a bus is fifteen, ten, or five minutes away. The display shows a miniature bus moving towards a bus stop and reminds people when they should be headed on their way to their bus stop.
Conceptual Design:
Context it operates in:
It is a casual display meant to be housed in public spaces like coffee shops, libraries, restaurants, etc
What it does:
A miniature bus “drives” to represent a real bus approaching a nearby stop
How/Why someone interacts with it:
People can casually glance up at the display whenever they want to. These interactions should be completely unobtrusive to their experience at a coffee shop or public space - it simply provides people with relevant and easily digestible information
Brainstorming ideas for project
Design Process:
• Laser cut a bus out of acrylic
• Get timing belt, motor, gears, and plywood to build apparatus bus will move on
• One side of the timing belt is attached to a gear that is attached to a stepper motor
• Other side of timing belt is attached to another gear on a free axis; this is to guide the belt while the other side is being controlled by the motor
//Prev Version (continuously shuttles bus back and forth):
#include "AccelStepper.h"
//Continuously moves bus back and forth. To move forward takes 5 minutes, to move back takes 1 minute
// Remember to set all MS pins high for 16th-microstepping
// defines pins
const int step = D2;
const int dir = D1;
AccelStepper Stepper(1, step, dir);
void setup() {
Stepper.setMaxSpeed(1000);
Stepper.moveTo(5000);
Stepper.setSpeed(200);
Stepper.setAcceleration(0);
}
void loop() {
int time = Time.minute();
transmit("time", Time.minute());
//moves forward 1 step / 2.5 sec for 1200 steps => 5 min to span display
Stepper.setSpeed(25);
while (Stepper.currentPosition() < 1200){
Stepper.runSpeed();
delay(2500);
transmit("position",Stepper.currentPosition());
}
Stepper.setSpeed(-200);
while(Stepper.currentPosition() > 0){
Stepper.runSpeed();
delay(10);
transmit("position",Stepper.currentPosition());
}
Stepper.setSpeed(200);
}
void transmit(char message[],int value){
char valtext[1];
sprintf(valtext,"%i", value);
Particle.publish(message,valtext,PRIVATE);
}
Click to Expand
/*Final Code
send time for next bus through particle function.
This will move the bus if it is at or below threshold
Resources:
https://www.robotshop.com/media/files/pdf/datasheet-1182.pdf
Accelstepper library: https://www.airspayce.com/mikem/arduino/AccelStepper/classAccelStepper.html#affbee789b5c19165846cf0409860ae79
*/
#include "AccelStepper.h"
const int tracklength = 1200; // # clicks to cover whole track
const int threshold = 5; // [minutes] consider this as whole track threshold for next bus
// defines pins
const int step = D2;
const int dir = D1;
// Define Stepper Motor
AccelStepper Stepper(1, step, dir);
void setup() {
Stepper.setMaxSpeed(1000);
pinMode(D7,OUTPUT);
digitalWrite(D7, HIGH);
Particle.function("next", bustime);
}
void loop() {
//waiting to receive next bus time
}
// Receives next bus time [min]
int bustime(String nextbustime){
digitalWrite(D7, LOW);
int bus_time = atoi(nextbustime);
if (bus_time > threshold){
transmit("bus is too far",bus_time);
}
if (bus_time == 0){
transmit("waiting for next bus",1);
}
if (bus_time > 0 && bus_time <= threshold){
transmit("next bus [min]: ",bus_time);
// Calculate motor speed
int speed = tracklength/(bus_time*60);
transmit("speed [clk/sec]: ",speed);
Stepper.setSpeed(speed);
// Run to end of track
while (Stepper.currentPosition() < tracklength){
Stepper.runSpeed();
}
transmit("Bus Arrived",1);
// Run back to start zero time in 6 sec = 1200/(-200)
Stepper.setSpeed(-200);
while(Stepper.currentPosition() > 0){
Stepper.runSpeed();
}
return 1;
}
else {
return -1;
}
}
void transmit(char message[],int value){
char valtext[1];
sprintf(valtext,"%i", value);
Particle.publish(message,valtext,PRIVATE);
}
Click to Expand
This project is only listed in this pool. Be considerate and think twice before sharing.
Thermostats, locks, power sockets, and lights are all being imbued with smarts making them increasingly aware and responsive to their environment and users. This course will chart the emergence of ...more
~