Locker Rental
Team Members
- David Li
- Kishore Nathan
- Alfonso Olalla Santamarina
- Mark Woodson
Description
The locker allows safe personal storage without bringing a lock with you. The locker allows deliveries and drop off without having to meet in person. A person comes to rent a locker and store the item inside, afterwards, they create a code to properly lock the locker. When a person wants to unlock a locker, they simply enter the code that was assigned for that designated locker.
Hardware
Required Parts
| Part | Quantity | |
|---|---|---|
![]() | Mbed | 1 |
![]() | uLCD-144 board | 1 |
![]() | Bluefruit LE | 1 |
![]() | LED's | 3 |
![]() | Pushbutton | 1 |
![]() | Relay | 2 |
![]() | Amplifier | 2 |
![]() | Barrel Jack | 1 |
![]() | 5VDC 2A AC adapter | 1 |
![]() | Photocell Light Sensor | 1 |
![]() | Speaker | 1 |
![]() | Magnet | 2 |
Pinouts
| Mbed | 5VDC 2A AC adapter | Pushbutton | uLCD | Bluefruit LE | Speaker | Photocell1,2 | Led1,2,3 | Relay 1,2 | 12V |
|---|---|---|---|---|---|---|---|---|---|
| GND | - | GND | CTS, GND | - | -, -, - | -, -, - | -, - | ||
| Vout | + | ||||||||
| 5V | 5V | Vin | |||||||
| p8 | + | ||||||||
| p9 | RX | ||||||||
| p10 | TX | ||||||||
| p11 | Reset | ||||||||
| p18, 19 | +, + | ||||||||
| p20,21 | +, + | in, in | |||||||
| p26 | + | ||||||||
| p25 | - | ||||||||
| p27 | TXO | ||||||||
| p28 | RXI | ||||||||
| +, + | 12 V |
Schematic
Software
Mbed Program
Import programfinal_projec_4180
fianl project
Code Snippets
Locker
typedef struct Locker {
int used;
int code;
} Locker;
A locker structure which maintains information regarding availability and pass code of the locker, allowing scaleability in the future for more lockers.
int read_code() {
char bnum=0;
int ans = 0;
int len = 0;
uLCD.printf("\nEnter code\n");
while(len < 8) {
if (blue.getc()=='!') {
if (blue.getc()=='B') { //button data packet
bnum = blue.getc(); //button number
myled = bnum - '0';
len++;
if (len % 2 == 1) {
ans = ans * 10 + (bnum - '0');
uLCD.printf("%d", bnum - '0');
}
}
}
}
fill();
wait(1);
return ans;
}
reads in and print back the 4 digit code the user enters, for both setting codes or unlocking the locker
void open_used() {
int locker = read_which_locker();
wait_loop();
if (locker == 1 && l1.used == 0) {
uLCD.printf("\nThe locker is empty");
wait(1);
return;
}
if (locker == 2 && l2.used == 0) {
uLCD.printf("\nThe locker is empty");
wait(1);
return;
}
int code = read_code();
fill();
if (locker == 1 && l1.code == code) {
uLCD.printf("\nLocker 1 is now open");
mag1 = 1;
int lock = 0;
while(light1.read() > .05 || lock == 0) {
lock = lock | button.read();
}
mag1 = 0;
l1.used = 0;
} else if (locker == 2 && l2.code == code) {
uLCD.printf("\nLocker 2 is now open");
mag2 = 1;
int lock = 0;
while(light2.read() > .01 || lock == 0) {
lock = lock | button.read();
}
mag2 = 0;
l2.used = 0;
} else {
uLCD.printf("\nInvlaid locker and code combination");
led = 1;
speaker = .5;
wait(.5);
led = 0;
speaker = 0;
wait(.5);
led = 1;
speaker = .5;
wait(.5);
led = 0;
speaker = 0;
wait(.5);
}
}
determines if the locker chosen is actually in use and whether the code enters is correct
void rent_unused(){
if (l1.used == 0) {
uLCD.printf("\nPlease place item in locker 1, create a code, and close the door");
mag1 = 1;
int code = read_code();
l1.code = code;
l1.used = 1;
mag1 = 0;
} else if (l2.used == 0) {
uLCD.printf("\nPlease place item in locker 2, create a code, and close the door");
mag2 = 1;
int code = read_code();
l2.code = code;
l2.used = 1;
mag2 = 0;
} else {
uLCD.printf("\nSorry all lockers are taken");
wait(1);
}
}
determine if lockers are avalaible and which to allocate for the user
Video Demonstration
Please log in to post comments.













