Introduction: Basic Arduino Earthquake Detector

About: Tinee9's goal is to help DIY makers, companies, and inventors to make their projects come to life, especially in small packages. One of the way we will achieve that is by providing instructables on various pro…

Tiny9 is back and today we are going to make a simple Arduino earthquake detector.

Please visit my instructable to interface with Tiny9's LIS2HH12 in the below link to set up the device so all you have to do is add a 3 resistors and 3 Light Emitting Diodes (LEDs)

3 Axis Accelerometer

This instructable is considered beginner level with some experience with Arduino software.

If you need to buy the accelerometer go to either of these locations:

Amazon

*This instructables does not reflect all the possible or correct acceleration changes for earthquakes in the richter scale

Step 1: Earthquakes

The picture is a google search capture of an earthquake. As a child I lived through the 1994 Northridge earthquake. I don't remember too much about the earth quake other than these things below:

-House was cracked in half and one half now has a step down to it.

-One of the walls in my bedroom had a hole in it to the backyard.

-I lost my favorite toy rattle at the time. It had beads in the rattle that you could see go up and down.

-Sidewalk cement across the street literally flipped upside down.

-The street had a mini "mountain" made out of it.

Needless to say big earthquakes are not fun.

We haven't had any big earthquakes (Greater than a 5.0) in Southern California for quite a while but one of these days we will. So lets build a Earthquake detector!!!

Step 2: Materials

We need:

-The setup from the LIS2HH12 instructable

- 3x 690 ohm resistors

-1x Green LED

-1x Yellow LED

-1x Red LED

-Optional: Wire Stripper

Step 3: Quick Lesson on V = I*R

In Electrical Engineering you have the equation V = I * R which invades your life every day.

V = Voltage (Volts, V)

I = Current (Amps,A)

R = Resistance (Ohms)

In a circuit this equation is never violated. So if I connect a 5V source to a 690 Ohm resistor and then to an LED to ground, the current in the circuit is going to be this:

Example LED voltage drop = 2.5V

(Source - LED) = Current * Resistance

5V-2.5V = I * 690 Ohms

I = 2.5V/690 Ohms = 3.62 milliAmps or 3.62 mA

Typical LEDs do not like to exceed 10mA-20mA or they will burn out.

Step 4: LED Polarity

LEDs have polarity that lets a person know which way it needs to be placed to allow current to flow through it.

Current goes through the Anode of the LED to the Cathode of the LED. It cannot go the other way. If placed backwards it will not work or blow up if voltages exceed its specifications.

If not enough current then there may not be any light emitting from the LED.

The long side on the Red LED is the + Anode and Short side it the - Cathode side.

Step 5: Set Up the Earthquake Dectetor

Steps of setting up the 3x 690 resistors and the 3 LEDs.

1. Place a 690 ohm resistor from D4 (Row 55) of the arduino nano to row 37 of the breadboard

2. Place a Red LED Anode on the top half of the breadboard on row 37 and the Cathode place in the blue rail (GND)

3. Place a 690 ohm resistor from D3 (row 54) of the arduino nano to row 38 of the breadboard

4. Place a Yellow LED Anode on the top half of the breadboard on row 38 and the Cathode place in the blue rail (GND)

5. Place a 690 ohm resistor from D2 (row 53) of the arduino nano to row 39 of the breadboard
6. Place a Green LED Anode on the top half of the breadboard on row 39 and the Cathode place in the blue rail (GND)

7. Make sure none of the wires, resistors, or LED leads are shorted together by accident or you may cause damage to your circuit.

Step 6: Download .Ino

Download the Tiny9_LIS2HH12_Earthquake_mon.ino file from here: github

Step 7: Enjoy

Now you should be able to upload your .ino into your arduino nano.

What will happen is if there is a minor earthquake the Yellow LED will light up.

If there is a major earthquake a Red Led will light up.

Once a minor or major earthquake has been detected you must reset the arduino if you want to turn off the LEDs.

*This sketch does not reflect all the possible or correct acceleration changes for earthquakes in the richter scale.