website
Skip to content

Raspberry Pi

“Make Your Earthquake Sensor With PicoBricks”

by Robotistan Shopify 11 Apr 2023
What is an Earthquake Sensor?
 
An earthquake sensor is a device that detects ground motion during an earthquake. These sensors are designed to measure vibrations occurring in the earth’s crust and help determine the intensity or magnitude of the earthquake. Earthquake sensors are typically located in regions close to where earthquakes occur or in specific locations around the world.
CNBC International

These sensors are commonly used to detect seismic activity occurring underground. They consist of a set of sensitive devices that measure oscillations in the earth’s crust. In addition to determining the intensity and magnitude of an earthquake, earthquake sensors can also determine the time and location of the earthquake. This information is important for earthquake prediction and emergency response efforts.

Make Your Earthquake Sensor With PicoBricks
Photo By PicoBricks.com

PicoBricks is a STEM education kit based on the Raspberry Pi Pico microcontroller, which can be used to create an earthquake sensor. You can create an earthquake sensor with PicoBricks by following the steps below:

Materials:
• Raspberry Pi Pico
• Breadboard
• Jumper wires
• Earthquake sensor (e.g., ADXL345)
• LED
• 220 ohm resistor
• Micro USB cable

Steps:

Connect the Raspberry Pi Pico to the breadboard and make power and ground connections using jumper wires. Connect the earthquake sensor to the breadboard. The ADXL345 sensor has VCC, GND, SCL, and SDA pins. Connect the SCL and SDA pins to the Raspberry Pi Pico’s I2C pins. Connect the VCC pin to the Pico’s 3.3V pin and the GND pin to the Pico’s GND pin. Connect the LED to the breadboard and connect it to the GPIO pin with a 220 ohm resistor. You can select any GPIO pin here, but we will use GPIO 21 for example. Connect the Raspberry Pi Pico to your computer with a USB cable and open the PicoBricks IDE.

Create a new project in PicoBricks and open the main.py file.
Write the following Python code in the main.py file:

from machine import Pin, I2C
from adxl345 import ADXL345
from time import sleep

led = Pin(21, Pin.OUT)
i2c = I2C(0, scl=Pin(5), sda=Pin(4))
adxl345 = ADXL345(i2c)

while True:
x, y, z = adxl345.read()
if z < 0:
led.on()
sleep(0.1)
led.off()

Save the code and disconnect the Raspberry Pi Pico from your computer.

Connect the circuit on the breadboard as follows:

• The ADXL345 sensor and LED are connected to the 3.3V and GND pins on the Raspberry Pi Pico.

• The LED is connected to GPIO 21 with a 220 ohm resistor.

• The SCL and SDA pins of the ADXL345 sensor are connected to GPIO 4 and GPIO 5 pins on the Pico.

•Connect the Raspberry Pi Pico to a power source with the micro USB cable.

Get More Information About Product Click Here

 

Writer : Enes Aydin

Prev Post
Next Post
Someone recently bought a
[time] ago, from [location]

Thanks for subscribing!

This email has been registered!

Shop the look

Choose Options

Robotistan
Have Questions?
Back In Stock Notification
this is just a warning
Login
Shopping Cart
0 items