Week 11

Week 11: Input Devices


Group Assignment

  • Measure the analog levels and digital signals in an input device.

  • Individual Assignment

  • Measure something: add a sensor to a microcontroller board that you have designed and read it.
  • Group Assignment

    This week's group assignment was to detect the analogue and digital levels of input device we made individually so we started to measure the anlogue voltage levels of photo transitor which was used by me in this week's assignment. In group assignment we measured the voltage levels of this component which changes whenever we increase or decrease the intensity of lights on it. We connected the sensor module to 5 voltage and checked the output on data pin and ground using multimeter. We observed that whenever we increase the intensity of light voltages increase and whenever we decrease intensity of light voltage decrease. Both of the experiments are shown below in figures (a) and (b) respectively.

    (a) Measuring Voltage levels with low intensity of light

    (b) Measuring Voltage levels with high intensity of light

    HC SR-04 Ultrasonic sensor is used by one of our group member in his individual task of this week so we used that sensor for detecting the digital signals. We have detected the change in digital signal in Oscilloscope using arduino Leonardo. A sensor is connected with arduino and the pin of Echo is connected with Oscilloscope. Arduino Leonardo is programmed to detect obstacle in front of Ultrasonic sensor, when an obstacle is present in front of Ultrasonic sensor we found change in wave in oscilloscope. The captured digital signal of ultrasonic sensor is shown below in figure. Furthermore the echo pin of sensor is connected to the pin 13 of leonardo which is also connected to led of board. The video given below shows that whenever there is change in signal led is blinking. The rate of led blink is very fast because digital signal is changing fastly.

    Digital signal shown in Oscilloscope

    Individual Assignment

    As part of this week assignment I had to make board with any input sensor which shall take input like phototransistor, temperature sensor. As my project is related to leds so I tried to find something related to project like sound. I found two types of microphone adressed by neil. I started with one which was available at fab lab khairpur

    Amplified SiSonic Microphone
    The Sisonic is a miniature, highperformance, low power, top port silicon microphone. Using Knowles’ proven high performance SiSonicTM MEMS technology, It consists of an acoustic sensor, a low noise input buffer, and an output amplifier. These devices are suitable for applications such as cellphones, smart phones, laptop computers, sensors, digital still cameras, portable music recorders, and other portable electronic devices where excellent wideband audio performance and RF immunity are required












    Some Features of SiSonic Microphone








    1. Up to 20dB of Gain
    2. Low Current
    3. Small package
    4. MaxRF protection
    5. Ultra-Stable Performance
    6. Omnidirectional
    Pin configuration of SiSonic Microphone








    Pin indication
    Pin Values

    Interfacing Circuit of SiSonic Micorphone




    The Sisonic amplified analog microphone's interfacing circuitry is shown below in figure(a). It can be seen from figure below that mems microphone is attached with opam ic where capacitor and resistors are also used to set the gain of opam ic. The figure (b) shows thepin explaination of above circuit where it ca be seen that unity gain(0 dB) can be obtained by connecting gain directly to output, maximum gain(20 dB) can be obtained by setting R1 equal to zero and c1 equal to given high pass corner frequency equation however adjustable (0 to 20 db) gain can be obtained by setting R1 and C1 by given equations.

    (a) Interfacing Circuit

    (b) Pin Explaination

    Frequency response curve




    The sensitivity (dB) vs frequency response of SiSonic microphone is shown below in figure. The given response shows that microphone has almost constant sensivity of 0 dB over all frequency band. Furthermore it can also be seen that the sensivity suddenly rise after corner frequency of 10kHz and suddenly fall behind 100 Hz. Hence we can deduce that microphone works very well in the range of 100 Hz-10,000 Hz.

    Frequency response curve

    Cross Sectional View




    The below given figure shows the cross sectional view of the mems microphone metal can package where it can be seen that mems and IC are attached on base PCB and connected by wirebonds. Furthermore solder pads, port hole, and metal cap are also shown in cross sectional view of analog SiSonic microphone.

    Cross sectional view

    Designing the board




    I designed the board of analogue mic in eagle software which can be seen below. I made this board to work as input and output like micorphone as input and rgb leds as output. For output I have added extra header of 3x1 which is used for leds. One pin shall be utilized for data in and two other are for VCC and ground. The designed board is shown below in figure.

    A designed board for input and output

    Milling the designed circuit




    In order to mill the designed circuit I need png monochrome image with resolution of 2000 so exported that as png monochrom from eagle. The exported png image can be seen below. Figure (a) shows the taces png image, figure(b) shows the outline png image and figure (c) shows the drill holes monochromatic image.

    (a) Monochrome image of designed board
    (b) Outline of board
    (c) Holes of designed board

    Path making




    I followed the learnt process of generating path files. I did this using fab modules where I generated the rml files of traces , drill holes and outline. All of the images are shown below. figure (a) shows the rml generation of traces,figure (b) shows the rml generation of outline and figure (c) shows the rmls of drill holes used in the designed board.

    (a) Rmls of traces
    (b) Outline traces
    (c) Drill holes of designed board


    Required Components




    1) Attiny 45 (01).
    2) Resistor (10 Kilo Ohm =>01 and 1 Kilo Ohm => 01).
    3) Capacitor (10 uf)=01 and Capacitor (1uf)=03.
    4) IC regulator 3.3V
    5) SMD Header (6 pin).
    6) ISP header (6pin) through hole
    7) Header 3x1 through hole.
    8) Analogue micorphone

    Soldering the components






    I soldered this board but this did not worked. Since I was unsure in soldering so I resoldered this board that's why the soldering is bumpy and bad. I think I wasted much time just to make this mic work so I tried to take the mic out and check with arduino.

    Board after resoldering

    It went well with arduino. The figure (a) shows the code which I used for microphone and and the figure (b) shows the arduino output on serial monitor where it can be seen that values are continuously changing and figure (c) shows the led blinking with tune.

    Analogue Code used in arduino IDE
    Serial monitor
    SeSonic Mic with arduino


    Designing the New Board




    In order to cover input, output assignment and final project I am designing this generic pcb board. For that I chose Atmega328u microcontroller which I will be using onwards. From begining I am using eagle software for designing of pcb boards therefore I will also use eagle for this board. For arduino leonardo circuit design I have followed my instructur's webpage i-e Suhail Ahmed Soomro. The designed boards Schematics, traces, outline and drills are shown in below figures respectively.

    Schematics


    Traces


    Outline


    Drills


    After getting the traces, outline and drills I had to generate rml files which is given to SRM20 machine. For that I used fab modules which generates rml files of given monochrome png image. In figure (a) rmls of traces are shown, in figure (b) rmls of outlines are shown and in figure(c) the rmls of drills are shown. we shall keep in mind that drill bit 1/64 should be chosen for traces and 1/32 should be chosen for both outlines and drills. Also make sure you should use drills rmls first and outlines rmls second.

    Rmls of Traces


    Rmls of Outline


    Rmls of Drills


    Leonardo after milling


    Leonardo after soldering


    Designing IR Photo transistor Module




    Now I have taken photo transistor sensor which reacts to light. Firstly I made this module in eagle software which can be seen in given figure. The outline, drills and module are also shown below in figures. After doing that I did some analogue programming which is mentioned in programming section. In last there is video which shows that whenever I am changing the intensity of light I am getting the change in embeded led of arduino leonardo.

    Traces of IR module


    Outline of IR module


    Drills IR of module


    IR sensor module after soldering


    Programming






    const int analogInPin = A0;

    const int analogOutPin = 13;

    int sensorValue = 0;

    int outputValue = 0;

    void setup() { Serial.begin(9600);

    }

    void loop()

    {

    sensorValue = analogRead(analogInPin);

    outputValue = map(sensorValue, 0, 1023, 0, 255);

    analogWrite(analogOutPin, outputValue);

    Serial.print("sensor voltage level = ");

    Serial.print(sensorValue);

    Serial.print("\t LED output = ");

    Serial.println(outputValue);

    delay(100);

    }

    /