## Response time of an LDR

Light dependent resistors are known to be slow to respond. We’ll find out just how slow they are by using an LED connected to a square wave, and measuring the resistance of the LDR using the oscilloscope utility ( Test and Measurement -> Oscilloscope  ).

The resistance is measured by connecting the LDR, and a 5K1 resistor in series between 3.3V and Ground. By monitoring the midpoint of the two, and using the known values of either ends(3.3 , 0 ) as well as 1 resistor(5K1), one can calculate the resistance of the LDR.

From the graph, it is evident that the LDR just about manages to reach the expected voltage values at either ends within 10mS.
Increase the frequency, and note that the LDR fails to reach the expected resistance before the input signal from SQR1 changes polarity

– Repeat this study using a phototransistor, and characterise its response time.

## IMU Sensor for mechanics experiments

Inertial measurement units such as the MPU6050 can be used to study the motion of mechanical systems. The following code snippet demostrates extracting 3-axis data from the accelerometer, and gyroscope of the MPU6050 sensor

``````from SEEL import interface            # import the module
I=interface.connect()                 # Connect to the hardware.
from SEEL.SENSORS import MPU6050 # A 3 axis- accelerometer + 3-axis gyroscope + temperature sensor
M = MPU6050.connect()                 #Connect to the sensor
Ax,Ay,Az,temperature, Gx,Gy,Gz = M.getRaw()    #Read all values from the sensor
print (' Ax = %.2f,Ay = %.2f, Az = %.2f , Temperature = %.2f , Gx = %.2f , Gy = %.2f , Gz = %.2f'%(Ax,Ay,Az,temperature,Gx,Gy,Gz) )``````

Aim : To study the oscillations of a physical pendulum, and observe the relation of its angle to its velocity. Also calculate the value of g, given the length of the pendulum

The picture shows an MPU-6050 (3-Axis accelerometer + 3-Axis Gyroscope ) hooked up to the I2C port via thin guage copper wires designed to cause minimal perturbation to the oscillations of the pendulum.

The IC is positioned at the pivot so that the accelerometer can be used to measure the angle of the pendulum accurately using the vertical component of earth’s gravitational pull.The gyroscope’s values for the axis parallel to the pendulum’s pivot are also recorded.

Resultant data : Note that the velocity is maximum at the mean, and zero at the extremities

### Making the connections

Connecting I2C sensors such as the MPU6050 featured in this experiment is rather straighforward.

The SEELablet features a 4-pin I2C port that is labelled [Vcc , GND, SCL , SDA ] . The same labels can be found on most I2C modules , and four connections with simple wires up to 1 meter long is all that is required.

Once the connections have been made, the ‘sensor quick view’ app in the ‘ test and measurement’ section can be used to auto-scan the I2C port to check if connections were made properly.

### Data fitted against standard sine functions by selecting a region and executing the ‘fit’ routine

For systems where wired connections are difficult ( large distance , continuous rotation etc ) , wireless subunits may be used as a drop in replacement for the wires

## A simple Pulse-Sensing Application

How to make a pulse sensor with a phototransistor, and a bright LED.

The SEN input of the SEELablet is connected to a 12-bit voltmeter, and is also connected internally to 3.3V via a 5.1Kohm resistor. A photo-transistor connected between SEN and GND can be used to measure the amount of incident light.

In order to measure and visualize heartbeats, place a finger placed between a bright light source and the phototransistor, such that the light has to pass through the finger to get to the phototransistor. The body’s pulse causes the opacity of the finger to change momentarily, and this is reflected in the amount of light received by the sensor.

In order to record these fluctuations , open  SEELablet – > Test and Measurement – > Data Streaming  utility , and set the command to ‘get_resistance()’ . This will start plotting the resistance of the phototransistor as a function of time

Results :