# Week 12 Input devices week

## Weeks assignments

This week assignment was to measure the digital and analog signals from input devices. The test boards and sensors were provided by local instructor.We measured and visualized the output signals of two input sensors using an oscilloscope.

### Test 1: Analog signal from photoresistor LDR

A phototransistor is a transistor that senses light by varing the current between the transistor terminals. We then measured the voltage of a 10k ohmm resistor that the current passes through using equation V=I*R, where V is the voltage across the 10k ohm resistor, I is the current flowing through it, and R is the 10k ohm resistor. For measuring the voltage we use analog pins from Seeed XIAO RP2040 microcontroller. This is because the voltage is an analog signal. The voltage is transforned to a value between 0 and 1023 which is the number of segements that the ADC of analog pins can segment. So, 1023 equals to 3.3V. Second, we tested that circuit by connecting the two probes of the oscilloscope in parallel with the 10k ohm resistor as shown here.

We used a photoresistor LDR circuit where oscilloscope was connected between data pin and ground. The sensor was powered and connected to the XIAO RP-2040 breakout board.

Picture1: Test 1 setup

Here is the oscilloscope ground crocodile to the ground of the sensor and the input pin of the oscilloscope to the data pin.

Picture2: Measurement

Lastly we used the LED light to flash the sensor, which gave clear measurable results.

Picture3: Measurement

### Test 2: Digital signal from distance sensor VL53 L1X

The VL53 L1X sensor measures the time between a laser beam is transmitted and received. Then, a small microcontroller on the circuit board convert this time to distance since the speed of the light in air is well-known. The distance is converted to bytes in order to be transmitted through an I2C connection channel. Therefore, the data on the oscilloscope will be digital. We did not create a pcb for the sensor, but instead just connected it directly to the I2C bus of the XIAO RP-2040 breakout board.

With digital sensor we created circuit where oscilloscope channel 1 was connected between SDA pin and ground. Channel 2 was between SCL and ground.

Picture4: Test setup

Picture5: Measurement

In next measurement we added clock signal to the second channel (blue), with the data signal on the first channel (yellow).

Picture6: Measurement