Holmes' Detective Suitcase

by Evelyn8186 in Craft > Cardboard

263 Views, 1 Favorites, 0 Comments

Holmes' Detective Suitcase

IMG_7893.jpg

This is an Arduino project to protect eyes. Since nowadays a lot of people uses the computer, I want to help people to prevent eye problems.

Materials

IMG_7890.jpg

1.Arduino Board

2.Ultrasonic Sensor

3.liquid-crystal display

4.Bread Board

5.Jumpers

6.Handle

7.Scissors

8.Box:18.6* 6.5*13cm

9.Hot Glue Gun

Connect the Components

IMG_7890.jpg

Connect the same as the picture shown above.

Box

IMG_7891.jpg

1. Cut 2 holes for Ultrasonic Sensor. Because it needs to sense your head.

2. Cut another hole for liquid-crystal display, to show the distance between you and your computer

3. Cut 2 holes for handle

Code

#include

#include

// For these LCD controls to work you MUST replace the standard LCD library from... // https://github.com/marcoschwartz/LiquidCrystal_I2C // Direct download https://github.com/marcoschwartz/LiquidCrystal_I2C/archive/master.zip // Your project will not compile until this is done. // LiquidCrystal_I2C lcd_I2C_27(0x27,16,2); int ardublockUltrasonicSensorCodeAutoGeneratedReturnCM(int trigPin, int echoPin) { long duration; pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(20); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); duration = duration / 59; if ((duration < 2) || (duration > 300)) return false; return duration; }

void setup() { lcd_I2C_27.init (); lcd_I2C_27.backlight(); digitalWrite( 6 , LOW );

}

void loop() { lcd_I2C_27.clear(); lcd_I2C_27.setCursor(0.0 , 0.0) ; lcd_I2C_27.print( "Distance:" ); lcd_I2C_27.setCursor(0.0 , 1.0) ; lcd_I2C_27.print( ardublockUltrasonicSensorCodeAutoGeneratedReturnCM( 6 , 7 ) ); delay( 500.0 ); }

Finish!!! :)

IMG_7894.jpg

Now you can have your own Holmes' Suitcase for your health!