This thread got me thinking about ways to measure gravity, and I intend to try that way with a ball falling 2-3 metres.
But since for a simple pendulum, T = 2pi sqr(l/g) it's also easy to find g given the length and measuring the period.
My first thought, and probably how one might try if using a stop-watch, is to clock the bob at the extremities. Problem with that is, as the pendulum dies, the arc reduces so that's a bit tricky. You never really know how far it's going to swing.
So seems the better approach is to clock it as it passes the bottom of the arc, the mid-point, seeing as we know where that is and it doesn't depend on the size of the arc.
It would need two sensors to clock the direction, since a period is when it comes in from the same side consecutively. Or I guess just one would do since then we'll have half a period and that's cool too.
So, my method would be simply to have an IR gate (IR LED and photodiode) at the bottom of the arc. Measure length of string to bob. Drop pendulum from where-ever out to one side, break the beam each time through, and calc g on the fly. Prob need to state machine the breaking of the beam so I don't get multiple clocks while the bobs still in the beam, and then reset that in time for it to get back on the next swing.
Bit of a ramble there, but I'd like to hear comments.
You don't need to take the time at the exact bottom of the arc. Anywhere will do as long as the pendulum passes the spot on every swing.
Be careful if using a sensor that is affected by the width of the part of the pendulum that triggers the sensor. Ignore every second reading ? (probably does not matter which set are ignored as long as you are consistent)
...R
Ps Wikipedia knows the answer - 9.80665
I love the story about the Ordnance survey mapping India. Apparently they started from the south and were measuring using chains and verifying with a theodolite. The measurements disagreed when they got near the Himalayas (which they did not know existed) and they eventually figured it was due to the gravitational effect of the plateau on the plumb-bob used to adjust the theodolite. I am truly amazed that they had that level of accuracy way back then.
next step is to design a "kicker" that can reintroduce energy into the pendulim and figure the
air drag losses based on how much energy you need to reintroduce to maintain the swing
a calculation could determine the rate of energy loss
AWOL:
How very appropriate that you're a Shannon member!
I had not thought of that - Claude was American.
Interestingly, though I am not a literary person, I find it easier to bring to mind the names of Irish literary figures. But there have been useful scientific contributors - including Hamilton and Kelvin. I must make a list for myself
The OP's intention is to measure g with a pendulum.
I don't see G being directly relevant to the conversation. I understand its relevant physically, but introducing that idea so early in the discussion seems odd.
Ok so it took me almost a year to get round to this project; became a radio ham meantime. Here's the code if anyone wants to try something similar.
Thanks to jurs in this thread for the code which allows user to dial a number with the buttons on a DFR0009 LCD.
// find "g" with a pendulum
// jimboza feb 2016
// T = 2pi sqrt(l/g)
// photogate on pin 2
// setup() asks for pendulum length, then holds for pendulum
// to break the beam to start loop()
// Thanks to jurs on arduino forum
// for how to dial in a value to the LCD
// http://forum.arduino.cc/index.php?topic=241559.0
// uses LCD panel ala DFR0009.
// left / right keys to choose digit in the pendulum length
// up / down keys to dial a digit
// select key to enter
// ************************************
// change next line to default length
char value[] = "0750"; //mm
// **************************************
float length; //mm
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
enum {btnNONE, btnSELECT, btnLEFT, btnUP, btnDOWN, btnRIGHT, NUM_KEYS };
const byte ButtonsPin = A0;
byte gatePin = 2;
boolean gatePinVal;
boolean lastGatePinVal;
boolean lengthEntered = false;
byte gateBreakCounter = 0;
int startTime;
float period;
int fullSwings = 0;
float gravity;
float k = 39.48 ; //4 pi^2
int cursorPos;
boolean lcdNeedsUpdate = true;
void setup()
{
lcd.begin(16, 2); // start the library
lcd.setCursor(0, 0);
//kluge for the lcd backlight problem
//pinMode(10, OUTPUT); //off
pinMode(10, INPUT); //on
lcd.print ("Pendulum mm?");
lcd.blink();
while (!lengthEntered)
{
enterLength();
}
lcd.clear();
lcd.print("Release the");
lcd.setCursor(0, 1);
lcd.print(" pendulum....");
pinMode(gatePin, INPUT);
gatePinVal = digitalRead(gatePin);
while (!gatePinVal)
{
gatePinVal = digitalRead(gatePin);
}
startTime = millis();
lcd.clear();
lastGatePinVal = gatePinVal;
}
void loop()
{
// read the gate input pin:
gatePinVal = digitalRead(gatePin);
// compare the gate's state to its previous state
if (gatePinVal != lastGatePinVal) {
// if the state has changed, beam just broke or just cleared
if (gatePinVal == HIGH) {
// if the current state is HIGH then beam just broke
gateBreakCounter++;
if (gateBreakCounter % 2 == 0) //even number is full swings
{
fullSwings++;
period = ((millis() - (float)startTime) / fullSwings) / 1000.0;
gravity = k * length / 1000 / (period * period);
lcd.setCursor(0, 0);
lcd.print("Cycles: ");
lcd.print(fullSwings);
lcd.setCursor(0, 1);
lcd.print("Gravity: ");
lcd.print(gravity);
}
}
}
// save the current state as the last state,
//for next time through the loop
lastGatePinVal = gatePinVal;
}//loop
int read_LCD_buttons()
{
int returnValue;
// read ADC value of pressed button
int adc_key_in = analogRead (ButtonsPin);
int adc_key_in1 = analogRead (ButtonsPin);
// read again and check for stable ADC reading (software debouncing for analog input)
if (abs(adc_key_in1 - adc_key_in) > 1) return btnNONE; // if ADC reading is not stable, return btnNONE
if (adc_key_in < 50) returnValue = btnRIGHT;
else if (adc_key_in < 195) returnValue = btnUP;
else if (adc_key_in < 410) returnValue = btnDOWN;
else if (adc_key_in < 650) returnValue = btnLEFT;
else if (adc_key_in < 999) returnValue = btnSELECT;
else returnValue = btnNONE;
// simple "blocking" code: "Busy waiting" until button is released by user
while (adc_key_in < 999) adc_key_in = analogRead(ButtonsPin);
return returnValue;
}
void enterLength()
{
char key = read_LCD_buttons();
if (key != btnNONE) lcdNeedsUpdate = true;
switch (key)
{
case btnRIGHT:
if (cursorPos < 4) cursorPos++;
break;
case btnLEFT:
if (cursorPos > 0) cursorPos--;
break;
case btnUP:
if (value[cursorPos] < '9') value[cursorPos]++;
break;
case btnDOWN:
if (value[cursorPos] > '0') value[cursorPos]--;
break;
case btnSELECT:
length = atol(value);
lengthEntered = true;
break;
}
if (lcdNeedsUpdate)
{
lcd.setCursor(0, 1);
lcd.print(value);
lcd.setCursor(cursorPos, 1);
lcdNeedsUpdate = false;
}
}