Gravitational Force
The g-force or gravitational force is a measure of gravitational force where an object at rest on the Earth’s surface is subject to 1 g of force. So, 8g = 8 times the normal gravitational force exerted on an object.
This project will use the micro:bit to test the force of collision.
||input:Input||
Toolbox drawer, drag an ||input:on shake||
block to the workspaceinput.onGesture(Gesture.EightG, function () {
})
||basic:Basic||
Toolbox drawer, drag a ||basic:show leds||
block and drop it into the ||input:on 8g||
block.input.onGesture(Gesture.EightG, function () {
basic.showLeds(`
# . . . #
. # . # .
. . # . .
. # . # .
# . . . #
`)
})
Now let’s add some code to reset our experiment.
||input:Input||
Toolbox drawer, drag an ||input:on button pressed||
block to the workspace.input.onButtonPressed(Button.A, function () {
})
||basic:Basic||
Toolbox drawer, drag a ||basic:clear screen||
block and drop it into the ||input:on button pressed||
block.input.onGesture(Gesture.EightG, function () {
basic.showLeds(`
# . . . #
. # . # .
. . # . .
. # . # .
# . . . #
`)
})
input.onButtonPressed(Button.A, function () {
basic.clearScreen()
})
Sample code file: https://makecode.microbit.org/_L96ELqWtrV65
Download the code onto the micro:bit, and then connect the micro:bit to a battery pack.
After coding the micro:bit and constructing the egg drop carriers, take turns testing dropping the micro:bit in the carriers from a height. Do the micro:bit lights turn on? If so, that means the force exerted on the micro:bit was at least 8g – a good indication that the egg most likely will break on impact. Continue refining the egg drop carriers until no micro:bit lights turn on when dropped. Then test with an egg!
Discuss the results of the experiment:
NEXT: Resources