Hi, Please help me out since unable to get the solution.
I am working on electrochemical sensors, where I need to do following tasks using Arduino UNO
To convert the milliVolts's data from the two electrodes (i.e., their difference) which is in the range of 10-200 mV. I want to amplify this data to display it on LCD to a range of 0-5 Volts.
Based on the Voltage displayed, it should tell the concentration of solution in which are electrode sensors are dipped say 10/100/1000 ppm.
I was using this type of code and made a differential circuit to take the electrode difference and amplify it and sending the output of LM358 to A0 pin.
#include <LiquidCrystal.h>
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
const int VOL_PIN = A0;
int Value;
float Volt;
float vold;
void setup()
{
lcd.begin(16,2);
delay(500);
Serial.begin(9600);
}
void loop()
{
Value = analogRead(VOL_PIN);
Volt = ((Value * 4.9/1023.0));
lcd.setCursor(0,0);
lcd.print("Value =");
lcd.setCursor(8,0);
lcd.print(Value);
Serial.print("Value: ");
Serial.println(Value);
lcd.setCursor(0,1);
lcd.print("Volt =");
lcd.setCursor(7,1);
lcd.print(Volt);
Serial.print("Volt: ");
Serial.println(Volt);
delay(500);
}
Some Arduino boards can set analog inputs as differential inputs with a gain. That is not often used, and there is no common code for it.
A classic solution is with a OpAmp, that is the theoretical solution that we learned at school.
But I think that the most straightforward solution is an external ADC.
Raw signal from electrodes are in MilliVolts range (10-200 mV). I want this signal to be amplified to a range of 0-5 Volts.
Further display both the data onto a LCD i.e., both mV and Amplified Volt data.
When you amplify the signals in the range of 0...5V, then you use the Arduino with the 5V as voltage reference. That is not accurate.
You need a good voltage reference to be able to measure a voltage. That means you don't have to amplify the signals for the 0...5V range.
According to the datasheet of the ADS1115, one of the voltage references is 256mV. You can use it in normal mode or differential mode. It would be a good solution for your project.
@dharmesh93 Please follow the advice given in the link below when posting code . Use code tags when posting code here to make it easier to read and copy for examination
You want to read the analog signals from the sensor and convert them to a voltage between 0 and 5V, correct? You'll want to use some thing to measure the incoming voltages. I recommend using the analog input to read the sensor voltages. Then you can use the map() function to relate the milli volt reading to a bigger volt reading.
@dharmesh93 1. Amplify your electrode volatge to about 4.5V using the following difference amplifiier (Fig-1) and then feed to A0-poin of UNO.
Figure-1:
2. It is recommended that you use +/-5V supply to minimize CMRR. If -5V is not available, then you can try with single +5V supply and observe the result and then apply correction for the offset. There is a possibility that the circuit may oscillate due to high gain. In that case you can use INA101 type true Instrumentation Amplifier.
You can't use a 741 from +/-5V rails with a 0..5V logic chip, it won't have the voltage swing to get above about 2V, and it will fry the microcontroller if the output dips below 0V.
A rail-to-rail opamp would be needed - indeed an instrumentation amp is probably a wise choice - the source impedance of the electrodes is essential information though, nothing can be finalized without this.
Its got +/-5V supplies - so its output can swing down to negative voltages - its best to provide hardware protection against this rather than hoping it won't happen - what about power up and power down transients? What about noise on the sensor wiring? If the output of the opamp goes below -0.5V it could be an expensive mistake.
At the least you can add a 10k resistor in series with the output - analog inputs are designed to work from 10k or less source impedances.