Bluetooth Based Timer

SRJT09301

Jugaadu's mother is a teacher. She was told that some students couldn’t complete the exam on time due to losing track of time. As there are the multiple tasks that an examiner has to handle, it becomes quite difficult to track the time. She told about this issue to his son. Jugaadu is planning to help his mother as well as students to get track of time so that students can complete their exam. Let us see how does he help his mother?

  1. Arduino UNO UNO
  2. Jumper Wires
  3. USB Cable
  4. Foamsheet
  5. White Paper
  6. Gluegun
  7. Bluetooth module
  8. Servo Motor
  9. Cutter
  10. Breadboard
  11. Scale
  12. Icecream Sticks
We can make a timer with the help of Bluetooth module and servo motor. After every 45 minutes, Bluetooth module will send the signal to Arduino UNO to rotate the servo motor. This way servo motor rotation will be seen by everyone annd thus students can easily keep the track of time.

    #include  
#include  

Servo myServo; 
int TxD = 11; 
int RxD = 10; 
int servoposition; 
int servopos; 
int new1; 
SoftwareSerial bluetooth(TxD, RxD); 

void setup() { 
int pos=0; 
myServo.attach(9); 
myServo.write(0); 
Serial.begin(9600); // start serial communication at 9600bps 
bluetooth.begin(9600); 
} 

void loop() { 
if (bluetooth.available()) 
{ 
String value = bluetooth.readString(); 
servoposition = value.toInt(); 

if (value.toInt() == 0) 
{ 
Serial.println(servoposition); 
myServo.write(0); 
} 

if (value.toInt() == 45) 
{ 
Serial.println(servoposition); 
myServo.write(45); 
} 

if (value.toInt() == 90) 
{ 
Serial.println(servoposition); 
myServo.write(90); 
} 

if (value.toInt() == 135) 
{ 
Serial.println(servoposition); 
myServo.write(135); 
} 

if (value.toInt() == 180) 
{ 
Serial.println(servoposition); 
myServo.write(180); 
} 

while(value.toInt()==1){ 
if (bluetooth.available()) 
{ 
value = bluetooth.readString(); 
Serial.println(value); 
if (value.toInt()==2) 
{Serial.println("YYY"); break; } 

} 
servopos++; 
delay(30); 
Serial.println(servopos); 
myServo.write(servopos); 
if (servopos ==180 ) 
{servopos=0;break;} 
}}}