Difference: AnalogueToDigitalConversion (1 vs. 2)

Revision 22017-11-27 - uli

Line: 1 to 1
 
META TOPICPARENT name="CourseExercises"

Analogue to Digital Conversion (ADC)

Goal:

Line: 27 to 27
 
META FILEATTACHMENT attachment="pcf8591front.png" attr="" comment="" date="1508956744" name="pcf8591front.png" path="pcf8591front.png" size="1122628" user="uli" version="1"
META FILEATTACHMENT attachment="pcf8591ADC.odt" attr="" comment="" date="1508957337" name="pcf8591ADC.odt" path="pcf8591ADC.odt" size="1147394" user="uli" version="1"
Added:
>
>
META FILEATTACHMENT attachment="adc.pdf" attr="" comment="" date="1511779064" name="adc.pdf" path="adc.pdf" size="1593747" user="uli" version="1"

Revision 12017-10-25 - uli

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="CourseExercises"

Analogue to Digital Conversion (ADC)

Goal:

Apart from the digital to analogue converter where we created analog signal levels from digital values, we have only handled binary data, high or low. Many sensors however deliver analogue signals and we must first convert them into digital values before we can read the out and treat the data.

The pcf8591 is an analogue to digital converter (ADC) which does exactly this. It is not a very good one, having only 8 bit resolution (how much is this in %?) and we have a much more precise, 16 bit ADC in our sensor kit, but the board on which the pcf8591 is mounted has already sensor delivering analogue signals is it is therefore very convenient to make our first experience with A to D conversion with such a board.

In particular the board has a potentiometer mounted on it with which we can easily create different analogue signal levels and we can see immediately if our program see the changes.

The pot is the blue and white device with the slit in its middle, next to it you have photo resistor and finally a thermistor, devices that change their resistivity with the light intensity or temperature respectively.

pcf8591front.png

Exercise 1

Find out on which I2C address you can talk to the pcf8591. Write code to initialize the I2C bus using the pigpio library. Write the code needed to read all four channels. Check what happens when you change the potentiometer value. Does the digital value change? Check the same thing on the photo resistor and the thermistor.

Exercise 2

Combine this exercise with the one on the LCD display and create a simple voltmeter. You can try to set a Voltage with the DAC and read it back with the ADC and display the result on the display.

-- Uli Raich - 2017-10-25

Comments

<--/commentPlugin-->

META FILEATTACHMENT attachment="pcf8591front.png" attr="" comment="" date="1508956744" name="pcf8591front.png" path="pcf8591front.png" size="1122628" user="uli" version="1"
META FILEATTACHMENT attachment="pcf8591ADC.odt" attr="" comment="" date="1508957337" name="pcf8591ADC.odt" path="pcf8591ADC.odt" size="1147394" user="uli" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback