Operácie

Zbernica i2c: PCF8591

Z SensorWiki

Verzia z 12:51, 15. marec 2021, ktorú vytvoril Balogh (diskusia | príspevky) (Modul YL-40)

Zatiaľ len odkazy na dokumentáciu k obvodu, ktorý použijeme aj ako A/D a D/A prevodník, ale aj ako obvod pripojiteľný na zbernicu i2c.



Modul YL-40

MIPS Modul YL-40.jpg
Modul YL-40 obsahuje kombinovaný A/D a D/A prevodník PCF8591 a niekoľko ďalších komponentov. K mikroprocesoru ho pripájame cez konektor J3, ktorý okrem napájania obsahuje aj dva komunikačné signály rozhrania i2c - SCL (Serial Clock) a SDA (Serial Data). Na druhej strane modulu sa nacháda konektor J2, na ktorom sú štyri analógové vstupy a jeden analógový výstup. Adresa modulu je nastavená na pevno signálmi A0, A1 a A2 a nedá sa zmeniť. Na module sa nachádza aj trimer (premenlivý rezistor nastaviteľný nástrojom), ktorým si ľahko možno overiť správnu funkciu A/D prevodníka. Okrem toho je na module aj termistor a fotoodpor, ktoré umožňuu realizovať orientačné merania teploty a osvetlenia. Ak potrebujete využiť všetky štyri analógové vstupy, dajú sa tieto prvky odpojiť prepojkami J4, J5 a J6.


Ain 0 - J6 - fotorezistor (s rast[cou hodnotou osvetlenia hodnota klesá) Ain 1 - NTC termistor (s rastúcou teplotou hodnota klesá) Ain 2 - nezapojený (náhodné čísla) Ain 3 - potenciometer ( 0 - 255 )

Ain 0 J5 fotorezistor (s rastúcou hodnotou osvetlenia hodnota klesá)
Ain 1 J4 NTC termistor (s rastúcou teplotou hodnota klesá)
Ain 2 -- nezapojený (náhodné čísla)
Ain 3 J6 potenciometer ( 0 - 255 )

MIPS 8591 SchemaZapojenia.png
Schéma zapojenia modulu YL-40


Note:
From the schematic diagram, a potentiometer is connected to AIN0. You can connect the P3 by the jumper cap, which is to wire the two pins next to the pot, so the pot can be used as the input of AIN0.

PCF8591

The PCF8591 is a single-chip, single-supply low power 8-bit CMOS data acquisition device with four analog inputs, one analog output and a serial I2C-bus interface. Three address pins A0, A1 and A2 are used for programming the hardware address, allowing the use of up to eight devices connected to the I2C-bus without additional hardware. Address, control and data to and from the device are transferred serially via the two-line bidirectional I2C-bus. The functions of the device include analog input multiplexing, on-chip track and hold function, 8-bit analog-to-digital conversion and an 8-bit digital-to-analog conversion. The maximum conversion rate is given by the maximum speed of the I2C-bus.

Block Diagram

Súbor:20150805143217.png

Pin Function

Súbor:PCF8591T.png Súbor:20150805143308.png

Features

  • Support acquisition of external 4-line voltage inputs (ranging 0-5v), with a single power supply
  • Standard double-sided printed circuit board, 1.16mm thick, with an elegant layout, 3-mm holes at each corner for easy fixing
  • Use an 8-bit successive approximation A/D converter
  • Input/output by an I2C bus
  • Working voltage: 2.5-6V DC; PCB size: 2.4 x 2.8 cm
  • Single supply, low standby current
  • Address by 3 hardware address pins

Resource

PCF8591 datasheetSúbor:PDF.jpg
Test Experiment for ArduinoSúbor:LINK.jpg
Test Experiment for Raspberry PiSúbor:LINK.jpg