Skip to content

11. Input devices

This week indidual assignment was to measure something and add a sensor to a microcontroller board that I have designed in week 7 of electronic design assignment and read it.

Research

Before starting my work, I first search for keywords in assignment. I started by finding the meaning of sensor and what it uses for.

Sensor: is a device that detect changes and events in a phyisical stimulus and provide a corresponding output signal that can be measured or recorded means the output is an electrical quantity that can be measured.

There are two types of sensors

  1. Analog sensor: produces continousily varying output signal over a range of values. Usualy the output value is voltage and is proportional to the measured quantities like speed, temperature, pressure. Thermocouple or Thermometer is an example of this type of sensor.

  2. Digital sensor: Produce discrete digital signals(1 which is ON and 0 which is OFF). For instance Switch when it is pushed=ON=1 and when it released=OFF=0.

In this assignment I have used LDR(Light Depended Resistor, or Photo Resistor) as analog sensor to decrease its resistance when light is applied to it. ##PCB designing

Below, I have replaced my switch in designed HelloWord PCB with LDR, my sensor. I added devices, Annoted them as I did it in Week 7.

Below, I have assigning Footprints

Below, is my produced PCB with its Edgecuts and Plot it to produce F.CU Svg and Edge Cuts files and open them in Gimp.

Below is my F.Cu in Gimp to produce a F.CU png file to be pulled in mods.

Below, is my PCB Edge Cuts in Gimp to produce an Edge Cuts PNG fle to be putted in mods.

PCB production

After putting through mods my PCB F.Cu and Egde Cuts to produce F.Cu and Edgde cuts RML files to be cutted and milled by Our FabLab Roland machine I putted my work in it and do it then After I solded on my PCB by adding electronic devices such as 1ATtiny45, 1AVR-ISP-6,1LED, 2Resistors, and my Light Dependent Resistor. After soldering it, Below is the produced board.

PCB Programing

I have used the code below to program my Light Depend Resistor sensor

  int LDRSensor = 3;
  int LED = 4; 
  int val = 0;

  void setup()
  {
    pinMode(LED, OUTPUT);
    digitalWrite(LED,LOW);
    delay(2000);
    digitalWrite(LED,HIGH);
  }

  void loop()
  {
    val = analogRead(LDRSensor);    // read the input pin
    if(val < 200)
    {
      digitalWrite(LED,LOW);
      delay(2000);
    }
    else
    {
      digitalWrite(LED,HIGH);
    }
  }

Below, I was programming my Input Board using ISP programer and when the Light increased , Resistance of my sensor decreased.

Below, My LDR Sensor has light on it, its resistance decreased and my LED lighten

Below, there is no light on my Light Dependent Resistor and my LED come down, is OFF

DawnloadUsedFiles Here

GROUP ASSIGNMENT

The group assignment was to probe an input device’s analog level and digital signals.

Imag1

We measured the analog signal by connecting both the probe of oscilloscope to GND and VCC pin of dc motor and rotate the shaft manually.

Generally, the motor is considered as the output device but if we give it rotation manually then an induced voltage can be seen on the oscilloscope and the construction of motor and generator are simular then we use motor as input device.

Img2


Last update: September 21, 2022