The shipping fee depends on your address
Standard: 9-15 business days,fee is down to $3.99
Express: 4-7 business days,fee is down to $5.99
WE'RE READY TO BUILD A CUSTOM PRODUCT FOR YOU.
If you're looking for a custom product, we can help. Kindly contact us via email support@keszoox.com and send us the details for your need, then we'll let you know how we can deliver the right solution.We make into production usually Within 1 - 3 Bussiness Days.
Expect customization orders.Module with I2C interface has 4 analog inputs, 1 analog output and built-in LDR, thermistor and potentiometer.
The PCF8591 module with I2C interface has 4 analog inputs, 1 analog output and built-in LDR, thermistor and potentiometer.
This module is basically a reference design to show off some possible applications of the PCF8591 chip. It is a good learning module which incorporates both ADC inputs and a DAC output and includes basic sensors in a nice small inexpensive package. It also has some practical use in projects that can make use of the built-in features.
The DAC output is connected to pin AOUT.
The 8-bit single output provides 256 steps of resolution. For a VCC of 5V, the step size will be 5V/256 = 20mV.
The DAC output has a modest current capability to begin with and also has a 1K resistor and LED hooked up to it. The LED makes it easy to see the affect of changing the analog output for experimenting, but for use in actual applications it limits the output swing from reaching full Vcc. If Vcc is 5V, it will max out at about 4.2V. For applications that need the full GND to Vcc swing of the DAC output it is recommended to remove the LED to avoid the extra load on the output.
The DAC is also used internally by the ADC inputs. If using the DAC output, a track-and-hold circuit keeps the value that was set on the output pin while the DAC circuit is being used by the ADC circuit.
The 4 analog inputs connect to the header pins AIN0-AIN3 and can be used as 4 general purpose analog inputs. By default these are 4 single-ended inputs referenced to ground. The PCF8591 chip also supports using them as 2 differential inputs. Refer to the datasheet for specifics on using that mode.
There are 3 jumpers installed on the module that alternatively connects an on-board LDR, thermistor and potentiometer to 3 of these 4 inputs as follows. If you want to use those inputs as general purpose inputs, the jumper should be removed from that location.
J5 – Connects LDR to channel 0 (AIN0)
J4 – Connects thermistor to channel 1 (AIN1)
J6 – Connects the potentiometer to channel 3 (AIN3)
Note that channel 2 (AIN2) does not have an alternate purpose, so no jumper is necessary.
LDR – The Light Detecting Resistor (LDR) can detect basic changes in the intensity of the light striking it.
A decrease in the amount of light hitting the sensor will cause an increase in the voltage on channel 0.
The LDR is useful for detecting larger changes in light or differentiating between night and day. The value read is a relative number rather than an absolute light intensity value.
Thermistor – The thermistor is a resistor that changes resistance based on temperature.
A decrease in temperature will cause the voltage to increase on channel 1.
The thermistor is useful for detecting changes in temperature. Since the specification of the thermistor is not known so it is difficult to use it to measure the actual temperature. It is better suited for measuring relative changes in temperature and in some cases the readings can be correlated to a temperature by empirical testing.
Potentiometer – The 10K potentiometer is connected between Vcc and Gnd with the wiper connected to channel 3.
Rotating the potentiometer will cause the voltage to vary between 0V and Vcc. Rotating the potentiometer CW decreases the voltage on channel 3.
The potentiometer can be used as a general purpose analog control input. For instance, the potentiometer can be read and the DAC output driving the LED can be set to match the read value.
I2C Address
The module has a fixed I2C address of 0x48. The chip itself has 3 address pins but they are all tied to ground on the module, so it is not adjustable.
I2C Pull-Up Resistors
The module includes two 10K pull-up resistors on the I2C SCL and SDA lines.
The connections to the module are fairly simple.
1 x 4 Header
1 x 5 Header
These modules have fair build quality and are easy to use for demonstrating analog input and analog output concepts. It can also be handy in small applications where you need some or all of the functionality that it provides.
The main limitation is that the ADC and DAC are 8-bit which is relatively low and may be a limitation for some applications. Having a fixed I2C address is not usually an issue for the type of applications this module is suitable for, but if it is desired to use two modules, it would require a 2nd I2C bus.
The test program here uses the library by Rob Tillaart which can be downloaded via the Library Manager in the Arduino IDE.
The connections are simple, just connect the module I2C SDA and SCL lines to the corresponding MCU SDA and SCL lines. Also apply 5V or 3.3V power to match your MCU and ground. If you are powering the module from 5V, you can connect 3.3V to the channel 2 (AIN2) header pin to have something to read on that channel.
The program below is designed to test the basic features of the module. It first exercises the DAC output by ramping the brightness of the on-board green LED up and then back down. The four analog inputs are then read. If you have the jumpers installed, it will read the LDR, thermistor and potentiometer. If the jumpers are removed it will read the voltage on the header pins instead.
When the appropriate section of the program is executing, you can shield the LDR or shine a light on it to see the change. The thermistor can be warmed with your fingers and the potentiometer can be adjusted to see the effect. On the unassigned AIN2 pin, the program converts the reading to a voltage. If you connect it to 3.3V, you should see a reading of between about 3.15V and 3.45V
In our test program, we use the MAP function to reverse the functionality of the LDR and thermistor so that they both increase in value as the light or temperature increases as you would normally expect. It is not really necessary, but it makes these sensor inputs react more intuitively.
/* PCF8591 Module Test Program * CH0 = Photoresistor Input * CH1 = Thermistor temperature input * CH2 = Unassigned analog input * CH3 = Potentiometer Input * * Connect I2C SCL/SDA and power/ground * Uses Rob Tillaart library. URL: https://github.com/RobTillaart/PCF8591 */ #include "PCF8591.h" PCF8591 dev(0x48); //=============================================================================== // Initialization //=============================================================================== void setup() { Serial.begin(9600); Wire.begin(); dev.begin(); } //=============================================================================== // Main //=============================================================================== void loop() { // Test D/A output Serial.println("D/A Output Test - Ramp LED up/down"); dev.enableDAC(); // Enable DAC output for (int i = 0; i < 256; i++) // Ramp voltage / LED brightness UP { Serial.println(i); dev.analogWrite(i); delay(15); // just to slow the effect } for (int i = 255; i >= 0; i--) // Ramp voltage / LED brightness DOWN { Serial.println(i); dev.analogWrite(i); delay(15); } dev.disableDAC(); // Disable DAC output // Test Ch0 LDR Serial.println("Ch 0 LDR Light Test"); for (int i= 0; i<30; i++) // Take 30 readings { byte ch0 = dev.analogRead(0); // Read LDR sensor input ch0 = map(ch0, 0,255, 255, 0); // Map reading so brighter = higher value Serial.println(ch0); // Shield sensor to see change delay(350); } // Test Ch1 Thermistor Serial.println("Ch 1 Thermistor Temperature Test"); for (int i= 0; i<30; i++) { byte ch1 = dev.analogRead(1); // Read Thermistor sensor input ch1 = map(ch1, 0,255, 255, 0); //Map reading so warmer = higher value Serial.println(ch1); // Warm sensor to see change delay(350); } // Test Ch2 Analog Input Serial.println("Ch 2 Analog Input Test"); // Read analog 2 input for (int i= 0; i<30; i++) // Connect to 3.3V to see difference { byte ch2 = dev.analogRead(2); float voltage = ch2 * (5.0 / 256.0); // Convert reading to voltage Serial.println(voltage); delay(350); } // Test Ch3 Potentiometer Serial.println("Ch 3 Potentiomter Test"); // Read potentiometer input for (int i= 0; i<30; i++) { Serial.println(dev.analogRead(3)); // Read and print value from pot delay(350); } }
Notes:
Operational Ratings | ||
Vcc | 2.7 – 6V (3.3V or 5V typical) | |
VOut | Output Voltage Range (no load) | 0V to Vcc |
Output Voltage Range (10K load) | 0V to 0.9 x Vcc | |
Resolution | Analog input | 8-bits |
analog output | 8-bits | |
Dimensions | L x W (PCB) | 35 x 23mm (1.38 x 0.9″) |
Country of Origin | China | |
Datasheets | NXP / Philips | PCF8591 |
WE'RE READY TO BUILD A CUSTOM PRODUCT FOR YOU.
All orders are dispatched from our warehouse. The shipments are fully tracked—from our door to yours. Please allow 3-5 business days for your order to be processed in addition to the shipping times below.
Standard: 9-15 business days. Express: 4-7 business days.
Please note that shipping providers are extremely busy during this time, and some orders might experience a delay on top of usual delivery times. If your order is late, please allow 5-10 days more than indicated in standard shipping times before contacting our customer service. Thank you for your understanding.
All orders are 100% tracked. You’ll receive an email with a tracking number and a link to track your parcel once your order leaves our warehouse. Please allow 24-48 hours for the tracking link to start showing shipping information.
Receive our latest updates about our products & promotions.
Thanks for subscribing!
This email has been registered!