Author Topic: Measuring resitance with microcontroller  (Read 4377 times)

0 Members and 1 Guest are viewing this topic.

Offline DroneBusterTopic starter

  • Contributor
  • Posts: 14
  • Country: lt
    • razgunas.lt
Measuring resitance with microcontroller
« on: January 20, 2016, 08:05:47 pm »
Hello,

I'm working on board which should measure gas concentration. I'm going to use this sensor: http://www.sgxsensortech.com/content/uploads/2014/08/0278_Datasheet-MiCS-4514-rev-16.pdf
The problem I have is how to measure resistance with microcontroller. Rs (sense resistance) swings from 100ohms to 15Mohms. I found this circuit http://www.circuitstoday.com/ohmmeter-using-arduino but I don't know if voltage divider will work with high resistor values...

Also how should I multiplex sensors? Because there  will be total of 3 sensors (maybe more), so I don't want to make separate circuits for measuring. I think I will use analog switches (TS3A24157DGSR). Is there any better ways?

Thanks for any help  :)
 

Offline bitslice

  • Frequent Contributor
  • **
  • !
  • Posts: 493
  • Country: gb
Re: Measuring resitance with microcontroller
« Reply #1 on: January 20, 2016, 08:27:09 pm »
Or you could charge a capacitor(s) to a set voltage, measure the time it took and derive the resistance from that. Good for high values of R.
 

Offline andre_teprom

  • Regular Contributor
  • *
  • Posts: 71
  • Country: br
    • Aluis-Rcastro
Re: Measuring resitance with microcontroller
« Reply #2 on: January 20, 2016, 09:33:30 pm »
Analog switches are quite enough for that sensores whose resistences lies on the range near or bellow to Kohms.
"Part of the world that you live in, You are the part that you're giving" ( Renaissance )
 

Offline KL27x

  • Super Contributor
  • ***
  • Posts: 4103
  • Country: us
Re: Measuring resitance with microcontroller
« Reply #3 on: January 20, 2016, 11:51:41 pm »
Quote
but I don't know if voltage divider will work with high resistor values...
The conventional method would be to make the high impedance resistor ladder and then run the output through an opamp to buffer the output (lower the impedance). The opamp takes the weak signal and makes it strong enough to feed into the ADC of your micro. Plus you can tweak the gain to get the voltages in the right range for your ADC to maximize the resolution.

The datasheet will show the maximum recommended signal impedance for your ADC. At 15Mohm resistance of your sensor leg of the ladder, yeah, you will mostly likely need to buffer the output.

Bitslice's suggestion has some pros and cons. The tolerance range of capacitors is a major con, if you plan to make more than one of these.
« Last Edit: January 21, 2016, 12:10:11 am by KL27x »
 

Offline DroneBusterTopic starter

  • Contributor
  • Posts: 14
  • Country: lt
    • razgunas.lt
Re: Measuring resitance with microcontroller
« Reply #4 on: January 25, 2016, 10:16:27 am »
Could you provide article or something. Because only resistor ladders I can find is for ADC and DAC. Do you think my provided method would work if i buffer output with op-amp? 
« Last Edit: January 25, 2016, 11:42:29 am by DroneBuster »
 

Offline DroneBusterTopic starter

  • Contributor
  • Posts: 14
  • Country: lt
    • razgunas.lt
Re: Measuring resitance with microcontroller
« Reply #5 on: January 28, 2016, 01:46:55 pm »
Anyone?
 

Offline MrSlack

  • Frequent Contributor
  • **
  • Posts: 880
  • Country: gb
Re: Measuring resitance with microcontroller
« Reply #6 on: January 28, 2016, 01:56:52 pm »
How I'd do it:

1. Build an RC square wave oscillator with the controlling R being the gas sensor. Use an op amp/555 or something as the generator.
2. Use the counter/prescaler in the microcontroller to scale / count the pulses.
3. Maths. Calibration curve/LUT/algebra depending on how clever your compiler is.

The only pain is finding highly stable accurate capacitors for the RC osc but you can compensate for this with highly stable capacitors and a calibration curve.
 

Offline matseng

  • Frequent Contributor
  • **
  • Posts: 563
  • Country: se
    • My Github
Re: Measuring resitance with microcontroller
« Reply #7 on: January 28, 2016, 02:01:06 pm »
The problem I have is how to measure resistance with microcontroller. Rs (sense resistance) swings from 100ohms to 15Mohms. I found this circuit
I had a peek at the datasheet.  The range is 100K (not 100ohm) to 1500K.  That will make the measurement easier.
 

Offline DroneBusterTopic starter

  • Contributor
  • Posts: 14
  • Country: lt
    • razgunas.lt
Re: Measuring resitance with microcontroller
« Reply #8 on: January 28, 2016, 07:19:42 pm »
The problem I have is how to measure resistance with microcontroller. Rs (sense resistance) swings from 100ohms to 15Mohms. I found this circuit
I had a peek at the datasheet.  The range is 100K (not 100ohm) to 1500K.  That will make the measurement easier.

Datasheet define R0 range not RS. RS/R0 is defined in charts.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf