Lesson 02 - Realtime applied on direct IO

The lecture - direct IO

Tentative agenda.

  • To get deeper knowledge about analogue sensors demonstrated with a NTC resistor

  • Be able to going from analogue measurement(voltages) to real engineering values (temperature in K or C)

  • Understand dynamics of analog to digital conversion (8,9,10,…13,… bits)

  • first training in implementing in HW/SW on an Arduino

Read about NTC here

Read more about measuring voltage

An excellent tutorial about analog to digital conversion See Sparkfun measuring voltages

Preparation for the lecture

  1. Get a NTC - we will suplly with one pr group

  2. Read NTC pages

  3. Read Sparkfun tutorial

  4. Read about adc principles

    1. Please look at Types section where there is link to the different types of ADC.

Exercises

  1. Do a simple handwritten schematics for using a 10kOhm NTC for measuering temperature in interval 0-30 C

    1. Includes propes selection of value of fixed resistor

  2. Design algorithm for calculating temperature

    1. Can you do it with integer variables

  3. Implement the code

  4. Design a test suite so you can see max ADC frequency

    1. How many conversions you can to pr second

  5. Set a fixed voltage divider on the input pin for the ADC

    1. 5V -> 10kOhm->10kOhm->0V

    2. Measure voltage

    3. Do 10000 conversions and do statistics for values

      1. Is is the same value you get all times

      2. hint: do it in integer because you ADC returns and integer

  6. If you are going to measure temperatures in range -40 to -30 C with a 10 kOhm NTC please argue for the value of teh fixed resistor

    1. Shall it be 10 kOhm like when measuring around 20C

    2. Hint what is the resistance of a 10 kOhm NTC at -40C -30C -20C etc

and …

  1. finalize the exercises from last lecture

Litterature

See lect02_prep section for read instructions

The litterature below is copy from prep and movies section.

  1. Read NTC pages

  1. Read Sparkfun tutorial

  2. Read about adc principles

    1. Please look at Types section where there is link to the different types of ADC.

Movies

  1. different types of ADC conversion principles

  2. hard core about ADC not mandatory but interesting

    1. for Arduino direct on the iron

Movies

  1. hard core about ADC not mandatory but interesting

    1. for Arduino direct on the iron

  2. different types of ADC conversion principles

After today - you should (at least) be able to …

  1. Understand temperature measurements by use of NTC

  2. Understand ADC principles

  3. Be able to implement a temperature measure device by a NTC and an Arduino

  4. Understand quantification (8,9,10,.. bit resolutino)

Tips