Team 10

 

                       REAL TIME EMBEDDED PROGRAMMING ENG5220

Team 8: Juan Anza 2125875a                            Igbinosa Moses Osaze     2114224

PROJECT TITLE: PRESSURE SENSOR

  1. 1.    

    AIMS

    :
  • To design a circuit that measures an analogue quantity, in this case pressure using a force sensitive resistor.
  • To design a sigma-delta converter which will be connected to the general purpose I/O header on the raspberry pi to convert this analogue signal into a digital signal.
  • To multitask under Linux by reading the digital signal from the A/D converter and ‘simultaneously’ plotting the data on a screen.
  • To allow user interaction with the display using a mouse.
  • To turn on LEDS using hardware and software based on the pressure in the circuit and compare the time it takes to do this using an oscilloscope and hence comment on the response of the raspberry pi as an embedded system.

2.         PROJECT DESCRIPTION

This project measures pressure using a force sensitive resistor. It does this by varying its resistance depending on the applied pressure. The FSR 402 sensor is used in this experiment. The analogue pressure output is converted to a digital signal using an AD7705 analogue to digital converter: which is a sigma –delta converter. The digital signal is read from the A/D using a QT thread class that runs on the main QT program which is use for the display. Depending on the pressure value; one, two or no LED could be turned on. An LED is also turned on upon the application of pressure using hardware. The time taken for the LED to be turn on using hardware is compared with that obtained using software by an oscilloscope to analyse the speed of the raspberry-pi.

3.      HARDWARE

The hardware for this project consists of two parts viz:

i. The Analogue – Digital Converter Circuit

 ii. The pressure sensor circuit;

  3.1 The Analogue-Digital Converter:

Components

 1 x MCP1525

1 x 0.1µF

7 x 22R

2 x 1 µF

1 x AD7705

The circuit diagram for the implementation of this is shown below:

 fig 1 a Circuit Diagram Uploaded from moodle (Bernd Porr,2014)

 Figure 1b PCB Layout uploaded from moodle

3.2PRESSURE SENSOR CIRCUIT

Components:

I X FSR 402 sensor

3 X 22Ω resistor

2 X 130Ω resistor

2X yellow LED

1X Green LED

The circuit diagram for the implementation of this is shown below:

 Figure 2 Pressure Sensor Circuit. 

As depicted in the circuit above, the non-actuated resistance of the FSR 402 sensor is approximately 10MΩ (Interlink Electronics 2010), and hence at this state the voltage drop across it is approximately 3.3Volts. As  pressure is applied, its resistance varies.The 66Ω resistor (three 22Ω resistors connected in series), is used to limit the current across the sensor such that  2.7 Volts would be drop across it at the lowest resistance range of 300

 

fig 3LABORATORY SET-UP

4.      SOFTWARE IMPLEMENTATION

Window.cpp was made to continuously read the value of the adcreader while it has sample. Also, the GPIO pins 18 and 22 corresponding to raspberry pi GPIO pins 24 and 25 were declared as output pins and made high or low depending on the pressure in the circuit .The complete software code can be found in the link below:

https://github.com/mosano987

5.      RESULTS

The experimental results are presented below

 

Figure Waveform Before the application of pressure

 

Figure 5 Waveform after the application of Pressure.

 

Figure 6 Time Delay Compare Using A scope. The yellow indicates Hardware LED while the Green indicates Software LED.

6.     OBSERVATIONS:   It was observed that the application of pressure through the force resistive sensor modified the waveform observed on the screen as illustrated in figure 5. One of the yellow LEDS was observed to light up when the applied pressure is low and as the pressure was increased both LEDS light up as set on the program. Also, immediately a pressure is applied, current flow in the circuit lighting up the green LED. The time taken to light up the LEDs using hardware was found to be faster than that taken to light the LED using software (this was observed using an oscilloscope) and is depicted by figure 5 above. The time lag by the software LED was approximately 110ms.

7.     IMPROVEMENT:

  Hardware: The use of a better pressure sensor can greatly improve on the accuracy of the measurement as the FSR 402 sensor is not very accurate. Soldering the circuit on a printed circuit board will also improve on the accuracy. Though a foil was used to eliminate electromagnetic interference in this setup, better means could be used to this.

           Software: As shown by the scope measurement, the software response lags the hardware response by 110ms. For situations where a faster response is desired, using  assembly language is recommended.

8. APPLICATIONS:  These design finds applications in touch screen mobile devices, it can also be used in alarms systems by using the pressure differential to trigger alarm circuits and also in robotics to control  the end effector.

9.     CONCLUSION:  The team have successfully measured an analogue signal (Pressure) using a force resistive sensor, converted this analogue signal to a digital signal using an AD7705 A/D converter and displayed the measured analogue quantity on a screen using a Qt program. The Knob was also set to reflect the increased pressure in the circuit.

A demonstration of the circuit operation is given below:

 

References:

Bernd Porr (2014) rpi_ad7705 [Online] Available from: http://moodle2.gla.ac.uk/course/view.php?id=2341 [Accessed 10/03/2014].

INTERLINK ELECTRONICS (2010) FSR 402 Data Sheet [Online] Available from: http://www.trossenrobotics.com/productdocs/2010-10-26-DataSheet-FSR402-Layout2.pdf [Accessed 28/03/2014]