Brighton Webs Ltd.
Statistics for Energy and the Environment
Home Index About

IR Distance Sensor and Angular Measurement

A project to measure the shaft power of a model wind turbine requires the construction of a dynamometer.  The torque cretated by the turbine is measured by the twist of a 0.45m length of 6mm wooden rod.  The twist measured by an IR sensor.  This page is a blog of the construction angular measurement element of the system.  The process started with a test to investigate the concept of measuring a small distance with reflected IR and is continuing with the development of software to utilise the output.

Background

After an hour or so of Googling, I learned about an IR photo reflector available in the local electronics store.  This is a small package consisting of an IR LED and a phototransistor, the idea being that the beam from the LED was reflected back to the phototransistor.  Several people had used this device for measuring the speed of rotating components.  In these applications, the photoreflector was used to provide a pulse stream generated by reflecting/non-reflecting patterns on the rotating component.  Typically the phototransistor was configured to work in switch mode and become saturated in response to reflected light.

The photoreflector is a convenient package.  By configuring it in active mode it can be used to measure small gaps between the face of the component and a reflective surface.  The logic being that response of the phototransistor is proportional to the irradiance it receives.  In turn the irradiance is determined by the inverse square law:

A test rig was constructed using wood and Meccano to create a variable gap between a strip of white plastic an the photoreflector.  The mechanism was not a smooth as I would have liked, but as the results were repeatable I 'm assuming that variations are due to uneven surfaces, the sensing part of the rig is shown below:

By moving the inclined plastic strip horizontally, the gap varied from 4 to 7mm.  Voltage measurements were taken at gap increments of 0.13mm.  The left hand graph shows raw data, as the gap increases, the voltage decreases.  The right hand  graph applies the inverse square law which suggests a linear relationship between the gap width and the current through the phototransistor.

The circuit diagram is shown below.  The phototransistor is wired up in common collector mode, thus the Vout increases with increasing irradiance.

The maximum forward current of the LED seems to be about 20mA with a forward voltage of 1.7 volts.  The first attempt used a 240R resistor, however, this caused the phototransistor to saturate with small gaps.  The second attempt used a 1k resistor to reduce the output of the LED and this has provides an acceptable response over the operating range.  The choice of  RL was arbitrary, some circuits using the photoreflector in switch mode use a 20k resistor, the 10k resistor proudces the desired result, but may not be the optimum value.

Angular Measurement

The photoreflector has been adapted to angular measurement.  The torsion meter component of the model wind turbine dynamometer requires a means of measuring angular displacements in the range -22.5 to 22.5 degrees.  The ideal solution would have been to a circular inclined surface, similar to a screw thread mounted on a 36mm disk.  After a couple of attempts at constructing such a device with hand tools, this idea was abandoned in favour of a simple wooden disk, one side of which as a simple inclined surface.  This is illustrated below, together with a photo of the finished item:

The distance between the surface and the sensor is given by the formula:

The relationship between angular displacement and distance between the sensor and the surface is shown in the graph below:

Over than range of interest, the relationship between angular displacement and sensor distance is approximately linear.

Calibration is waiting on the completion of some other tasks.  The curve below is from one of the inital tests which suggests that it will be possible to estimate the angular displacement from the value of Vout.

Analogue Processing

The output of the photo transistor is arbitrary voltage which is in part a function of the distance from the reflecting surface, which during the development phase is constantly changing as the equipment is rebuilt.  The interface between the dynamometer and the logging and analysis computer is is a Velleman VM110 USB card.  One of the functions on this card is an analogue to digital converter with a range of 0 - 5 volts.  In order to process the signal to optimise the AD capability of the VM110, an op-amp configured as a differential amplifier is used.  The circuit diagram for this is split into two parts.  The first is 7805 regulator and a couple of voltage divides.

For simplicity, the op-amp is used with a single supply, thus Vout is always greater than zero.  To get round this limitation Vcc/2 is used as a bias (see graph below).  The V0 divide can be set to equal Vout of the phototransistor when the angular deflection is zero.  When the output of the photo tranistor is higher than this value, the rotation is +ve and when it is less than V0, the rotation is -ve.

The op-amp is a LM358 (marked KIA393P) configured with values of Rf and Rg which give a gain of 10.  the relaitionship between V0 and Vsensor is given by the formula below:

The range of operation is shown in the graph below:

The minimum value of (Vsensor-V0) is 250 mv (close to Vcc/2 / gain).  The maximum value is constrained by the op-amp's relationship between Vout and Vcc, in this case with Vcc=5.0, the closest Vout can get is approx. 3.7 volts.

This circuitry will probably evolve as development continues, at present limiting the input to the VM110 to around 3.7 volts provides a margin of safety.  There is much truth in the adage that it is always the expensive component that gets destroyed during development.

Digital Processing

The VM110 provides the input to a VB.net programme which will log and analyzes the rotational speed of the turbine and the torque it creates.  The graph below is a test plot of the digitised voltage from the op-amp:

The plot shows 512 samples take at 10ms intervals.

Related Pages

Torsion Meter

 

Page Updated: 17-Jul-2012