Tachometer - LDR Rotation Sensing

Tachometer - LDR and Microbit

Purpose :

To build a tachometer (not the one to measure how much tacos can you eat) but the one to measure RPM, speed of rotating objects like wheel, turbine etc.,

Hypothesis:

Most of the commercial tachometers work with light and we are planning to use LDR to track light and calculate the RPM and using microbit to read, measure, calculate and display the results.

Materials needed:

LDR
Microbit
Resistor - 10k
cables/ wires to connect
I used lego 42020 helicopter but you can use anything.

Procedure:

Tricking out lego : why?
1. Increase width of the blades:
If the blade width is too small it makes it difficult for the LDR to read so we are going to swap the blades of this lego set with that of Batman helicopter ones.
2. Use two pieces technic T-beams and one cross block piece to hold the LDR.

Connect the LDR to the microbit and resistor circuit.

Circuit:




 

You can use this to find the RPM of ANYTHING that rotates and blocks enough light for the LDR to sense it

Program:

What it should do: It should calculate RPM of whatever your trying to calculate the RPM of, if you set it up correctly

let lastreportime = 0
let hashitminlightlevel = false
let currentlightreading = 0
let maxlightvalue = 0
let minlightvalue = 0
let oneminuteinmilliseconds = 0
let currenttime = 0
let lasttriggertime = 0
oneminuteinmilliseconds = 60000
minlightvalue = 5
maxlightvalue = 7
while (true) {
currentlightreading = pins.analogReadPin(AnalogPin.P0) / 100
if (currentlightreading == minlightvalue && hashitminlightlevel == false) {
hashitminlightlevel = true
currenttime = input.runningTime()
if (currenttime - lastreportime == 1000) {
lastreportime = currenttime
serial.writeValue("RPM",   calculateCurrentRPM(lasttriggertime, currenttime))
}
}
if (currentlightreading > minlightvalue) {
hashitminlightlevel = false
}
}
function calculateCurrentRPM(lasteventtime: number, currenteventtime: number) {
return (oneminuteinmilliseconds / ((currenteventtime - lasteventtime) * 3));
}

Demo:






Comments

Popular posts from this blog

Gears and basic concepts

Gears

Courses Offered