Technical Prototyping (30%)

Introduction

When I first started this project, I didn’t know how to program at all and my knowledge of electronics was almost non-existant. When I proposed the initial idea, I wasn’t sure whether the theories behind it were completely viable. I knew that this would be a huge part of my project, so once Covid-19 forced everyone into lockdown, I knew that this gave me the opportunity to focus wholly upon the electronics of my design.

Initial Concept

I knew that I wouldn’t be able to construct any of the circuitry that I had set for myself without building up to it beforehand, and that’s what I set out to do during my technical prototyping.

Simple “Blink”

Summary:

The first prototype I created was used to test the base components I owned, such as the “Mega 2560” Arduino and breadboard. I also used this prototype to start to teach myself how to use the software Arduino came with.  In terms of the code, I downloaded the example code “blink” which makes a connected LED flash on and off.

“Blink” Code

“Blink” Circuitry

 

Components Used:

LED, Resistor.

Next Technical Stage to Address:

This code doesn’t allow for an external signal to turn the LED on and off, which is definitely needed in my circuit.

Button

Summary:

This next circuit implemented portions of the previous, whilst adding a button module to allow me to turn the LED on and off if it is pressed. I hadn’t written any code before, so this would be a simple place to start as it allowed me to stitch two pieces together.

“Button” Code

“Button” Circuitry

Components Used:

LED, Resistor, Button

Next Technical Stage to Address:

The button works, however it is only inputting a digital signal. I need to experiment with using an analog signal to turn the LED on and off.

Joystick

This circuit tested how viable using an analog signal to turn on an LED was. I had to ask for help when writing the code due to the addition of the joystick. I was struggling to understand how to write the comparison of the X and Y values. This compares the original X or Y value with the original. If the difference is greater than the number stated, the “if” code would be executed. Once the code was written and uploaded to the circuitry, I could use the joystick to turn the LED on and off. Something I needed to keep in mind was that the joystick only worked in 2 axis, the X and Y, whereas MPU-6050, the component used to monitor seismic activity, would work in 3.

“Joystick” Code

int x_input_pin = A0;
int y_input_pin = A1;
int orig_x = 0;
int orig_y = 0;

void setup() {
Serial.begin(9600);
pinMode(13, OUTPUT);
pinMode(x_input_pin, INPUT);
pinMode(y_input_pin, INPUT);

orig_x = read_pin(x_input_pin);
orig_y = read_pin(y_input_pin);
}

int read_pin(int pin_number) {
return analogRead(pin_number);
}

void get_input_diff(int &x_value, int &y_value) {
int x_position = read_pin(x_input_pin);
int y_position = read_pin(y_input_pin);

x_value = x_position – orig_x;
y_value = y_position – orig_y;
}

void loop() {
int x_diff = 0;
int y_diff = 0;

get_input_diff(x_diff, y_diff);

Serial.print(“X Diff: “);
Serial.print(x_diff);
Serial.print(” | Y Diff: “);
Serial.println(y_diff);
if(abs(x_diff)>100 || abs(y_diff)>100) {
digitalWrite(13, HIGH);
}
else{
digitalWrite(13, LOW);
}
delay(100);
}

“Joystick” Circuitry

“Joystick” Photos

Components Used:

Joystick Module, LED, Resistor.

Next Technical Stage to Address:

Introduction of the MPU-6050 component. I thought the code would be similar to the joystick with only small differences such as the amount of axis it works requiring small edits.

LED & Sensor

Technical Problem: Luckily, the Arduino website offers quite an in-depth tutorial on how to code MPU-6050

This stage replaced the joystick with the “MPU-6050” component. There was quite a large technical setback when it turned out the code to the joystick was quite different from the code for the joystick. Luckily the official Arduino website offers extensive tutorials on how to set up specific components, helping me correct the code. Once the correct code was uploaded, tapping the surface the circuit was on would turn the LED on.

“LED & Sensor” Code with annotation

“LED and Sensor” Wiring

“LED and Sensor” Photos

MPU-6050 Readings

Components Used:

Led, Resistor, MPU-6050

Next Technical Stage to Address:

At this moment, the only thing happening when the circuit senses movement is an LED turning on. I knew that adding a data capturing device and having it record something when the circuit senses movement would be a huge step forward in this process.

Temperature and Humidity Monitoring

The final step in this long process was to add a component that records information that it gathers from its surroundings. The component “DHT-11”, a temperature and humidity monitor, was selected for this job. Once MPU-6050 was correctly set up, it is quite easy to edit the code to account for the extra component. Firstly, “#define DHT11_PIN 7” is added at the beginning to set up the pin input. Secondly, the code to make the sensor take and print readings is simply placed inside the parameters of the “if” statement, ensuring it will only take readings when the sensor executes that code.

“Temperature and Humidity Monitoring” Code

“Temperature and Humidity Monitoring” Wiring

“Temperature and Humidity Monitoring” Videos

Components Used:

Led, Resistor, MPU-6050, DHT11.

This final prototype cements the proof of concept behind the device I am designing. It also reveals the ease of adding new components to the circuit and how anyone with 0 experience of programming and circuitry can understand the theories behind it.

The final result, a working seismic sensor linked to a data capturing device that monitors information when it senses vibrations.

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *