Author Topic: MCU connection to an analog circuit  (Read 4456 times)

0 Members and 1 Guest are viewing this topic.

Offline sagi4422Topic starter

  • Newbie
  • Posts: 6
MCU connection to an analog circuit
« on: January 22, 2014, 08:05:14 pm »
Hi there,
I am building a circuit to measure a sensor I fabricated. The circuit is based on a simple op-amp non-inverting circuit.
The sensor acts like a dynamic resistor, it changes its resistance according to the environment. The problem with the sensor is:
1. That the baseline resistance is very high - tens of MOhm
2. The fabrication method is not stable therefore I have variance between the baseline in each sensor I fabricate
3. The change I am looking to detect are 1-90% change in resistance from the baseline.
Although that, I connected the circuit to an arduino board and the results are reasonable.

I have some questions to advance the circuit:
1. The Vout calculation is Vout=2.5V(1+R2/Rsensor). In case I put a passive resistor in R2, when I change my sensors, I will see different response. I would like to have the ability to control R2 (potentiometer maybe) to receive better sensitivity in such case.
2. I would like to connect it to a MCU (and later to wireless chip). I am not familiar with coding MCUs and found that the simple solution is Picaxe, is it?
The MCU should have the ability to be connected as simple as available to wireless and/or PC.
3. Low power consumption powered by thin batteries.

I know its a lot but only partial help will be helpfull.

Regards.
Sagi
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: MCU connection to an analog circuit
« Reply #1 on: January 22, 2014, 11:20:38 pm »
I would drive it with some sort of a constant current source, given the range. Pick a PIC that has ctmu - which is essentially a programmable current source. Otherwise, build one.

If the signal is fast changing, I would also put a follower on it to lower the impedance. Otherwise, use a small-ish capacitor.

Quote
2. The fabrication method is not stable therefore I have variance between the baseline in each sensor I fabricate

No easy way out, other than swapping out the sensor for something that is more consistent.
================================
https://dannyelectronics.wordpress.com/
 

Offline sagi4422Topic starter

  • Newbie
  • Posts: 6
Re: MCU connection to an analog circuit
« Reply #2 on: January 23, 2014, 07:07:07 am »
Hi Danny,
Can you elaborate on the CTMU and/or how it helps in this circuit?
I am trying to keep the circuit as simple as available and I am much new in this.
 

Offline poorchava

  • Super Contributor
  • ***
  • Posts: 1673
  • Country: pl
  • Troll Cave Electronics!
Re: MCU connection to an analog circuit
« Reply #3 on: January 23, 2014, 07:21:18 am »
CTMU is a digitally programmable current source that can source from 550nA to 550uA of. That's it.

constant current into resistor = voltage.

It's possible that you could omit an opamp all the way (eg. 550nA into 8Mohm gives you 4.4V).
I love the smell of FR4 in the morning!
 

Offline sagi4422Topic starter

  • Newbie
  • Posts: 6
Re: MCU connection to an analog circuit
« Reply #4 on: January 23, 2014, 07:43:27 am »
I need lower current than 550nA in this case.
550nA into 20Mohm gives 11V .
I need at least a support of up to 50Mohm baseline sensors.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: MCU connection to an analog circuit
« Reply #5 on: January 23, 2014, 10:26:06 am »
Sub-ua CCS is tough to make stable and to use in the real world.

You may try driving a small capacitor via the resistor / sensor and measure the time it takes to charge up the capacitor (to a digital '1' or adc its voltage). The longer it takes to charge up the capacitor, the higher value the resistor is.

The trick is to pick the capacitor value so you still have some resolution when the sensor's resistance is small, yet not too long when the sensor's resistance is large.

This can be made to work with or without an adc.
================================
https://dannyelectronics.wordpress.com/
 

Offline sagi4422Topic starter

  • Newbie
  • Posts: 6
Re: MCU connection to an analog circuit
« Reply #6 on: January 23, 2014, 10:34:45 am »
Hi.
Thanks for the suggestions. As it works now (e.g. the circuit I added) it works ok to me.
I just want the ability to change the feedback resistor according to the sensor I will put.
for example.....
1. Connect Rf #1
2. read voltage for 1 sec 
3. Check if Rf #1 gives the best sensitivity
4. If not, change Rf #1 to  Rf #2
5. and so on....
 

Offline miceuz

  • Frequent Contributor
  • **
  • Posts: 387
  • Country: lt
    • chirp - a soil moisture meter / plant watering alarm
Re: MCU connection to an analog circuit
« Reply #7 on: January 23, 2014, 10:42:11 am »
You can put a digital potentiometer for your feedback resistor.

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: MCU connection to an analog circuit
« Reply #8 on: January 23, 2014, 11:02:45 am »
I would encourage you to do an analysis on your circuit. Specifically, how much the sensor's resistance has to change to produce a reading differential in the adc? And ask yourself if that works for you.
================================
https://dannyelectronics.wordpress.com/
 

Offline sagi4422Topic starter

  • Newbie
  • Posts: 6
Re: MCU connection to an analog circuit
« Reply #9 on: January 23, 2014, 11:11:22 am »
Thanks Danny,
As I need to see major changes e.g. 10% and more, and not really need the exact output voltage, I am living nicely today with the 10bit ADC.
Of course if I want to be able to have the exact voltage, I will have to use a better ADC.

Any suggestions for MCUs ? I dont know to code and learning C will take some time. I found the Picaxe to be the most user-friendly MCU. Is it?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: MCU connection to an analog circuit
« Reply #10 on: January 23, 2014, 12:04:30 pm »
What is simple to me or others doesn't matter to you.

If you are comfortable with picaxe, go for it. Others mcu platforms with easier learning curve include Aruidno and other launchpads / discovery boards - the latter may not be that easier for everyone.
================================
https://dannyelectronics.wordpress.com/
 

Offline sagi4422Topic starter

  • Newbie
  • Posts: 6
Re: MCU connection to an analog circuit
« Reply #11 on: January 23, 2014, 12:09:26 pm »
I didn't use Picaxe yet, its just from reading through the web so I am open to any recommendation
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: MCU connection to an analog circuit
« Reply #12 on: January 23, 2014, 12:20:09 pm »
Your question is irrelevant and not answerable: no one but you will know if it is simple to you.

Try it and you will find out for sure if it is simple to you.
================================
https://dannyelectronics.wordpress.com/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf