Introduction: (TFcd Practicals) Parents' Eyes

Remember when your parents were warning you when your eyes were too close to the laptop screen? This project is an “electronic eye” to alarm you when you put your face too much close to the screen.

The result is a mixed of Arduino and 3D printing technology. which enable you to print your own shape of shell that is fixed on your own screen laptop.

Xinjie Zhang

FIlippo Petrocchi

Step 1: Building the Arduino Circuit

These are all the components you need.

Components:

Arduino

1 small bread board

1 HC-SR04 ultrosonic sensor

Vcc connect to 5V on Arduino

Trig connect to Pin 2

Echo connect to Pin 3

GNG to GNG on Arduino

1 Buzzer

1 330Ω resistor

Cables

1 Battery

3D printed shell

tape

<p>Code:<br>#define trigPin  2
#define echoPin 3
#define alarm 11</p><p>int range =15;<br>// changing this value you change the distance 
void setup() {
  Serial.begin(9600);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);</p><p>}<br>void loop()
{</p><p>  long duration, inches, cm;
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  inches = microsecondsToInches(duration);
  cm = microsecondsToCentimeters(duration);
  
  Serial.print(inches);
  Serial.print("in, ");
  Serial.print(cm);
  Serial.print("cm");
  Serial.println();
  
  if(inches < 15) {
    Serial.println("DANGER");
    tone(alarm, 2000); 
    delay(100);
  } else {
    Serial.println("GOOD");
     noTone(alarm);
     delay(100);
  }  
  
  delay(200);
}</p><p>long microsecondsToInches(long microseconds)
{
  return microseconds / 74 / 2;
}</p><p>long microsecondsToCentimeters(long microseconds)
{
  return microseconds / 29 / 2;
}</p>

Step 2: Measurement and Drawing

After building the circuit, you have to measure the dimensions of your components in order to create a suitable structure to hold the components.In order to have a more integrated product we fixed all the components with tape.

Step 3: Solidworks-modeling

Make the 3D modeling in solidworks.

Step 4: 3D Printing

We divided the shell into two parts to prevent collapse during the printing process.

Step 5: Final Assembly

The last step is to assemble all the components in the 3d printed shell. Afterwards it can be fixed on your laptop as it showed in the photos.