MCU connection to an analog circuit - Page 1
Forum section: electronics / projects

author: sagi4422
author_rank: Newbie
timestamp: January 22, 2014, 08:05:14 pm
content: 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 MOhm2. The fabrication method is not stable therefore I have variance between the baseline in each sensor I fabricate3. 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

author: dannyf
author_rank: Super Contributor
timestamp: January 22, 2014, 11:20:38 pm
content: 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.QuoteNo easy way out, other than swapping out the sensor for something that is more consistent.

author: sagi4422
author_rank: Newbie
timestamp: January 23, 2014, 07:07:07 am
content: 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.

author: poorchava
author_rank: Super Contributor
timestamp: January 23, 2014, 07:21:18 am
content: 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).

author: sagi4422
author_rank: Newbie
timestamp: January 23, 2014, 07:43:27 am
content: 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.

author: dannyf
author_rank: Super Contributor
timestamp: January 23, 2014, 10:26:06 am
content: 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.

author: sagi4422
author_rank: Newbie
timestamp: January 23, 2014, 10:34:45 am
content: 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 #12. read voltage for 1 sec3. Check if Rf #1 gives the best sensitivity4. If not, change Rf #1 to Rf #25. and so on....

author: miceuz
author_rank: Frequent Contributor
timestamp: January 23, 2014, 10:42:11 am
content: You can put a digital potentiometer for your feedback resistor.

author: dannyf
author_rank: Super Contributor
timestamp: January 23, 2014, 11:02:45 am
content: 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.

author: sagi4422
author_rank: Newbie
timestamp: January 23, 2014, 11:11:22 am
content: 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?

author: dannyf
author_rank: Super Contributor
timestamp: January 23, 2014, 12:04:30 pm
content: 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.

author: sagi4422
author_rank: Newbie
timestamp: January 23, 2014, 12:09:26 pm
content: I didn't use Picaxe yet, its just from reading through the web so I am open to any recommendation

author: dannyf
author_rank: Super Contributor
timestamp: January 23, 2014, 12:20:09 pm
content: 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.