Académique Documents
Professionnel Documents
Culture Documents
time.
available only in the analogue form, it is an important requirement for physical computing devices to sense this information.
0 Sensors : Devices which convert analogue information in
ADC
0 The Arduinos microcontroller cannot work with analogue
ADC Resolution
0 The Arduino has an inbuilt ADC with a 10 bit resolution
0 This means that between GND and AREF, the arduino can
sense 2^10 = 1024 different voltages. 0 Where 0 == GND and 1024 = AREF 0 The output of the ADC will be a number between 0 and 2^10 -1
0 Resolution : 5-0/1024 = 4.9mV 0 This should the difference between any two samples of the
Sampling Rate
0 Each time the ADC senses the input voltage level and
conversion.
Analogue Reference
0 By default all Arduino analogue pins have a reference of
0 E.g.: If 1.1V is given to the AREF pin, 0 Resolution = 1.1/1024 = 1.04mV between 0 1.1V
datasheet)
0 Practically, ADC samples at ~56Khz. 0 !! Arduino doesnt have a DSP so sampling is done by CPU
only. Other tasks given to the CPU will affect Sampling rate adversely.
to voltage changes.
0 Open 5. ADC folder. Upload the code onto arduino. 0 Make pot connections as per circuit diagram.. 0 If all goes well twisting the pot should make the LED
0 Connect the analogue input to an analogue pin. 0 Analogue pins are called A0 A6. 0 Use analogueread(pin) to initiate and perform a single ADC
conversion.
Code to write
0 Read the sensor
Question Time