Close

Log Book

A project log for The Big Bin

Try to guess the right bin for the different waste : The Game

prostProst 05/14/2018 at 13:260 Comments

Hello everyone and welcome to The BigBin project.

We will summarize our progression, week by week.

On the first day at the CRI, we started initially with the idea to build an autamated waste sorting machine. But they were too much difficulties, so we adapt and decided to make a game for kids, to help them to understand the recycling in France.

Basically our idea is to have a set of trash, the kid pick one of them and he has to put the trash in The BigBin. The trash is scan, then the kid has to push a button of 3 differents colors (which represents the 3 french bins). If the kid guess correctly a green led light up if not a red light up. 

On the first day at the CRI, we basically came out with the idea of the BigBin proejct, and started to make a list of components. 

Next session, we received all the components that we asked, and started to look online, and found a video on Youtube, this video gave us a solid idea on how to use the RFID items with arduino. 

But, even by checking online we couldn't make the LCD screen work correctly, we basically spend the whole 3 hours to try to fix it. 

On day 4 we manage to make the LCD screen work and received a new RFID Reader since the other one broke during soldering. We also tried to make LED work seperatly from the project

On day 5, we manage to make everything work perfectly except for the LED that we won't use anymore in this project. Here is the nearly finished code:

#include <deprecated.h>
#include <MFRC522.h>
#include <MFRC522Extended.h>
#include <require_cpp11.h>

#include <SPI.h>
#include <MFRC522.h>
#include <LiquidCrystal.h>
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

//I2C pins declaration
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); 

#define RST_PIN 9
#define SS_PIN 10
MFRC522 module_rfid(SS_PIN, RST_PIN);

int buzzer = 8;
int led_rouge = 14;
int led_verte = 15;
String line1 = "Present your";
String line2 = "yellow bin trash";

void setup() {
  pinMode(led_rouge, OUTPUT);
  pinMode(led_verte, OUTPUT);
  pinMode(buzzer, OUTPUT);
  lcd.begin(16, 2);
  lcd.backlight();
  SPI.begin();
  module_rfid.PCD_Init();
  lcd.print("Hello");
  lcd.setCursor(0, 1);
  lcd.print("Welcome");
  delay(3000);
  lcd.clear();
}

void loop() {
  lcd.print(line1);
  lcd.setCursor(0, 1);
  lcd.print(line2);

  if ( ! module_rfid.PICC_IsNewCardPresent()) 
  {
    return;
  }

  if ( ! module_rfid.PICC_ReadCardSerial()) 
  {
    return;
  }

  String UID = "";

  for (byte i = 0; i < module_rfid.uid.size; i++) {
    UID.concat(String(module_rfid.uid.uidByte[i] < 0x10 ? " 0" : " "));
    UID.concat(String(module_rfid.uid.uidByte[i], HEX));
  }

  UID.toUpperCase();

  if (UID.substring(1) == "51 41 13 D3") 
  {
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Good Answer 1/2");
    digitalWrite(led_verte, HIGH);
    tone(buzzer, 1200, 100);
    delay(125);
    tone(buzzer, 1200, 100);
    delay(2000);
    digitalWrite(led_verte, LOW);
    lcd.clear();
    lcd.setCursor(0, 0);
    line2 = "brown bin trash ";
    
    //lcd.print("Present your ");
    //lcd.setCursor(0, 1);
    //lcd.print("brown bin trash");
  }

  else {
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Wrong Answer");
    digitalWrite(led_rouge, HIGH);
    tone(buzzer, 200, 750);
    delay(2000);
    digitalWrite(led_rouge, LOW);
    lcd.clear();
  }
}





We still need to make two RFID badge work at the same time, to finish the code part of the project. 

Here is a first look at how our project works

Discussions