Home /
Expert Answers /
Computer Science /
please-modify-this-arduino-code-to-count-the-rpm-of-my-motor-i-need-the-additional-code-in-c-form-pa591
(Solved): Please modify this Arduino code to count the rpm of my motor. I need the additional code in C++ form ...
Please modify this Arduino code to count the rpm of my motor. I need the additional code in C++ format. All details are pictured below.
MATLAB 2019 is a software. I am in hopes that a chegg expert has this software and can show me how to link arduino code to matlab. Matlab must display the readings from my sensor.
Upload the following code:
Fig.2. Experiment-1 Setup You must bend both LED and photoresistor, so the LED emits the light directly to the photoresistor. Place the fan blade on the shaft of the DC motor and paint it with black marker. The fan blade will cut the light when motor rotates. Here is a picture of the actual circuit:
Connect the DC motor and adjust the speed to its minimum using the potentiometer. While rotating, place the fan blade gently between the LED and photocell. This will cut the light every time the motor rotates. Open "Serial Plotter" from Tools and you will see the following graph:
Modify the above code to calculate the speed of the motor in RPM (Rotation per minute) and display it in Serial Monitor. Hint: You must detect either rising edge or falling edge and count them in, for example, 10 seconds and multiply it with 6 to give you the RPM.