Re: [DIYbio] Conductivity measurements with Bipolar Pulse

On 11/21/2015 10:35 PM, Nathan McCorkle wrote:
> Hi John,
>>
>>I'm doing by this way:
>>
>>const float V_arduino = 5.00;
>>
>>byte pin_electrode_1 = 7;
>>byte pin_electrode_2 = 8;
>>
>>int reading_pin = A0;
>>int reading;
>>
>>float Vm;
>>float Rc = 10000; //Constant resistor
>>float Rx; //Resistance of solution
>>
>>void setup()
>>{
>> Serial.begin(115200);
>> pinMode(pin_electrode_1, OUTPUT);
>> pinMode(pin_electrode_2, OUTPUT);
>>}
>>
>>void loop()
>>{
>>
>>
>> //Pin 7 = 0V e Pin 8 = 5V
>> digitalWrite(pin_electrode_1, LOW);
>> digitalWrite(pin_electrode_2, HIGH);
>>
>> delayMicroseconds(2000);
>>
>> //Pin 7 = 5V e Pin 8 = 0V
>> digitalWrite(pin_electrode_1, HIGH);
>> digitalWrite(pin_electrode_2, LOW);
>>
>> delayMicroseconds(1900);
>> reading = analogRead(reading_pin);
>>
>> digitalWrite(pin_electrode_1, LOW);
>> digitalWrite(pin_electrode_2, LOW);
>>
>> Vm = reading * 0.0048;
>> Rx = Rc * (V_arduino - Vm) / Vm;
>>
>> Serial.print(Vm);
>> Serial.print(" ");
>> Serial.println(Rx);
>>
>> delay(500);
>>
>>}
>>
>>Any tip?

I'm not experienced with arduino, but:

"void setup()
>>{
>> Serial.begin(115200);
>> pinMode(pin_electrode_1, OUTPUT);
>> pinMode(pin_electrode_2, OUTPUT);
>>}"

Seems like you set the drive direction once and do not change it.

If you are simply using a digital out and digital levels lo and high
as drivers, it is likely not accurate enough. read the datasheet about
levels tolerance and you will probably find it is coarse -- that's the nature of digital
wire outs and ins, they tolerate inexact levels...

Your external R divider circuit needs to be driven by a comparator from a voltage reference
that is part of the analog circuitry of your microcontroller, or as external parts.

If those pins *ARE* analog, they may need some strength amplifying to do it right.
have you instrumented any of this and confirmed that the voltage level goes to within some accuracy range of intended?
The currents are small, so instrumenting current may not work well, but if you check the volts while running long pulses,
and also see that a pulse edge is good in xxx microseconds, then you can infer that the fast desired pulses are good...



--
-- You received this message because you are subscribed to the Google Groups DIYbio group. To post to this group, send email to diybio@googlegroups.com. To unsubscribe from this group, send email to diybio+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/diybio?hl=en
Learn more at www.diybio.org
---
You received this message because you are subscribed to the Google Groups "DIYbio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diybio+unsubscribe@googlegroups.com.
To post to this group, send email to diybio@googlegroups.com.
Visit this group at http://groups.google.com/group/diybio.
To view this discussion on the web visit https://groups.google.com/d/msgid/diybio/565F15F7.3000504%40industromatic.com.
For more options, visit https://groups.google.com/d/optout.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comments:

Post a Comment