Jayraj Desai
Published © GPL3+

How to Measure Mass of the Earth Using Arduino

We live on a beautiful planet called earth, do you know how much is its weight? Lets find out.

IntermediateFull instructions provided5 hours8,769
How to Measure Mass of the Earth Using Arduino

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
USB-A to B Cable
USB-A to B Cable
×1
560 ohm resistor
×4
Resistor 100 ohm
Resistor 100 ohm
×2
piezoelectric sensor
×4
IR transmitter (generic)
×1
IR receiver (generic)
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
opamp UA741C
×1
Breadboard (generic)
Breadboard (generic)
×1
1.2 meter long wires
×1
general purpose PCB
×1
tape
×1
cardboard sheet
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

IR circuitary

fritzing schematic for IR circuitary

IR circuitary 2

hardware image

piezoelectric module

fritzing schematic

piezoelectric circuitry 2

hardware image

Code

Arduino code

Arduino
simple arduino code
const int sensorPin1 = A0;
const int sensorPin2 = A1;
const int sensorPin3 = A2;
const int sensorPin4 = A3;
const int photoPin = 4;
const int ledPin = 13;
const int threshold = 110;
char stringToPrint[100];


int startTime,endTime;

int val1,val2,val3,val4;

void setup() {
  Serial.begin(115200);
  // put your setup code here, to run once:
  pinMode(ledPin,OUTPUT);
  pinMode(sensorPin1,INPUT);
  pinMode(sensorPin2,INPUT);
  pinMode(sensorPin3,INPUT);
  pinMode(sensorPin4,INPUT);
  pinMode(photoPin,INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:

  int start = digitalRead(photoPin);
  startTime = millis();
  if(start == HIGH)
    digitalWrite(ledPin,HIGH);
  while(start == LOW)
  {
      digitalWrite(ledPin,LOW);
      val1 = analogRead(sensorPin1);
      val2 = analogRead(sensorPin2);
      val3 = analogRead(sensorPin3);
      val4 = analogRead(sensorPin4);
      //sprintf(stringToPrint,"%d,%d,%d,%d",val1,val2,val3,val4);
      //Serial.println(stringToPrint);
      if((val1 >= threshold) || (val2 >= threshold) || (val3 >= threshold) || (val4 >= threshold))
      {
        endTime = millis();
        sprintf(stringToPrint,"%d ms",endTime - startTime);
        Serial.println(stringToPrint);
        digitalWrite(ledPin,HIGH);
        delay(1000);
        digitalWrite(ledPin,LOW);
        start = HIGH;
      } 
  }
}

Credits

Jayraj Desai
10 projects • 70 followers
Just a Hobbyist, trying things

Comments