Wellington Duraes
Published © GPL3+

Toastmasters Timer

Small board - great value (for how a little Arduino Nano is improving our Toastmasters meetings).

BeginnerFull instructions provided8 hours4,975
Toastmasters Timer

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
×1
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
Any generic buttons
×8
5V power supply
×1
Resistor 330 ohm
Resistor 330 ohm
×1
Female Header 15 Pin
To hold the Arduino Nano
×2
Breadboard (generic)
Breadboard (generic)
×1
LED (generic)
LED (generic)
6 Red, 6 Yellow, 6 Green
×18

Story

Read more

Schematics

The Circuit

Code

ToastMasters Timer Code

Arduino
/*
 * ToastMasters timer
 * Created by: Wellington Duraes
 * Rev 0: Jan 13, 2017
 * Rev 1: Mar 8, 2017
 * Rev 2: Mar 19, 017 - Shipped!
 * Speakeasy ToastMasters Club
 */

#include <LiquidCrystal.h>
#include <SPI.h>

int EngageTimer = 0; 
int RedLED = 0; // Control the Red LED
int YellowLED = 0; //same for Yellow LED
int GreenLED = 0; //Same for Green LED

int RedTS = 10000; //Store the time threshold to turn the LED Red
int YellowTS = 10000;
int GreenTS = 10000;

String DisplayText ="";

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
unsigned long Start, finished, elapsed;

void setup() {

  pinMode(2,OUTPUT); //Red LED
  pinMode(3,OUTPUT); //Yellow LED
  pinMode(4,OUTPUT); //Green LED
  pinMode(A0,INPUT_PULLUP); // Std Speech button
  pinMode(A1,INPUT_PULLUP); // Table Topics button
  pinMode(A2,INPUT_PULLUP); // Evaluation button
  pinMode(A3,INPUT_PULLUP); // Start timer button
  pinMode(A4,INPUT_PULLUP); // Green button
  pinMode(A5,INPUT_PULLUP); // Yellow button
  pinMode(5,INPUT_PULLUP); // Red button
  pinMode(6,INPUT_PULLUP); // Stop/Reset button

  //setting up the LCD display
  lcd.begin(16, 2);
  lcd.print("  Toastmasters ");
  lcd.setCursor(0,1); // set the cursor to first character on line 2
  lcd.print("  Timer V1.0  ");
  delay(3000); // wait 2 seconds
  lcd.clear(); // clear the display

  lcd.print("Mar 2017 by");
  lcd.setCursor(0,1); // set the cursor to first character on line 2
  lcd.print("WellingtonDuraes");
  delay(3000); // wait 2 seconds
  lcd.clear(); // clear the display
  
  lcd.print("Select an option");
  lcd.setCursor(0,1); // set the cursor to first character on line 2
  lcd.print("   to begin");
}

void loop() {
 
//LEDs output control

      if(GreenLED==1){digitalWrite(4,HIGH);}
      else{digitalWrite(4,LOW);}
        
      if(YellowLED==1){digitalWrite(3,HIGH);}
      else{digitalWrite(3,LOW);}
        
      if(RedLED==1){digitalWrite(2,HIGH);}
      else{digitalWrite(2,LOW);}

//Check for Green/Yellow/Red button pressed

      if(digitalRead(A4)==LOW){
        GreenLED = 1;
        RedLED=0;
        YellowLED=0;}

      if(digitalRead(A5)==LOW){
        YellowLED = 1;
        RedLED=0;
        GreenLED=0;}

      if(digitalRead(5)==LOW){
        RedLED = 1;
        YellowLED=0;
        GreenLED=0;}

//Check for Stop button pressed

      if(digitalRead(6)==LOW){ 
          EngageTimer=0;
          elapsed = 0;
          GreenLED=0;
          YellowLED=0;
          RedLED=0;
          lcd.setCursor(8,1); // set the cursor to 8th character on line 2, while keeping the time onthe screen for note taking
          lcd.print(" STOPPED");
      }  

//Check for Std. Speech button pressed

      if(digitalRead(A0)==LOW){ 
        EngageTimer=1;
        elapsed = 0;
        Start= millis(); //capture the moment when the button was pressed
        GreenTS = 300; //green light on at this time
        YellowTS = 360; //yellow light on at this time
        RedTS = 420;  //red light on at this time
        DisplayText = "Std. Speech     "; //text to be displayed in the LCD while the timer goes on
      }

//Check for Table Topic button pressed

      if(digitalRead(A1)==LOW){
        EngageTimer=1;
        elapsed = 0;
        Start= millis(); 
        GreenTS = 60; 
        YellowTS = 90;
        RedTS = 120;
        DisplayText = "Table Topic     ";
      }

//Check for Evaluation button pressed

       if(digitalRead(A2)==LOW){
        EngageTimer=1;
        elapsed = 0;
        Start= millis();
        GreenTS = 120; 
        YellowTS = 150;
        RedTS = 180;
        DisplayText = "Evaluation      ";
      }


//Check for Custom Timer button pressed

      if(digitalRead(A3)==LOW){
        EngageTimer=1;
        elapsed = 0;
        Start= millis();
        GreenTS = 600000; 
        YellowTS = 600000;
        RedTS = 600000;
        DisplayText = "Custom Timer    ";
      }

//Check if the timer is engaged (as a result of any of the 4 events above)

      if(EngageTimer==1){
          float h, m, s, ms;
          unsigned long over;
          elapsed = millis()-Start;
          h = int(elapsed / 3600000);
          over = elapsed % 3600000;
          m    = int(over / 60000);
          over = over % 60000;
          s    = int(over / 1000);
          ms   = over % 1000;
          lcd.setCursor(0,0);
          lcd.print(DisplayText);
          lcd.setCursor(0,1);
          lcd.print(m, 0);
          lcd.print("m ");
          lcd.print(s, 0);
          lcd.print("s           "); 
      }


//LED on/off control: checks elapsed time and compare it with LED thresholds
          
          if((elapsed/1000)>=GreenTS){
            GreenLED=1;
            YellowLED=0;
            RedLED=0;}
           
           if((elapsed/1000)>=YellowTS){
            GreenLED=0;
            YellowLED=1;
            RedLED=0;}
          
           if((elapsed/1000)>=RedTS){
            RedLED=1;
            YellowLED=0;
            GreenLED=0;}
      
}

Credits

Wellington Duraes

Wellington Duraes

2 projects • 7 followers

Comments