Input Devices¶
This week, our task was to test the analog levels and digital signals of the input device(s). To do this, we first grabbed the Rigol DS1054Z oscilloscope available in the lab and connected vibration sensors. Depending on the strength of the vibration, their design generates a varying voltage that can be digitally analyzed. The sensors have only two connections between which the voltage is measured. Accordingly, we connected both to the oscilloscope’s two clamp meters and selected and switched on the corresponding channel. On the right side of the oscilloscope, we have various options for changing the display settings using the rotary controls. The following two are probably the most frequently used to accurately display the signal.
The left knob controls the absolute value that corresponds to the height of a box. This controls how high the signal amplitude is shown on the display, or whether it even fits completely into the image. The right knob sets the duration displayed in the image. For high-frequency signals, we typically set this time shorter. In our current measurement, one box corresponds to a voltage of 2 V for Channel 1 and a voltage of 100 mV for Channels 2 and 3. To capture the irregularly occurring signals before they disappear from the image, we used the single mode, which can be activated using the button in the top right. When a freely configurable signal threshold is exceeded, this measurement mode triggers and captures the signal cleanly on the monitor, then stops the measurement. We can save these measurements as a .png file by connecting a storage medium, in our case a USB stick, using the Print button. The good thing about these .png files: They are very small, so we do not need to compress them :) What is a bit tricky or special is that the USB stick must be formatted as a flash drive. In our case, we formatted the USB stick in FAT32 format before connecting it.
The measurements then look something like this.
A little surprise: This is how we caused the vibrations. The measurement you see is this wonderful hit here.
In addition to this measurement, we measured a photodiode using a multimeter. In our case, the photodiode is a light-dependent variable resistor, which is why we had to use the multimeter for our measurement in the first place. Accordingly, we use the resistance measurement mode, similar to the measurements we made with the circuit boards. As a brief demonstration, we recorded the whole process as a video; you can clearly see how the resistance value changes.
Finally, of course, we also wanted to record digital measurements, which we accomplished with a simple button, since this only returns zero or one, or true or false. For the test, we used the following code and the serial monitor, as this best displays the digital signal.
const int in = 12;
void setup() {
pinMode(in, INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
int state = digitalRead(in);
Serial.println(state);
delay(500);
}
Contrary to all expectations, we obtained this result: