11. Input Devices

This week it was all about sensors and other input devices!

what are Input devices

Some known input devices are sensors and buttons.

sensors

There are many different kinds of sensors. In this class I realized how many sensors we come in contact with every day.

Just to list a few them:

  1. Temperature Sensors: Measure temperature variations using different principles like thermocouples or thermistors.
  2. Pressure Sensors: Detect pressure changes in gases or liquids, utilized in various applications.
  3. Proximity Sensors: Detect the presence or absence of an object without physical contact, using capacitive, inductive, optical, or ultrasonic principles.
  4. Motion Sensors: Detect motion or movement using accelerometers, gyroscopes, or magnetometers.
  5. Light Sensors: Measure ambient light levels using photodiodes, phototransistors, or photoresistors.
  6. Humidity Sensors: Measure moisture content in the air using capacitive or resistive principles.
  7. Biometric Sensors: Measure unique biological characteristics for identification or authentication, including fingerprint, iris, and facial recognition sensors.
  8. Gas Sensors: Detect the presence and concentration of gases in the environment using electrochemical, semiconductor, or infrared principles.
  9. Sound Sensors (Microphones): Convert sound waves into electrical signals using dynamic, condenser, or piezoelectric principles.
  10. Strain Sensors: Measure deformation or strain experienced by an object due to applied forces using strain gauges.
  11. Position Sensors: Detect position or displacement using potentiometers, LVDTs, or optical encoders.

Test with ultrasonic sensor with the barduino

For my final project I will need a sensor that can measure the water level/ volume in the container. One of the sensors that can o this, is an ultrasonic sensor. This sensor can detect the nearest surface. In my case, it could be interesting to use a floating object that will always be detected by the ultrasonic sensor.

for this test I used the barduino 4.0.1., the ultrasonic sensor Grove Ultrasonic Range v2.0, and my coffee cup as the object to measure the distance to.

This is the code I used in arduino:

          #include "Ultrasonic.h"

          Ultrasonic ultrasonic(01);
          void setup()
          {
          Serial.begin(9600);
          }
          void loop()
          {
          long RangeInInches;
          long RangeInCentimeters;

          Serial.println("The distance to obstacles in front is: ");

          RangeInInches = ultrasonic.MeasureInInches();
          Serial.print(RangeInInches);//0~157 inches
          Serial.println(" inch");
          delay(250);

          RangeInCentimeters = ultrasonic.MeasureInCentimeters(); // two measurements should keep an interval
          Serial.print(RangeInCentimeters);//0~400cm
          Serial.println(" cm");
          delay(250);
          }


        
image of the pcb parameters image of the pcb parameters

Test with my own pcb

To see if the ultrasonic sensor would also work with the board i designed in week 4, i did the same test as the one with the barduino.

To do this, i used the same code but changed the pinnumber to pinnumber 1.

The sensor that i use: Grove Ultrasonic Ranger v2.0 sensor, simplifies the interface by combining the trigger and echo functionality into a single pin. This makes it easier to connect to microcontrollers because it requires only one digital I/O pin (in this case pinnumber 1) in addition to power(vcc) and ground. That is why it does not use I2C to communicate because this is another protocol.

The microcontroller on the dev board i made only has GPIO pins. This means that I could use any pin to attach this sensor to as long as i declare the connected pinnumber.

image of the ultrasonic sensor

image of the ultrasonic sensor in arduino

Interesting sensors that i'd need to check

To test some things for my final project, it could be interesting to see which sensors I would need.

The current idea is to use a sensor that can detect the status of a liquid inside a container.

There are a couple of ways to this:

  1. Open circuit sensor:

    Found the information about the level indicator on this website

  2. floating (switch)sensor: A floating sensor measures liquid levels in open channels by floating on the surface and detecting changes in level using a sensor, such as a float switch or ultrasonic sensor. In this video you can see how the float switch works.

    image of the floating sensor

    On this website, you can see how the ultrasonic sensor works.

    image of the ultrasonic sensor

Group assignment

week 11