How to Make a Rotation Speed Sensor

How to Make a Rotation Speed Sensor Introduction This worksheet describes the process of building a simple rotation speed sensor. In this example we ...
Author: Cody Newman
0 downloads 0 Views 1MB Size
How to Make a Rotation Speed Sensor Introduction

This worksheet describes the process of building a simple rotation speed sensor. In this example we will attach card rotor blades to the wheel of a small electric toy car and spin them over the light sensor on the ExperiSense Board. ScratchX can then be used to analyse the change in light intensity as the blades pass over the light sensor and calculate the speed of rotation. The operation of this rotation speed sensor requires the use of the ExperiSense Board in conjunction with an Arduino and is programmed using ScratchX, more information on how to do this can be found at warwick.ac.uk/scratchresources. Materials needed 1. 2. 3. 4. 5. 6. 7. 8.

1. 2. 3. 4.

Card/Cardboard Scissors Blu Tack ExperiSense Board Arduino board Small Electric Motor Battery Pen/Pencil Building the Rotor Blades

Cut out a circular piece of card around 12 cm in diameter. Mark out eight equally sized segments with a pen or pencil. Draw a small circular at the centre around 4 cm in diameter. Cut out every other segment stopping at the edge of the smaller circle.

Safety: Please note that you use these resources at your own risk. Correct use of some components requires care. Produced by Caspar Collins ([email protected]) Technology Volunteers: go.warwick.ac.uk/techvolunteers Scratch Resources: go.warwick.ac.uk/scratchresources

The Theory

Now we must write a ScratchX program capable of counting the blades as they pass over the light sensor and calculating the rotation speed.

Light Sensor Value

The light sensor will return a value of 0-100 and this will fluctuate from a maximum value, when the light sensor is in-between two rotor blades, to a minimum value, when the sensor is directly beneath a blade. There will also be a mean value halfway between the maximum and the minimum. As a blade passes over the sensor, the sensor value will go from above the mean to below and then above again; this can be counted using Scratch. The time taken for four rotor blades to pass corresponds to the time taken for one rotation, this can then be used to find to rotation speed in rpm (revolutions per minute).

Mean

Time Produced by Caspar Collins ([email protected]) Technology Volunteers: go.warwick.ac.uk/techvolunteers Scratch Resources: go.warwick.ac.uk/scratchresources

Calibration

Before we can begin measuring the rotation speed we must include a calibration step in order to calculate the mean value. For this we will need a sprite labelled “calibrate” that will be clicked while the rotor blades are spinning but before any measurements are made. There are many ways of finding the mean, an example of a fairly robust method is shown below. This method finds the highest and the lowest sensor readings and then sets the mean to be in between those two values.

Counting

Now its time to write the part of the script that counts the blades as they pass over the light sensor. Again we need a sprite that can be clicked to initiate the script, this time it will be a button labelled “measure”. Starting with a variable “count” which will change by 1 every time the sensor value goes below the mean and then back above it again as this corresponds to one blade passing. An example script is shown below. Produced by Caspar Collins ([email protected]) Technology Volunteers: go.warwick.ac.uk/techvolunteers Scratch Resources: go.warwick.ac.uk/scratchresources

Calculation

Now we will change the script above such that it is able to measure the time taken for one full rotation, this is known as the period of rotation. In this case we have four rotor blades, so a count of four will correspond to one full rotation, so the time taken for the count to reach 4 will give the period. The speed in rpm is then 60, because there are 60 seconds in a minute, divided by the period.

Produced by Caspar Collins ([email protected]) Technology Volunteers: go.warwick.ac.uk/techvolunteers Scratch Resources: go.warwick.ac.uk/scratchresources

Operation

1. Blu Tack the rotor blades to the shaft of the electric motor. 2. Position the blades such that they are above the light sensor on the ExperiSense Board. 3. Turn on the motor by connecting the wires to a battery. 4. Click the calibrate button and then wait a couple seconds before clicking the measure button.

Tips

 To get the best contrast between the maximum and minimum sensor reading shine a light over the top blades.  Try measuring the time taken for 40 counts and then the period will be the timer/10. This averages the period over 10 rotations and should give a more reliable value.  If you try this with a picoboard you will run into difficulties at higher speeds. The picoboard only makes 8 measurements per second compared to the Arduino which can make over 1000.

Extension Tasks

 Try plotting a graph of speed against time.  Instead of measuring the time taken for a certain number of counts try calculating the speed by measuring the number of counts in a certain period of time. When might you want to do this instead?  Try experimenting with rotors of varying size and number of blades. How does this effect your measurements?  Attach the rotor blades to the wheel of a toy remote control car and try to calculate its speed. Produced by Caspar Collins ([email protected]) Technology Volunteers: go.warwick.ac.uk/techvolunteers Scratch Resources: go.warwick.ac.uk/scratchresources