Combined Data Sheet
Combined Data Sheet
(http://www.dfrobot.com/) Home (https://www.dfrobot.com/) > Sensors & Modules (https://www.dfrobot.com/category-156.html) > Sensors
(https://www.dfrobot.com/category-36.html) > Liquid Sensors (https://www.dfrobot.com/category-68.html)
Contents
1 Introduction
2 Specification
3 Board Overview
4 Tutorial
4.1 Requirements
4.2 Prepare the Probe
4.3 Connection Diagram
4.4 Probe Calibration
4.5 Sample Code
5 FAQ (https://www.dfrobot.com/product-1628.html)
6 More Documents Gravity: Analog Dissolved Oxygen Sensor
SKU: SEN0237
Introduction (https://www.dfrobot.com/product-1628.html)
There’s an old saying regarding to keeping fish, “Good fish deserves good water”. Good water quality is very
important to the aquatic organisms. Dissolved oxygen is one of the important parameters to reflect the water
quality. Low dissolved oxygen in water will lead to difficulty in breathing for aquatic organisms, which may threaten the lives of aquatic organisms their lives.
We launched a new opensource dissolved oxygen sensor kit, which is compatible with Arduino. This product is used to measure the dissolved oxygen in water, to
reflect the water quality. It is widely applied in many water quality applications, such as aquaculture, environment monitoring, natural science and so on. This
sensor kit helps you quickly to build your own dissolved oxygen detector.
The probe is a galvanic probe, no need polarization time, and available at any time. The filling solution and membrane cap is replaceable, leading to the low
maintenance cost. The signal converter board is plug and play, and has the good compatibility. It can be easily integrated to any control or detecting system.
This product is easy to use with high compatibility. With open-source code and detailed tutorial provided, this product is very suitable for your water projects
in protecting detecting the dissolved oxygen concentration for the aquatic organisms.
1. The filling solution is 0.5 mol/L NaOH solution. You need to pour it in the membrane cap before use. Please be
(/wiki/index.php/File:Warning_yellow.png) caution with the operation because the solution is corrosive. Please wear gloves! If the solution accidentally
drops onto the skin, wash your skin with plenty of water immediately.
2. The oxygen permeable membrane in the membrane cap is sensitive and fragile. Be caution when handling with
it. Fingernail and other sharp objects should be avoided.
3. The DO sensor will consume a little oxygen during the measurement. Please gently stir the solution and let
the oxygen to be distributed evenly in the water.
Specification
Dissolved Oxygen Probe
Maintenance Period:
Board Overview
No. Label Description
1 A Analog Signal Output (0~3.0V)
2 + VCC (3.3~5.5V)
3 - GND
(/wiki/index.php/File:Oxygen_board_function.png)
Dissolved Oxgen Sensor
Tutorial
This tutorial will show how to use this dissolved oxygen sensor kit. The dissolved oxygen probe is a precision electrochemical sensor. Please pay attention to
the usage details.
Before using the dissolved oxygen probe, 0.5 mol/L NaOH solution should be added into the membrane cap as
(/wiki/index.php/File:Warning_yellow.png) the filling solution of the probe. As NaOH solution has strong corrosivity, protective gloves should be put on
before handling the solution. If the solution accidentally drops onto the skin, wash your skin with plenty of water
immediately.
The oxygen permeable membrane in the membrane cap is sensitive and vulnerable. Be caution when
handling with it. Fingernail and other sharp objects should be avoided.
During the measuring process, the oxygen probe will consume a little oxygen. You need to gently stir the water
and let the oxygen to be distributed evenly in water. On the other hand, do not stirring violently to prevent the
oxygen in the air from quickly entering into the water.
Requirements
Hardware
Dissolved Oxygen Probe (With Membrane Cap) x 1
0.5mol/L NaOH Solution x 1
DFRduino UNO R3 (https://www.dfrobot.com/product-838.html) (or similar) x 1
Dissolved Oxygen Signal Converter Board x 1
Analog Cable (3Pin) x 1
Software
Arduino IDE (Version requirements: V1.0.x, V1.6.x or V1.8.x), Click to Download Arduino IDE from Arduino® (https://www.arduino.cc/en/Main/Software%7C)
The BNC jumper is protecting the probe by shorting the output signal so as to keep the two poles of the probe at the same voltage level when probe is not
filled with NaOH solution. When the probe is filled with NaOH solution, it outputs a voltage signal, and as a result, the probe should not be shorted. In sum,
before filling the probe with the NaOH solution, the BNC jumper should be taken off, or it may shorten the lifespan of the probe.
(/wiki/index.php/File:BncPullOut2.png)
2. Unscrew the membrane cap from the probe and fill about 2/3 volume of the cap with 0.5 mol/L NaOH solution. Make sure the probe is in vertical position with
respect to the horizontal plane. Carefully screw the cap back to the probe. It would be nice if a little bit solution overflows out of the cap to ensure the probe is fully
filled with NaOH solution.
When screwing the cap back to the probe, the probe should be in vertical position with respect to the horizontal plane to avoid creating bubbles in the
filling solution.
If the cap is fully filled with NaOH solution, there will be too much solution overflowing when screwing the cap back to the probe. If the filling solution is too
little, bubbles may be created inside the cap. In sum, the best way is to fill about 2/3 volume of the cap,a little bit overflow when screwing the cap back to the
probe.
Clean the overflowed solution with tissue.
Screw the NaOH solution bottle after every use to prevent the CO2 in the air from affecting the solution.
(/wiki/index.php/File:AddSolution2.png)
Connection Diagram
When the probe is filled with NaOH solution, it needs calibration for once. Before calibration, please connect the probe as the following diagram. Connect
the probe to BNC connector of the signal converter board. Connect the board to the analog input of Arduino main-board.
(/wiki/index.php/File:DOapplication.png)
Dissolved Oxygen Sensor
Probe Calibration
If this is the first time you use the probe or the probe has been used for some time, the probe needs to be calibrated for accuracy.
Common calibration methods: single point calibration and double points calibration. The single point calibration calibrates the probe with saturated dissolved oxygen.
The double points calibration calibrates the probe with both saturated dissolved oxygen and zero dissolved oxygen. In most cases, the single point calibration is
good enough and convenient. The following tutorial details the process of single point calibration.
1. Upload the sample code to Arduino and open the serial monitor. The program refreshes and prints the dissolved oxygen on the screen every seconds.
2. Dip the probe into the saturated dissolved oxygen water and gently stir the water. Check the dissolved oxygen readings and wait for the readings to be stable.
Usually, it takes over 1 minute for the readings to become stable, because the electrochemical reaction in the probe takes time.
If saturated dissolved oxygen water is not available, the air will be a replacement. Dip the probe into the water and stir it for several times to wet
the permeable membrane of the cap. Expose the probe to the air for over 1 minute.
3. Wait for the dissolved oxygen readings to be stable. Then you can do the calibration. The steps are as followed.
Enter ”SATCAL” for dissolved oxygen calibration. The program will print whether the calibration is successful or not.
(/wiki/index.php/File:400px-SATCAL.png)
(/wiki/index.php/File:400px-ExitCMD.png)
4. After the process stated above, the saturated dissolved oxygen calibration has completed. The probe is now ready for measurement.
Sample Code
/***************************************************
DFRobot Gravity: Analog Dissolved Oxygen Sensor / Meter Kit for Arduino
<https://www.dfrobot.com/wiki/index.php/Gravity:_Analog_Dissolved_Oxygen_Sensor_SKU:SEN0237>
***************************************************
This example reads the concentration of dissolved oxygen in water.
The saturated oxygen calibration is available by UART commends with NL & CR:
calibration ---- enter the calibration mode
satcal ---- calibrate the parameters with saturated oxygen value
exit ---- exit the calibration mode
Created 2017-5-22
By Jason <[email protected]@dfrobot.com>
#include <avr/pgmspace.h>
#include <EEPROM.h>
#define DoSensorPin A1 //dissolved oxygen sensor analog output pin to arduino mainboard
#define VREF 5000 //for arduino uno, the ADC reference is the AVCC, that is 5000mV(TYP)
float doValue; //current dissolved oxygen value, unit; mg/L
float temperature = 25; //default temperature is 25^C, you can use a temperature sensor to read it
#define EEPROM_write(address, p) {int i = 0; byte *pp = (byte*)&(p);for(; i < sizeof(p); i++) EEPROM.write(address+i, pp[i]);}
#define EEPROM_read(address, p) {int i = 0; byte *pp = (byte*)&(p);for(; i < sizeof(p); i++) pp[i]=EEPROM.read(address+i);}
#define ReceivedBufferLength 20
char receivedBuffer[ReceivedBufferLength+1]; // store the serial command
byte receivedBufferIndex = 0;
#define SaturationDoVoltageAddress 12 //the address of the Saturation Oxygen voltage stored in the EEPROM
#define SaturationDoTemperatureAddress 16 //the address of the Saturation Oxygen temperature stored in the EEPROM
float SaturationDoVoltage,SaturationDoTemperature;
float averageVoltage;
const float SaturationValueTab[41] PROGMEM = { //saturation dissolved oxygen concentrations at various temperatures
14.46, 14.22, 13.82, 13.44, 13.09,
12.74, 12.42, 12.11, 11.81, 11.53,
11.26, 11.01, 10.77, 10.53, 10.30,
10.08, 9.86, 9.66, 9.46, 9.27,
9.08, 8.90, 8.73, 8.57, 8.41,
8.25, 8.11, 7.96, 7.82, 7.69,
7.56, 7.43, 7.30, 7.18, 7.07,
6.95, 6.84, 6.73, 6.63, 6.53,
6.41,
};
void setup()
{
Serial.begin(115200);
pinMode(DoSensorPin,INPUT);
readDoCharacteristicValues(); //read Characteristic Values calibrated from the EEPROM
}
void loop()
{
static unsigned long analogSampleTimepoint = millis();
if(millis()-analogSampleTimepoint > 30U)
{
analogSampleTimepoint = millis();
analogBuffer[analogBufferIndex] = analogRead(DoSensorPin); //read the analog value and store into the buffer
analogBufferIndex++;
if(analogBufferIndex == SCOUNT)
analogBufferIndex = 0;
}
static unsigned long tempSampleTimepoint = millis(); if(millis()-tempSampleTimepoint
> 500U) // every 500 milliseconds, read the temperature
{
tempSampleTimepoint = millis();
//temperature = readTemperature(); // add your temperature codes here to read the temperature, unit:^C
}
if(serialDataAvailable() > 0)
{
byte modeIndex = uartParse(); //parse the uart command received
doCalibration(modeIndex); // If the correct calibration command is received, the calibration function should be called.
}
boolean serialDataAvailable(void)
{
char receivedChar;
static unsigned long receivedTimeOut = millis();
while ( Serial.available() > 0 )
{
if (millis() - receivedTimeOut > 500U)
{
receivedBufferIndex = 0;
memset(receivedBuffer,0,(ReceivedBufferLength+1));
}
receivedTimeOut = millis();
receivedChar = Serial.read();
if (receivedChar == '\n' || receivedBufferIndex == ReceivedBufferLength)
{
receivedBufferIndex = 0;
strupr(receivedBuffer);
return true;
}else{
receivedBuffer[receivedBufferIndex] = receivedChar;
receivedBufferIndex++;
}
}
return false;
}
byte uartParse()
{
byte modeIndex = 0;
if(strstr(receivedBuffer, "CALIBRATION") != NULL)
modeIndex = 1;
else if(strstr(receivedBuffer, "EXIT") != NULL)
modeIndex = 3;
else if(strstr(receivedBuffer, "SATCAL") != NULL)
modeIndex = 2;
return modeIndex;
}
case 1:
enterCalibrationFlag = 1;
doCalibrationFinishFlag = 0;
Serial.println();
Serial.println(F(">>>Enter Calibration Mode<<<"));
Serial.println(F(">>>Please put the probe into the saturation oxygen water! <<<"));
Serial.println();
break;
case 2:
if(enterCalibrationFlag)
{
Serial.println();
Serial.println(F(">>>Saturation Calibration Finish!<<<"));
Serial.println();
EEPROM_write(SaturationDoVoltageAddress, averageVoltage);
EEPROM_write(SaturationDoTemperatureAddress, temperature);
SaturationDoVoltage = averageVoltage;
SaturationDoTemperature = temperature;
doCalibrationFinishFlag = 1;
}
break;
case 3:
if(enterCalibrationFlag)
{
Serial.println();
if(doCalibrationFinishFlag)
Serial.print(F(">>>Calibration Successful"));
else
Serial.print(F(">>>Calibration Failed"));
Serial.println(F(",Exit Calibration Mode<<<"));
Serial.println();
doCalibrationFinishFlag = 0;
enterCalibrationFlag = 0;
}
break;
}
}
void readDoCharacteristicValues(void)
{
EEPROM_read(SaturationDoVoltageAddress, SaturationDoVoltage);
EEPROM_read(SaturationDoTemperatureAddress, SaturationDoTemperature);
if(EEPROM.read(SaturationDoVoltageAddress)==0xFF && EEPROM.read(SaturationDoVoltageAddress+1)==0xFF && EEPROM.read(SaturationDoVoltageAdd
{
SaturationDoVoltage = 1127.6; //default voltage:1127.6mv
EEPROM_write(SaturationDoVoltageAddress, SaturationDoVoltage);
}
if(EEPROM.read(SaturationDoTemperatureAddress)==0xFF && EEPROM.read(SaturationDoTemperatureAddress+1)==0xFF && EEPROM.read(SaturationDoTe
{
SaturationDoTemperature = 25.0; //default temperature is 25^C
EEPROM_write(SaturationDoTemperatureAddress, SaturationDoTemperature);
}
}
FAQ
Q1. How to config the saturated dissolved oxygen water by myself ?
A. You can pump air into water for about 20 minutes to saturate the water with oxygen to obtain 100% dissolved oxygen standard liquid.
A. Add sodium sulfite(Na2SO3) into water until it is saturated. This can consume all the oxygen in the water to obtain the zero dissolved oxygen liquid.
A.
1. Short time (over nigh to a week ): dip the probe into purified water or deionized water to prevent the filling solution to be evaporated. Disconnect the
probe from instrument every time when it is not in use.
2. Long time: (over a week): unscrew the cap from the probe and wash the electrodes core (cathode: platinum, anode: lead) and the cap with purified water or
deionized water. Dry all the components with tissue. Screw the cap back to the probe without adding any filling solution to prevent the anode from being
consumed. Put all the components back into the package.
A. You need to purchase the NaOH solution firstly, and add 1~2 drops glycerinum to the NaOH solution every 100mL. Only by adding the NaOH solution into
the probe can it be ready for use.
A.
1. If the readings of zero dissolved oxygen liquid is not zero or close to zero, you can polish the cathode of the probe.
2. If the readings is not within normal range or the readings drifts, please check the membrane on the cap. If there are cracks, holes or contaminations
on the membrane, please change the cap.
For any questions, advice or cool ideas to share, please visit the DFRobot Forum (http://www.dfrobot.com/forum/).
More Documents
Schematic V1.0 (https://github.com/DFRobot/Gravity_Analog_Dissolved_Oxygen_Sensor/raw/master/Schematic%20V1.0.pdf)
Layout with Dimension (https://github.com/DFRobot/Gravity_Analog_Dissolved_Oxygen_Sensor/raw/master/Layout%20with%20Dimension%20V1.0.pdf)
Probe Dimension (https://github.com/DFRobot/Gravity_Analog_Dissolved_Oxygen_Sensor/raw/master/Probe%20Dimension.jpg)
SVG files (https://github.com/DFRobot/Gravity_Analog_Dissolved_Oxygen_Sensor/raw/master/SVG%20files.zip)
TP5551 Datasheet (https://github.com/DFRobot/Gravity_Analog_Dissolved_Oxygen_Sensor/raw/master/TP5551-5552-5554_REV1.1.pdf)
Github Repository (https://github.com/DFRobot/Gravity_Analog_Dissolved_Oxygen_Sensor)
(http://www.dfrobot.com/) Get Gravity: Analog Dissolved Oxygen Sensor (https://www.dfrobot.com/product-1628.html) from DFRobot Store or DFRobot
Distributor. (http://www.dfrobot.com/index.php?route=information/distributorslogo)
(https://www.gnu.org/copyleft/fdl.html) (//www.mediawiki.org/)
PH meter(SKU: SEN0161)
Contents
1 Introduction
2 Specification
3 Precautions
4 pH Electrode Characteristics
5 Usage
5.1 Connecting Diagram
5.2 Method 1. Software Calibration
5.3 Method 2. Hardware Calibration through potentiometer
6 FAQ
Introduction
Need to measure water quality and other parameters but haven't got any low cost pH meter? Find
it difficult to use with Arduino? Here comes an analog pH meter, specially designed for Arduino
controllers and has built-in simple, convenient and practical connection and features. It has an
LED which works as the Power Indicator, a BNC connector and PH2.0 sensor interface. You can
just connect the pH sensor with BNC connector, and plug the PH2.0 interface into any analog input
on Arduino controller to read pH value easily.
Specification
SEN0161 dimension
Precautions
Before and after use of the pH electrode every time, you need to use (pure)water to
clean it. The electrode plug should be kept clean and dry in case of short circuit.
Electrode blub or sand core is defiled which will make PTS decline, slow response. So, it
should be based on the characteristics of the pollutant, adapted to the cleaning solution, the
electrode performance recovery.
Electrode when in use, the ceramic sand core and liquid outlet rubber ring should be removed, in
order to make salt bridge solution to maintain a certain velocity.
Their usages/ specifications are almost the same. The differences locates at
Long-firing Operation: SEN0169 supports, while SEN0161 NOT, i.e. you can
not immerse SEN0161 in water for Continuous Testing.
Life Span: In 25 , pure water, do Continuous Testing with them both, SEN0169 can work
two years, while SEN0161 can only last for 6 months. And just for reference, if put them
in turbid, strongly acid and alkali solution, 25 , the life span would drop to one year
(SEN0169), 1 month(or shorter, SEN0161).
Tempreture, pH, turbidity of the water effect the probe life span a lot.
Waterproof: You can immerse the whole probe SEN0169 into the water, while you can
only immerse the front part of the probe SEN0161, the electrode glass bulb, into water,
the rear part, from the white shell to the cable, MUST NOT be under water.
Strongly Acid and Alkali: SEN0169 are preferred for strongly acid and alkali test. And
if your testing range is usually within pH6~8, then SEN0161 is capable for that.
pH Electrode Characteristics
The output of pH electrode is Millivolts, and the pH value of the relationship is shown
as follows (25 ):
NOTE: It is normal that if your reading is much different with the table since you are not
reading from the electrode directly but from the voltage adapter, it has converted the
original voltage (-5V ~ +5V) to Arduino compatible voltage, i.e. 0 ~ 5V. See the
discussion on Forum.
Usage
Connecting Diagram
NOTE:
Before you insert the pH probe into one solution from another, or after you finish using
the sensor, you must wash the pH electrode with pure water everytime (distilled water is
the best)!
The closer power supply to +5.00V, the more accurate pH readings you could get.
You have to immerse the pH probe into stationary solution instead of the running one
to get relative stable pH readings.
How long should it be under the solution? It depends on the pH value, the closer
to neutral solution (pH = 7.00), the longer it will take. As we tested in water pH =
6.0, the blue one costs 6 minutes, and in standard Acid/ Alkali (4.00/ 10.00)
solutions, it only needs 10 seconds.
The software calibration is easier than the next part - Hardware Calibration
through the Potentiometer. Because it writes the calibration values into Arduino's
EEPROM, so you can calibrate once for all if you won't replace your Arduino. It
uses mathematical method that to draw a line using two points, i.e. using the Acid
standard solution, pH = 4.00 and alkaline pH = 10.00 or 9.18 to draw the linear
relation between the voltage and the pH value.
NOTE:
During the calibration (from step 4 to step 7), power outage should be avoided,
or you will have to start over from step 4.
Software Calibration has nothing to do with the potentiometer on the adapter.
Especially after you finished the calibration, you should never adjust the potentiometer,
or you should start over. Moreover, considering the mechanical vibration might interfere
the potentiometer value, you could seal it by Hot Melt Adhesive.
If you want to try Hardware Calibration, you'd better reset the EEPROM setting by
uploading the Arduino IDE sample sketch "EEPROM Clear" as shown as the right
hand picture.
Steps
1. Wiring the pH probe, pH meter adapter (the little PCB board) and
Arduino UNO as the Diagram section above.
2. Upload the sample code "Software Calibration" below to UNO.
3. Open Serial Monitor, choose command format as “Both NL & CR”and
115200.
4. Send “Calibration” to enter Calibration Mode, and you will see
“Enter Calibration Mode” directly.
5. Acid Calibration
1. Wash your pH probe with pure water (distilled water is best) and dryer it
in case of diluting the standard pH solution. Insert it into standard acid
solution of pH = 4.0. Wait several seconds till the readings get relative
stable.
2. Enter “acid:4.00”(no bland space, lower case), and you will get “Acid
Calibration Successful” notice. Then go on with Alkali Calibration.
6. Alkali Calibration
1. Take out the pH probe out of the acid solution, CLEAN it again as you
did in last step. After this, insert it into the standard alkali solution with
pH = 10 or 9.18. Waiting for the stable readings
2. Enter “alkali:10.00”, and you will see “Alkali Calibration Successful”.
/***************************************************
This example uses software solution to calibration the ph meter,
not the potentiometer. So it is more easy to use and calibrate.
This is for SEN0161 and SEN0169.
Created 2016-8-11
By youyou from DFrobot <[email protected]>
****************************************************/
****************************************************
#include <EEPROM.h>
#define EEPROM_write(address, p) {int i = 0; byte *pp = (byte*)&(p
);for(; i < sizeof(p); i++) EEPROM.write(address+i, pp[i]);}
#define EEPROM_read(address, p) {int i = 0; byte *pp = (byte*)&(p
);for(; i < sizeof(p); i++) pp[i]=EEPROM.read(address+i);}
#define ReceivedBufferLength 20
char receivedBuffer[ReceivedBufferLength+1]; // store the serial
command
byte receivedBufferIndex = 0;
#define SCOUNT 30 // sum of sample point
int analogBufferIndex = 0;
boolean enterCalibrationFlag = 0;
#define SensorPin A0
#define VREF 5000 //for arduino uno, the ADC reference is the pow
er(AVCC), that is 5000mV
void setup()
{
Serial.begin(115200);
readCharacteristicValues(); //read the slope and intercept of
th e ph probe
}
void loop()
{
if(serialDataAvailable() > 0)
{
byte modeIndex = uartParse();
phCalibration(modeIndex); // If the correct calibration c
ommand is received, the calibration function should be called.
EEPROM_read(SlopeValueAddress, slopeValue); // After cal
ibration, the new slope and intercept should be read ,to update
cu rrent value.
EEPROM_read(InterceptValueAddress, interceptValue);
}
static unsigned long sampleTimepoint =
millis(); if(millis()-sampleTimepoint>40U) {
sampleTimepoint = millis();
analogBuffer[analogBufferIndex] = analogRead(SensorPin)/1024.
0*VREF; //read the voltage and store into the buffer,every 40ms
analogBufferIndex++;
if(analogBufferIndex == SCOUNT)
analogBufferIndex = 0;
averageVoltage = getMedianNum(analogBuffer,SCOUNT); // read
the stable value by the median filtering algorithm
}
millis(); if(millis()-printTimepoint>1000U) {
printTimepoint = millis();
boolean serialDataAvailable(void)
{
char receivedChar;
static unsigned long receivedTimeOut =
byte uartParse()
{
byte modeIndex = 0;
if(strstr(receivedBuffer, "CALIBRATION") != NULL)
modeIndex = 1;
else if(strstr(receivedBuffer, "EXIT") != NULL)
modeIndex = 4;
else if(strstr(receivedBuffer, "ACID:") != NULL)
modeIndex = 2;
else if(strstr(receivedBuffer, "ALKALI:") != NULL)
modeIndex = 3;
return modeIndex;
}
case 1:
receivedBufferPtr=strstr(receivedBuffer,
"CALIBRATION"); enterCalibrationFlag = 1;
acidCalibrationFinish = 0;
alkaliCalibrationFinish = 0;
Serial.println(F("Enter Calibration
Mode")); break;
case 2:
if(enterCalibrationFlag)
{
receivedBufferPtr=strstr(receivedBuffer,
"ACID:"); receivedBufferPtr+=strlen("ACID:");
acidValueTemp = strtod(receivedBufferPtr,NULL);
if((acidValueTemp>3)&&(acidValueTemp<5)) //typica l ph
value of acid standand buffer solution should be 4.00
{
acidValue = acidValueTemp;
acidVoltage = averageVoltage/1000.0; // mV ->
V
acidCalibrationFinish = 1; Serial.println(F("Acid
Calibration Successful"));
}else {
acidCalibrationFinish = 0;
Serial.println(F("Acid Value Error"));
}
}
break;
case 3:
if(enterCalibrationFlag)
{
receivedBufferPtr=strstr(receivedBuffer,
"ALKALI:"); receivedBufferPtr+=strlen("ALKALI:");
alkaliValueTemp = strtod(receivedBufferPtr,NULL);
if((alkaliValueTemp>8)&&(alkaliValueTemp<11)) //
typical ph value of alkali standand buffer solution should be 9.18
or 10.01
{
alkaliValue = alkaliValueTemp;
alkaliVoltage = averageVoltage/1000.0;
alkaliCalibrationFinish = 1;
Serial.println(F("Alkali Calibration Successful")
);
}else{
alkaliCalibrationFinish = 0;
Serial.println(F("Alkali Value Error"));
}
}
break;
case 4:
if(enterCalibrationFlag)
{
if(acidCalibrationFinish && alkaliCalibrationFinish)
{
newSlopeValue = (acidValue-
alkaliValue)/(acidVoltage - alkaliVoltage);
EEPROM_write(SlopeValueAddress, newSlopeValue);
newInterceptValue = acidValue - (slopeValue*acidVolt
age);
EEPROM_write(InterceptValueAddress, newInterceptValu
e);
Serial.print(F("Calibration Successful"));
}
void readCharacteristicValues()
{
EEPROM_read(SlopeValueAddress, slopeValue);
EEPROM_read(InterceptValueAddress, interceptValue);
if(EEPROM.read(SlopeValueAddress)==0xFF && EEPROM.read(SlopeVa
lueAddress+1)==0xFF && EEPROM.read(SlopeValueAddress+2)==0xFF && E
EPROM.read(SlopeValueAddress+3)==0xFF)
{
slopeValue = 3.5; // If the EEPROM is new, the recommendat
ory slope is 3.5.
EEPROM_write(SlopeValueAddress, slopeValue);
}
if(EEPROM.read(InterceptValueAddress)==0xFF && EEPROM.read(Int
erceptValueAddress+1)==0xFF && EEPROM.read(InterceptValueAddress+2 )==0xFF &&
EEPROM.read(InterceptValueAddress+3)==0xFF)
{
interceptValue = 0; // If the EEPROM is new, the recommenda
tory intercept is 0.
EEPROM_write(InterceptValueAddress, interceptValue);
}
}
/*
# This sample code is used to test the pH meter V1.0.
# Editor : YouYou
# Ver : 1.0
# Product: analog pH meter
# SKU: SEN0161
*/
#define SensorPin A0 //pH meter Analog output to Arduin
o Analog Input 0
#define Offset 0.00 //deviation compensate
#define LED 13
#define samplingInterval 20
#define printInterval 800
#define ArrayLenth 40 //times of collection
; if(pHArrayIndex==ArrayLenth)pHArrayIndex=0;
voltage = avergearray(pHArray,
ArrayLenth)*5.0/1024; pHValue = 3.5*voltage+Offset;
samplingTime=millis();
}
if(millis() - printTime > printInterval) //Every 800 milliseco
nds, print a numerical, convert the state of the LED indicator
{
Serial.print("Voltage:");
Serial.print(voltage,2);
Serial.print(" pH value: ");
Serial.println(pHValue,2);
digitalWrite(LED,digitalRead(LED)^1);
printTime=millis();
}
}
double avergearray(int* arr, int
number){ int i;
int max,min;
double avg;
long amount=0;
if(number<=0){
Serial.println("Error number for the array to
avraging!/n"); return 0;
}
if(number<5){ //less than 5, calculated directly
statistics for(i=0;i<number;i++){
amount+=arr[i];
}
avg = amount/number;
return avg;
}else{
if(arr[0]<arr[1]){
min = arr[0];max=arr[1];
}
else{
min=arr[1];max=arr[0];
}
for(i=2;i<number;i++){
if(arr[i]<min){
amount+=min; //arr<min
min=arr[i];
}else {
if(arr[i]>max){
amount+=max; //arr>max
max=arr[i];
}else{
amount+=arr[i]; //min<=arr<=max
}
}//if
}//for
avg = (double)amount/(number-2);
}//if
return avg;
}
FAQ
A. 1. Check if the pH sensor circuit board is good? Read on the Forum. or on wiki for the
steps. During the transport, there might be crash causing the probe head cracked,
please check if the probe is good or not.
2. If you don't use Arduino as the controller, then please check your ADC module that
whether it converts the 5V analog input to 1024, if it is 4096(or other byte), please re-
determine the equation in the code.
Q2. Big fluctuations in ph meter readings. When I make measurements in a glass, I have
correct, stable reading. But when I put it inside the aquarium with the pumping system
working, the easurement varies even more than a degree, and it's not stable, if I swicth off the
pump the given value doesn´t oscilate anymore.
A. There should be NO working electrical device in the container. Any tiny leakage of
electricity will cause the probe working error. Especially, many people bought the EC meter
and put it into the same tank for the test, but then the pH meter cannot work well anymore.
Please seperate them into different containers, or turning off the EC meter when using the
pH meter.
Q3. May I know the Maximum range different if we do not calibrate the pH meter.
A. The maximum range differs from probe, you have to calibrate it before use if the
Q4. I would just like to ask if your pH sensor can be connect to any micro controller aside
from arduino. Would it be compatible with a raspberry pi? Thank You!
A. Yes, it can be used on any device as long as it could give 5V power supply and accept 5V
analog signal, but as the Rasp pi is only compatible with 3.3V sensor, so an expansion shield
is suggested to use with (please make sure which kind of Pi you use)
For any questions and more cool ideas to share, please visit DFRobot Forum
Attention:
BoardColur:Black Overview
Connection Interface: XH2.54-2P
This tutorial will show you how to measure the TDS value of the water. Please read this
tutorial carefully, and pay attention to the steps and details.
The probe can not to be used in water above 55 degrees centigrade.
The probe can not be too close to the edge of the container, otherwise it will affect
the reading.
The head and the cable of the probe are waterproof, but the connector and the signal transmitter
board are not waterproof.Please pay attention to use.
Requirements
Hardware
DFRduino UNO R3 (or similar) x 1
Analog TDS Sensor / Meter Module x 1
TDS Probe x1
Jumper Wires x3
tested liquid x1
Software
Arduino IDE (Version requirements: V1.0.x or V1.8.x), Click to Download Arduino IDE from
ConnectionArduio®htps://wwwDiagram.arduino.cc/en/Main/Software%7C
Sample Code
/***************************************************
DFRobot Gravity: Analog TDS Sensor / Meter For Arduino
<https://www.dfrobot.com/wiki/index.php/Gravity:_Analog_TDS_Sensor_/_Mete
r_For_Arduino_SKU:_SEN0244>
Created 2017-8-22
By Jason <[email protected]@dfrobot.com>
#define TdsSensorPin A1
#define VREF 5.0 // analog reference voltage(Volt) of the ADC
#define SCOUNT 30 // sum of sample point
void setup()
{
Serial.begin(115200);
pinMode(TdsSensorPin,INPUT);
}
void loop()
{
static unsigned long analogSampleTimepoint = millis();
printTimepoint = millis();
for(copyIndex=0;copyIndex<SCOUNT;copyIndex++
)
analogBufferTemp[copyIndex]= analogBuffer[copyIndex]; averageVoltage
= getMedianNum(analogBufferTemp,SCOUNT) * (float)VREF
/ 1024.0; // read the analog value more stable by the median filtering
alg orithm, and convert to voltage value
float compensationCoefficient=1.0+0.02*(temperature-25.0); //temp
erature compensation formula: fFinalResult(25^C) = fFinalResult(current)/(
1.0+0.02*(fTP-25.0));
float
compensationVolatge=averageVoltage/compensationCoefficient; / /temperature
compensation
tdsValue=(133.42*compensationVolatge*compensationVolatge*compensati
o nVolatge - 255.86*compensationVolatge*compensationVolatge +
857.39*compens ationVolatge)*0.5; //convert voltage value to tds value
//Serial.print("voltage:");
//Serial.print(averageVoltage,2);
//Serial.print("V ");
Serial.print("TDS Value:");
Serial.print(tdsValue,0);
Serial.println("ppm");
}
}
int getMedianNum(int bArray[], int iFilterLen)
{
int bTab[iFilterLen];
for (byte i = 0; i<iFilterLen; i++)
bTab[i] = bArray[i];
int i, j, bTemp;
for (j = 0; j < iFilterLen - 1; j++)
{
for (i = 0; i < iFilterLen - j - 1; i++)
{
if (bTab[i] > bTab[i + 1])
{
bTemp = bTab[i];
bTab[i] = bTab[i + 1];
bTab[i + 1] = bTemp;
}
}
}
if ((iFilterLen & 1) > 0)
bTemp = bTab[(iFilterLen - 1) / 2];
else
bTemp = (bTab[iFilterLen / 2] + bTab[iFilterLen / 2 - 1]) / 2;
return bTemp;
}
Expected Results
After uploading the sample code,open the serial monitor of the Arduino IDE. Then insert the TDS
probe into the water, and gently stir it. Waiting for the reading to be stable, and you will get the
TDS value of the water.
FAQ
Q1. Does this sensor have a temperature sensor? How to make the temperature compensation?
A. This TDS probe has no temperature sensor, but the temperature compensation
algorithm is reserved in the sample code. The temperature variable in the sample code
will default to 25 °C without a temperature sensor. You can add a waterproof temperature
sensor to read the temperature,then update the temperature variable, to make automatic
temperature compensation.
For any questions, advice or cool ideas to share, please visit the DFRobot Forum.
https://www.dfrobot.com/wiki/index.php/Gravity:_Analog_TDS_Sensor_/_Meter_For_Arduino_SKU:_SEN0244 12‐8‐17
Arduino Nano V3.0 CH340 improved version
Atmega328P USB to TTL with USB cable
Description:
Arduino Nano is an open source code base with ultra-small simple I / O platform, compared with the previous version
of USB Arduino Diecimila. It is ideal for prototyping using crimp development boards, for all contacts displayed on the
two lines at the edges of the board, spacing 2.54mm, distance 15mm rulers. The size of the Arduino Nano accounts
for a large advantage that can be used to develop the required run independently, and has interactive effects of
electronic equipment; can also be used to develop a connected computer, interactive work with Flash, Processing,
Max / Msp, PD, VVVV done in collaboration with other software .
Technical Parameters:
-CH340G Replaces FT232RL (improve download speed and stability of WIN7 / WIN8)
-8 Analog input ports: A0 ~ A7
-14 Digital input / output ports: TX, RX, D2 ~ D13
-6 PWM ports: D3, D5, D6, D9, D10, D11
-1 Pair of TTL level serial transceiver ports RX /
TX -Using Atmel Atmega328P-AU MCU -DC
Current per I/O pin: 40Ma
-Flash Memory: 32KB (ATmega328) (of which 2KB used by bootloader)
-SRAM: 2KB (ATmega328)
-EEPROM: 1KB (ATmega328)
-Clock Speed: 16MHz
-There is bootloader installed in it
-Support USB download and Power
-Support for external 5V ~ 12V DC power supply
-Support power supply by 9V battery
-Support ISP download
-Dimensions: 0.73”x1.7”, 45(L)x18(W)mm
Electronics Katrangi Trading
www.ekt2.com
Labeling:
Application:
Made in China
www.ekt2.com
Arduino Mega 2560 Datasheet
Overview
The Arduino Mega 2560 is a microcontroller board based on the ATmega2560 (datasheet).
It has 54 digital input/output pins (of which 14 can be used as PWM outputs), 16 analog
inputs, 4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a
power jack, an ICSP header, and a reset button. It contains everything needed to support
the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-
to- DC adapter or battery to get started. The Mega is compatible with most shields designed
for the Arduino Duemilanove or Diecimila.
Summary
Microcontroller ATmega2560
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 54 (of which 14 provide PWM output)
Analog Input Pins 16
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 256 KB of which 8 KB used by bootloader
SRAM 8 KB
EEPROM 4 KB
Clock Speed 16 MHz
Power
The Arduino Mega can be powered via the USB connection or with an external power supply.
The power source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter (wall- wart) or
battery. The adapter can be connected by plugging a 2.1mm center- positive plug into
the board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin
headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less than
7V, however, the 5V pin may supply less than five volts and the board may be unstable.
If using more than 12V, the voltage regulator may overheat and damage the board.
The recommended range is 7 to 12 volts.
The Mega2560 differs from all preceding boards in that it does not use the FTDI USB-
to-serial driver chip. Instead, it features the Atmega8U2 programmed as a USB-to-
serial converter.
The power pins are as follows:
● VIN. The input voltage to the Arduino board when it's using an external power source
(as opposed to 5 volts from the USB connection or other regulated power source).
You can supply voltage through this pin, or, if supplying voltage via the power jack,
access it through this pin.
● 5V. The regulated power supply used to power the microcontroller and
other components on the board. This can come either from VIN via an on-
board regulator, or be supplied by USB or another regulated 5V supply.
● 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is
50 mA.
● GND. Ground pins.
Memory
The ATmega2560 has 256 KB of flash memory for storing code (of which 8 KB is used
for the bootloader), 8 KB of SRAM and 4 KB of EEPROM (which can be read and written
with the EEPROM library).
● Serial: 0 (RX) and 1 (TX); Serial 1: 19 (RX) and 18 (TX); Serial 2: 17 (RX)
and 16 (TX); Serial 3: 15 (RX) and 14 (TX). Used to receive (RX) and transmit
(TX) TTL serial data. Pins 0 and 1 are also connected to the corresponding pins of
the ATmega8U2 USB-to-TTL Serial chip.
● External Interrupts: 2 (interrupt 0), 3 (interrupt 1), 18 (interrupt 5),
19 (interrupt 4), 20 (interrupt 3), and 21 (interrupt 2). These pins can be
configured to trigger an interrupt on a low value, a rising or falling edge, or a
change in value. See the attachInterrupt() function for details.
● PWM: 0 to 13. Provide 8-bit PWM output with the analogWrite() function.
● SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS). These pins support SPI
communication using the SPI library. The SPI pins are also broken out on the ICSP
header, which is physically compatible with the Uno, Duemilanove and Diecimila.
● LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.
● I2C: 20 (SDA) and 21 (SCL). Support I2C (TWI) communication using the Wire
library (documentation on the Wiring website). Note that these pins are not in the
same location as the I2C pins on the Duemilanove or Diecimila.
The Mega2560 has 16 analog inputs, each of which provide 10 bits of resolution (i.e. 1024
different values). By default they measure from ground to 5 volts, though is it possible to
change the upper end of their range using the AREF pin and analogReference() function.
● AREF. Reference voltage for the analog inputs. Used with analogReference().
● Reset. Bring this line LOW to reset the microcontroller. Typically used to add
a reset button to shields which block the one on the board.
Communication
The Arduino Mega2560 has a number of facilities for communicating with a computer,
another Arduino, or other microcontrollers. The ATmega2560 provides four hardware
UARTs for TTL (5V) serial communication. An ATmega8U2 on the board channels one of
these over USB and provides a virtual com port to software on the computer (Windows
machines will need a .inf file, but OSX and Linux machines will recognize the board as a
COM port automatically. The Arduino software includes a serial monitor which allows simple
textual data to be sent to and from the board. The RX and TX LEDs on the board will flash
when data is being transmitted via the ATmega8U2 chip and USB connection to the
computer (but not for serial communication on pins 0 and 1).
A SoftwareSerial library allows for serial communication on any of the Mega2560's
digital pins.
The ATmega2560 also supports I2C (TWI) and SPI communication. The Arduino software
includes a Wire library to simplify use of the I2C bus; see the documentation on the
Wiring website for details. For SPI communication, use the SPI library.
Programming
The Arduino Mega can be programmed with the Arduino software (download).
For details, see the reference and tutorials.
The ATmega2560 on the Arduino Mega comes preburned with a bootloader that allows you
to upload new code to it without the use of an external hardware programmer. It
communicates using the original STK500 protocol (reference, C header files).
You can also bypass the bootloader and program the microcontroller through the ICSP
(In-Circuit Serial Programming) header; see these instructions for details.
The Mega2560 is designed to be compatible with most shields designed for the Uno, Diecimila or
Duemilanove. Digital pins 0 to 13 (and the adjacent AREF and GND pins), analog inputs 0 to 5,
the power header, and ICSP header are all in equivalent locations. Further the main UART (serial
port) is located on the same pins (0 and 1), as are external interrupts 0 and 1 (pins 2 and 3
respectively). SPI is available through the ICSP header on both the Mega2560 and
Duemilanove / Diecimila. Please note that I 2C is not located on the same pins on the Mega (20
and 21) as the Duemilanove / Diecimila (analog inputs 4 and 5).
CP2102
Single-Chip USB to UART Data Transfer Virtual COM Port Device Drivers
- Integrated USB transceiver; no - Works with Existing COM Port PC Applications
external resistors required - Royalty-Free Distribution License
- Integrated clock; no external crystal required - Windows Vista/XP/Server 2003/2000
- Integrated 1024-Byte EEPROM for vendor ID, - Mac OS-X/OS-9
product ID, serial number, power descriptor, - Linux
release number, and product description strings
- On-chip power-on reset circuit USBXpress™ Direct Driver Support
- On-chip voltage regulator: 3.3 V output - Royalty-Free Distribution License
- 100% pin and software compatible with CP2101 - Windows Vista/XP/Server 2003/2000
- Windows CE
USB Function Controller
- USB Specification 2.0 compliant; full-speed (12 Mbps) Example Applications
- USB suspend states supported via SUSPEND pins - Upgrade of RS-232 legacy devices to USB
- Cellular phone USB interface cable
Asynchronous Serial Data BUS (UART) - PDA USB interface cable
- All handshaking and modem interface signals - USB to RS-232 serial adapter
- Data formats supported:
- Data bits: 5, 6, 7, and 8 Supply Voltage
- Stop bits: 1, 1.5, and 2 - Self-powered: 3.0 to 3.6 V
- Parity: odd, even, mark, space, no parity - USB bus powered: 4.0 to 5.25 V
- Baud rates: 300 bps to 1 Mbits
- 576 Byte receive buffer; 640 byte transmit buffer Package
- Hardware or X-On/X-Off handshaking supported - Pb-free 28-pin QFN (5x5 mm)
- Event character support
- Line break transmission Ordering Part Number
- CP2102-GM
Temperature Range: –40 to +85 °C
VDD
CP2102
7 Voltage
REGIN IN RST 9 (to external circuitry
Regulator
OUT 12
SUSPEND for USB suspend
6 VDD 3.3 V SUSPEND 11 states)
3 GND 2
RI
8 48 MHz DCD 1 External RS- 232
VBUS Oscillator
USB DTR 28 transceiver or
CONNECTOR
27 UART circuitry
1 DSR
VBUS 26
2 5 USB USB Function UART
D- D- TXD
3 4 D+ Transceiver Controller RXD 25
D+
GND 4
1024B 640B 576B RTS 24
D1 D2 D3
TX RX
6
5
23
EEPROM Buffer Buffer CTS
2 Rev. 1.4
CP2102
TABLE OF CONTENTS
Section Page
1. System Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
2. Electrical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
3. Pinout and Package Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7
4. USB Function Controller and Transceiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
5. Asynchronous Serial Data Bus (UART) Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12
6. Internal EEPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12
7. CP2102 Device Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13
7.1. Virtual COM Port Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13 7.2.
USBXpress Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13 7.3.
Driver Customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 7.4.
Driver Certification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13 8.
Voltage Regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14 9.
Relevant Application Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16
Document Change List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
Contact Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18
Rev. 1.4 3
CP2102
1. System Overview
The CP2102 is a highly-integrated USB-to-UART Bridge Controller providing a simple solution for updating RS-232
designs to USB using a minimum of components and PCB space. The CP2102 includes a USB 2.0 full-speed function
controller, USB transceiver, oscillator, EEPROM, and asynchronous serial data bus (UART) with full modem control
signals in a compact 5 x 5 mm QFN-28 package. No other external USB components are required.
The on-chip EEPROM may be used to customize the USB Vendor ID, Product ID, Product Description String,
Power Descriptor, Device Release Number, and Device Serial Number as desired for OEM applications. The
EEPROM is programmed on-board via the USB, allowing the programming step to be easily integrated into the
product manufacturing and testing process.
Royalty -free Virtual COM Port (VCP) device drivers provided by Silicon Laboratories allow a CP2102-based
product to appear as a COM port to PC applications. The CP2102 UART interface implements all RS-232 signals,
including control and handshaking signals, so existing system firmware does not need to be modified. In many
existing RS-232 designs, all that is required to update the design from RS-232 to USB is to replace the RS-232
level-translator with the CP2102. Direct access driver support is available through the Silicon Laboratories
USBXpress driver set.
An evaluation kit for the CP2102 (Part Number: CP2102EK) is available. It includes a CP2102-based USB-to-
UART/RS-232 evaluation board, a complete set of VCP device drivers, USB and RS-232 cables, and full
documentation. Contact a Silicon Labs sales representatives or go to www.silabs.com to order the CP2102
Evaluation Kit.
4 Rev. 1.4
CP2102
2. Electrical Specifications
Rev. 1.4 5
CP2102
6 Rev. 1.4
CP2102
Rev. 1.4 7
CP2102
2 N
SR
XD
28 DTR
25RXD
RTSCTS
C
27
26
24
23
2
DCD 1
21 NC
RI 2
20 NC
GND 3
CP2102 19 NC
D+ 4
18 NC
D- 5 Top View
17 NC
VDD 6
16 NC
REGIN 7 GND
15 NC
8
10
12
13
1
11
4
NC
NC
VBUS
SUSPEND
RST
SUSPEND
NC
8 Rev. 1.4
CP2102
Rev. 1.4 9
CP2102
10 Rev. 1.4
CP2102
VDD Option 1
CP2102 4.7 k
R1
7 REGIN
C1 9
RST
1F (to external circuitry
12
SUSPEND for USB suspend
6 VDD SUSPEND 11 states)
C4 C2 R2
4.7 F 0.1 F 3 10 k
GND 2 Option 4
RI
Option 2
8 1
VBUS DCD External RS- 232
USB DTR 28 transceiver or
CONNECTOR
27 UART circuitry
DSR
VBUS 1 5 D- TXD 26
2
D-
4 D+ RXD 25
D+ 3
GND 4 RTS 24
D1 D2 D3
56 Option 3 CTS 23
Rev. 1.4 11
CP2102
5. Asynchronous Serial Data Bus (UART) Interface
The CP2102 UART interface consists of the TX (transmit) and RX (receive) data signals as well as the RTS, CTS,
DSR, DTR, DCD, and RI control signals. The UART supports RTS/CTS, DSR/DTR, and X-On/X-Off handshaking.
The UART is programmable to support a variety of data formats and baud rates. If the Virtual COM Port drivers
are used, the data format and baud rate are set during COM port configuration on the PC. If the USBXpress
drivers are used, the CP2102 is configured through the USBXpress API. The data formats and baud rates
available are listed in Table 8.
Table 8. Data Formats and Baud Rates
Baud Rates2 300, 600, 1200, 1800, 2400, 4000, 4800, 7200, 9600, 14400, 16000, 19200, 28800,
38400, 51200, 56000, 57600, 64000, 76800, 115200, 128000, 153600, 230400, 250000,
3
256000, 460800, 500000, 576000, 921600
Notes:
1. 5-bit only.
2. Additional baud rates are supported. See “AN205”.
3. 7 or 8 data bits only.
6. Internal EEPROM
The CP2102 includes an internal EEPROM that may be used to customize the USB Vendor ID (VID), Product ID
(PID), Product Description String, Power Descriptor, Device Release Number and Device Serial Number as
desired for OEM applications. If the EEPROM is not programmed with OEM data, the default configuration data
shown in Table 9 is used.
While customization of the USB configuration data is optional, it is recommended to customize the VID/PID
combination. A unique VID/PID combination will prevent the driver from conflicting with any other USB driver. A
vendor ID can be obtained from http://www.usb.org/ or Silicon Laboratories can provide a free PID for the OEM
product that can be used with the Silicon Laboratories VID. It is also recommended to customize the serial
number if the OEM application is one in which it is possible for multiple CP2102-based devices to be connected to
the same PC.
The internal EEPROM is programmed via the USB. This allows the OEM's USB configuration data and serial
number to be written to the CP2102 on -board during the manufacturing and testing process. A stand-alone utility
for programming the internal EEPROM is available from Silicon Laboratories. A library of routines provided in the
®
form of a Windows DLL is also available. This library can be used to integrate the EEPROM programming step
into custom software used by the OEM to streamline testing and serial number management during
manufacturing. The EEPROM has a typical endurance of 100,000 write cycles with a data retention of 100 years.
USB descriptors can be locked to prevent future modification.
12 Rev. 1.4
CP2102
Vendor ID 10C4h
Product ID EA60h
Power Descriptor (Attributes) 80h
Power Descriptor 32h
(Max. Power)
Release Number 0100h
Serial Number 0001 (63 characters maximum)
Product Description String “CP2102 USB to UART Bridge Controller” (126 characters maximum)
Rev. 1.4 13
CP2102
8. Voltage Regulator
The CP2102 includes an on- chip 5 to 3 V voltage regulator. This allows the CP2102 to be configured as either a
USB bus-powered device or a USB self-powered device. These configurations are shown in Figure 6 and Figure
7. When enabled, the 3 V voltage regulator output appears on the VDD pin and can be used to power external 3
V devices. See Table 10 for the voltage regulator electrical characteristics.
Alternatively, if 3 V power is supplied to the VDD pin, the CP2102 can function as a USB self-powered device with
the voltage regulator disabled. For this configuration, it is recommended that the REGIN input be tied to the 3 V
net to disable the voltage regulator. This configuration is shown in Figure 8.
The USB max power and power attributes descriptor must match the device power usage and configuration. See
application note “AN144: CP210x Customization Guide” for information on how to customize USB descriptors for
the CP2102.
Note: It is recommended that additional decoupling capacitance (e.g., 0.1 µF in parallel with 1.0 µF) be provided on the
REGIN input.
CP2102
VBUS
3 V Out
To 3 V VDD Device
14 Rev. 1.4
CP2102
CP2102
From VBUS VBUS
VBUS Sense
Power Net
3 V Out
To 3V VDD Device
CP2102
From VBUS VBUS
VBUS Sense
3 V Out
Rev. 1.4 15
CP2102
9. Relevant Application Notes
The following Application Notes are applicable to the CP2102. The latest versions of these application notes and
their accompanying software are available at:
http://www.silabs.com/products/microcontroller/applications.asp.
AN144: CP210x Device Customization Guide. This application note describes how to use the AN144 software
to configure the USB parameters on the CP2102 devices.
AN169: USBXpress Programmer's Guide. This application note describes the USBXpress API interface and
includes example code.
AN197: Serial Communications Guide for the CP210x. This application note describes how to use the
standard Windows COM port function to communicate with the CP2102 and includes example code.
AN205: CP210x Baud Rate Support. This application note describes how to use the AN205 software to
configure the Baud Rate aliasing feature on the CP2102 devices.
AN220: USB Driver Customization. This application note describes how to use the AN220 software to
customize the VCP or USBXpress drivers with OEM information.
16 Rev. 1.4
CP2102
Rev. 1.4 17
CP2102
CONTACT INFORMATION
Silicon Laboratories Inc.
400 West Cesar Chavez
Austin, TX 78701
Tel: 1+(512) 416-8500
Fax: 1+(512) 416-9669
Toll Free: 1+(877) 444-3032
Please visit the Silicon Labs Technical Support web page:
https://www.silabs.com/support/pages/contacttechnicalsupport.aspx
and register to submit a technical support request.
The information in this document is believed to be accurate in all respects at the time of publication but is subject to change without notice. Silicon
Laboratories assumes no responsibility for errors and omissions, and disclaims responsibility for any consequences resulting from the use of
information included herein. Additionally, Silicon Laboratories assumes no responsibility for the functioning of undescribed fea-tures or parameters.
Silicon Laboratories reserves the right to make changes without further notice. Silicon Laboratories makes no warranty, representation or
guarantee regarding the suitability of its products for any particular purpose, nor does Silicon Laboratories assume any liability arising out of the
application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental
damages. Silicon Laboratories products are not designed, intended, or authorized for use in applications intend-ed to support or sustain life, or for
any other application in which the failure of the Silicon Laboratories product could create a situation where personal injury or death may occur.
Should Buyer purchase or use Silicon Laboratories products for any such unintended or unauthorized application, Buyer shall indemnify and hold
Silicon Laboratories harmless against all claims and damages.
Silicon Laboratories, Silicon Labs, and USBXpress are trademarks of Silicon Laboratories Inc.
Other products or brandnames mentioned herein are trademarks or registered trademarks of their respective holders.
18 Rev. 1.4
ESP-01 WiFi Module
Version1.0
Information in this document, including URL references, is subject to change without notice.
THIS DOCUMENT IS PROVIDED AS IS WITH NO W ARRANTIES WHATSOEVER, INCLUDING ANYWARRANTY OF MERCHANTABILITY,
NON‐INFRINGEMENT, FITNESS FOR ANY PARTICULAR PURPOSE, OR ANY WARRANTY OTHERWISE ARISING OUT OF ANNY
PROPOSAL, SPECIFICATIONOR SAMPLE. All liability, including liability for infringement of any proprietary rights, relating to use of
information in this document is disclaimed. No licenses express or implied, by estoppel or otherwise, to any intellectual property
rights are granted herein. The WiFi Alliance Member Logo is a trademark of the WiFi Alliance.
All trade names, trademarks and registered trademarks mentioned in this document are property of their respeective owners,
and are hereby acknowledged.
Copyright © 2015 AI‐Thinker team. All rights reserved.
Notice
Product version upgrades or other reasons, posssible changes in the contents of this manual. AI‐Thinker reservess in the absence of any notice or
indication of the circumstances the right to modify the content of this manual. This manual is used only as a guide, Ai‐thinker make every effort to
provide accurate informatioon in this manual, but Ai‐thinker does not ensure that manual content without error, in this manual all statements,
information and advice nor does it constitute any express or implied warranty.
Ta ble of Contents
1. Preambles ............................................................................ ...................... 3
1.1. Features ..................................................................... ...................... 4
1.2. Parameters ................................................................ ...................... 6
2. Pin Descriptions ................................................................... ...................... 7
3. Packaging and Dimensi on .................................................... .................... 10
4. Functional Descriptions ....................................................... .................... 12
4.1. MCU ........................................................................... .................... 12
4.2. Memory Organization ................................................................... 12
4.2.1. Internal SRAM and ROM ....................................... .................... 12
4.2.2. External SPI Flash .................................................. .................... 12
4.3. Crystal ........................................................................ .................... 13
4.4. Interfaces ....................................................................................... 13
4.5. Absolute Maxim um Ratings .......................................................... 15
4.6. Recommended O perating Conditions ........................................... 15
4.7. Digital Terminal Characteristics ..................................................... 15
5. RF Performance ................................................................... .................... 16
6. Power Consumption ............................................................ .................... 17
7. Reflow Profile ...................................................................... .................... 18
8. Schematics ........................................................................... .................... 19
1. Preambles
ESP‐01 WiFi module is developed by Ai‐thinker Team. core processor ESP8266 in smaller sizes of the module
encapsulates Tensilica L106 integrates inddustry‐leading ultra low power 32‐bit MCU micro, with the 16‐bit short mode,
Clock speed support 80 MHz, 160 MHz, supports the RTOS, integrated Wi‐Fi MAC/BB/RF/PA/LLNA, on‐board antenna.
The module supports standard IEEE802.11 b/g/n agreement, complete TCP/IP protocol stack. Users can use
the add modules to an existing device networrking, or building a separate network controller.
ESP8266 is high integration wireless SOCs, designed for space and power constrained mobile platform
designers. It provides unsurpassed ability to embed Wi‐Fi capabilities within other systems, or to function as a
standalone application, with the lowest cost, and minnimal space requirement.
ESP8266EX offers a complete and self‐contained Wi‐Fi networking solution; it can be used to host the
application or to offload Wi‐Fi networking functions from another application processor.
When ESP8266EX hosts the application, it boots up directly from an external flash. In has integrated
cache to improve the performance of the system in such applications.
Alternately, serving as a Wi‐Fi adapter, wireless internet access can be added to any micro controllerbased
design with simple connectivity (SPI/SDIO or I2C/UART interface).
3
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
ESP8266EX is among the most integrrated WiFi chip in the industry; it integrates the antenna switches, RF
balun, power amplifier, low noise receive ampliffier, filters, power management modules, it requires minimal
external circuitry, and the entire solution, including front‐ennd module, is designed to occupy minimal PCB area.
ESP8266EX also integrates an enhanced version of Tensilica’s L106 Diamond series 32‐bit processor, with on‐
chip SRAM, besides the Wi‐Fi functionalities. ESP8266EX is often integrated with external sensors annd other
application specific devices through its GPIOs; codes for such applications are provided in examples in the SDK.
Espressif Systems’ Smart Connectivitty Platform (ESCP) demonstrates sophisticated system-level features
include fast sleep/wake context switching for energy‐efficient VoIP, adaptive radio biasing. for low‐power
operation, advance signal processing, and spur cancellation and radio co‐existence features for common cellular,
Bluetooth, DDR, LVDS, LCD interference mitigation.
1.1. Features
• 802.11 b/g/n
• Support Smart Link Function for both Android and iOS devices
• Support Smart Link Function for both Android and iOS devices
• SDIO 2.0, (H) SPI, UART, I2C, I2S, IRDA, PWM, GPIO
4
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
• STBC, 1x1 MIMO, 2x1 MIMO
• Deep sleep power <10uA, Power down leakage current < 5uA
5
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
1.2. Parameters
Table 1 below describes the major parameters.
Table 1 Parameters
6
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
2. Pin Descriptions
There are altogether 8 pin counts, the deffinitions of which are described in Table 2 below。
7
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
Table 2 Pin Descriptions
6 RST
8
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
Table 3 Pin Mode
9
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
3. Packaging and Dimeension
The external size of the module is 14.3m m*24.8mm*3mm, as is illustrated in Figure 3 below. The type of flash
integrated in this module is an SPI flash, the capacity of which is 1 MB, and the package size of which is SOP‐
210mil. The antenna applied on this module is a 3DBi PCB‐on‐board antenna.
10
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
Figure 4 Top View of ESP-01 WiFi M odule
11
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
4. Functional Descriptioons
4.1. MCU
ESP8266EX is embedded with Tensilica L106 32‐bit micro controller (MCU), which features extraa low power
consumption and 16‐bit RSIC. The CPU clock speed is 80MHz. It can also reach a maximum value of 160MHz.
ESP8266EX is often integrated with externnal sensors and other specific devices through its GPIOs; codes for
such applications are provided in examples in the SDK.
12
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
4.3. Crystal
Currently, the frequency of crystal osscillators supported include 40MHz, 26MHz and 24MHz. The accuracy of
crystal oscillators applied should be ±10PPM, and the operating temperature range should be between ‐20°C and 85°C.
When using the downloading tools, please remember to select the right crystal oscillator type. In circuit design,
capacitors C1 and C2, which are connecteed to the earth, are added to the input and output termminals of the crystal
oscillator respectively. The values of the two capacitors can be flexible, ranging from 6pF to 22pF, however, the specific
capacitive values of C1 and C2 depend on further testing and adjustment on the overall performmance of the whole
circuit. Normally, the capacitive values of C1 and C2 are within 10pF if the crystal oscillator frequency is 26MHz, while
the values of C1 and C2 are 10pF<C1, C2<<22pF if the crystal oscillator frequency is 40MHz.
4.4. Interfaces
Table 6 Descriptions of Interfaces
13
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com 14
4.5. Absolute Maximum Ratings
Table 7 Absolute Maximum Ratings
15
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
5. RF Performance
Table 10 RF Performance
16
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
6. Power Consumption
❷ During Light‐Sleep, the CPU may be suspended in applications like Wi‐Fi switch. Without data transmission, the
Wi‐Fi Modem circuit can be turned off annd CPU suspended to save power according to the 8022.11 standard (U‐
APSD). E.g. in DTIM3, to maintain a sleep 300ms‐wake 3ms cycle to receive AP’s Beacon packages, the current is
about 0.9mA. ❸ Deep‐Sleep does not require Wi‐Fi coonnection to be maintained. For application with long time
lags between data transmission, e.g. a temperature sensor that checks the temperature every 100s ,sleep 300s and
waking up to connect to the AP (taking about 0.3~1s), the overaall average current is less than 1mA.
17
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
7. Reflow Profile
Table 12 Instructions
18
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
8. Schematics
19
Shenzhen Anxinke Technology CO;LTD http://www.ai-thinker.com
Presensitized Copper Clad Boards
600 Series
Easy Cutting!! We also offer a large thin (12" x 18" x 1/32 inch) Cat
#675 paper phenolic presensitized board, perfect for cutting into smaller
boards with no special equipment - perfect for the classroom .
Available Sizes
A 1/16", 1/32", 1/64" laminate with 1 once copper. Available in 1/16” (62 mil) and 1/32” (30 mil) lami-
This flame retardant laminate is made of continuous nate with 1 ounce copper. Provides high resolution
woven glass cloth impregnated with epoxy resin. and excellent fine line control. Ideal for prototypes,
Developed specifically for the circuit processing small production runs, student training.
industries' requirements. Provides ultraviolet blocking
and fluorescence when using automated optical
inspection (AOI).
Format Cat. No. Approximate Size
Single sided 1/16" (1.60mm) 603 3"x 5" (75mm x 125mm)
Format Cat. No. Approximate Size
Single sided 1/16" (1.60mm) 503 3"x 5" (76mm x 127mm) 606 4"x 6" (100mm x 150mm)
506 4"x 6" (101mm x 152mm) 609 6"x 6" (150mm x 150mm)
509 6"x 6" 152mm x 152mm) 612 6"x 9" (150mm x 230mm)
512 6"x 9" (152mm x 228mm) 630 8"x 12" (200mm x 300mm)
515 8"x 10" (203mm x 254mm) Double sided 1/16" (1.60mm) 650 6"x 6" (150mm x 150mm)
Proto
typin
521 12" x 12" (304mm x 304mm) 660 6" x 9" (150mm x 230mm)
g
575 24" x 36" (609mm x 914mm)
Single sided 1/32" (0.80mm) 687 4"x 6" (100mm x 150mm)
580 36" x 48" (914mm x 1219mm)
689 6" x 9" (150mm x 230mm)
Double sided 1/16" (1.60mm) 550 6"x 6" 152mm x 152mm)
Double sided 1/32" (0.80mm) 690 6"x 9" (150mm x 230mm)
555 12" x 12" (304mm x 304mm)
Double sided 1/64" (0.40mm) 698 6"x 9" (152mm x 228mm)
576 24" x 36" (609mm x 914mm)
585 36" x 48" (914mm x 1219mm)
Paper Phenolic
Single sided 1/32" (0.80mm) 586
588
4"x 6" (101mm x 152mm)
GSM/GPRS/EDGE 850/900/1800/1900MHz
network conditions.
Working Temperature Range : -10 to +45°C
Operating Systems: Microsoft Windows 7, Vista & XP. 32 and 64 bit.
*HSDPA / HSUPA: 21.6Mbps downlink & 5.8 Mbps uplink rated device. Actual customer peak download/upload
speeds are less. Typical customer download speeds are 550Kbps – 3Mbps. Typical customer upload speeds are
300Kbps to 3Mbps in all capitals, associated metropolitan areas and selected regional areas and 300kbps - 1Mbps in
other coverage areas. Actual customer download/upload speeds will vary due to factors such as distance from the
cell, local conditions, user numbers, hardware, software, download source, and other factors.