/PCF8591

This Python code is about a i2c -D/A &A/D- device, PCF8591 library using wiring pi on Rasbperry pi 3. Plese feel free to use !

Primary LanguagePython

PCF8591

This Python code is about a i2c -D/A &A/D- device, PCF8591 library using wiring pi on Rasbperry pi 3. Plese feel free to use !

Requirement

  • Raspberry pi 3
  • ubuntu16.04
  • Python 3.x
  • wiring pi
  • PCF8591

Setting

i2c enable

$ sudo raspi-config
  1. Choose Advanced Option
  2. Enable i2c

Wiring

Pin Assign

PCF8591 --------- Raspberry pi3
SDA ------------- GPIO2/SDA1
SCL ------------- GPIO3/SCL1
VCC ------------- 3.3V
GND ------------- GND

Features

  • Model number : PCF8591
  • Voltage : DC2.5V-6V
  • Analog Input Voltage : 0V-5V
  • Interface : i2c
  • A/D Resolution : 8bit

Usage

Basic Example

$ python3 PCF8591.py

D/A & A/D example

In this program, Raspberry pi read a variable register value(0-255) on PCF8591 default setting. And output to LED(located at lowwer in this picture) which is on PCF8591 using Digital analog converter.

$ python3 DA&ADexample.py

Licence

MIT

Related Articles

Author

ShuDiamonds