Contents
- Technical Specification
- Manufacturing Process and Materials
- Examples of Functionality
1. Technical Specification
Due to the unfortunate outbreak of Covid-19, the likelihood of creating a complete high fidelity prototype was quite low. Because of this, I decided it was important to focus my efforts upon the electronics, and in that cementing the proof of concept.
- The circuit must be able to sense vibrations on a surface and relay that information to other components.
This was probably the most difficult specification to meet. As you will see in technical prototyping, I understood that I could create an analog signal which activates an LED using a joystick. I was not, however, aware of how I could create that analog signal from vibrations the circuit would sense. After some research, I found the component “MPU-6050.” It is a 6 Axis Gyroscope and Accelerometer, which is mainly used to control the pitch, roll and yaw of drones. The code below shows how I reprogrammed it to work as a seismic sensor.
void loop(){
Wire.beginTransmission(MPU6050_addr);
Wire.write(0x3B);
Wire.endTransmission(false);
Wire.requestFrom(MPU6050_addr,14,true);
AccX=Wire.read()<<8|Wire.read();
AccY=Wire.read()<<8|Wire.read();
AccZ=Wire.read()<<8|Wire.read();
Serial.print(“AccX = “); Serial.print(AccX);
Serial.print(” || AccY = “); Serial.print(AccY);
Serial.print(” || AccZ = “); Serial.print(AccZ);
AccX, AccY, and AccZ are the 3 axis that the sensor is operating in. Programming “Wire.read” commands the accelerometer to take a reading, and sets the current values. This is the base code that allows this device to operate as a seismic sensor. If the component is moved, the values of AccX, AccY and AccZ would change.
“Serial.print” is ordering the readings for the accelerometer to be printed onto Arduino’s built-in serial plotter. This is mainly to monitor whether the component MPU-6050 is working correctly during prototyping.
This image indicates the changes in AccX, AccY and AccZ when I pick up and move the MPU-6050 component.
2. The device must only record data once it senses vibrations.
The device is currently reading X, Y, and Z values, meaning a simple “if” statement can be used to compare the difference between the last value and the current value. If the difference is greater by a certain amount, it executes that if statement.
if(abs(DiffX-AccX)>400 || abs(DiffY-AccY)>400 || abs(DiffZ-AccZ)>400) {
In this code, if the value of AccX varies by a number greater than 400, the if statement is executed. The code for the data capturing components would be located inside this if statement, only running when the circuit senses movement.
3. The circuit must record at least 1 piece of information from the real world.
Once the seismic sensor had been correctly installed and the “if” statement was completed, adding components is quite easy. In this circuit, once MPU-6050 senses movement, an LED would turn on and a temperature and humidity reading would be taken from the device “DHT11”. Furthermore, recording of the time since the device has been turned on is also recorded. The statement inside the “if” statement is below.
digitalWrite(13, HIGH);
Serial.print(” || Time = “);
Serial.print(millis());
int chk = DHT11.read(DHT11_PIN);
Serial.print(” || Humidity % = “);
Serial.print((float)DHT11.humidity, 2);
Serial.print(” || Temperature C = “);
Serial.print((float)DHT11.temperature, 2);
delay(400);
Breaking this down, “digitalWrite(13, HIGH) is simply turning the LED on, which is located on pin 13. “Serial.print(“|| Time = “); ” is simply just commanding time to be printed on the serial monitor. Finally “int chk = DHT11.read(DHT11_PIN)” is ordering the component DHT11 to take a reading of both temperature & humidity, which then uses the “Serial.print” command to print the results to the serial monitor.
This is a video of Arduino’s serial plotter. As you can see, when either AccX, AccY or AccZ change, readings are of time, humidity and temperature are taken.
2. Manufacturing Process and Materials
Material list:
1 Arduino Mega 2560 controller board
1 DHT11 Temperature and Humidity Module
1 LED
1 Resistor
1 MPU-6050 6 Axis Gyroscope and Accelerometer
8 Female to Male Dupont Wires
4 Breadboard Jumper Wires
Before building, I created a virtual model of the wiring using the program “fritzing.” It can be seen below.
Some components also required soldering, which was completed quickly after some practice on broken pieces.
This is the final photo of the circuitry.