ATtiny1616 -> ADC or CMP for shunt current measurement

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hopefully my final ATtiny1616 question.

I've a circuit where there's no space for an op-amp and a requirement to do a very rough current usage approximation. As there's no space for a shunt either I'm utilising a low-side NMOS with a 55 mOhm Rds. I've worked out the following levels for the 'bands' and the DAC values when the ref is 0.55v.

 

// 0.055 ohm * 0.2A = 0.011v, /0.55*255 = 5
// 0.055 ohm * 0.6A = 0.033v, /0.55*255 = 15
// 0.055 ohm * 1A = 0.055v, /0.55*255 = 26

A timer will cycle through changing DAC values or ADC values to determine the current band. If I can get within 0.1A accuracy that would be fine.

My question is whether to implement using the CMP (it's so close to ground no hysteresis can be used) or the adc (which is potentially noisier)?

I'm inclined to go with the CMP but could be talked into either way!?!

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How accurate is this Rds anyway? Did you measure it for a reasonable sample of MOSFETs?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've seen that used on some Chinese Solar controllers to measure the panel current when the fet was on, so it can work, but may require some calibration with each unit using known currents.

Make sure you always start with the high current range and work down to lower levels if needed.

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Perhaps not, I've managed to make enough room for a 50mOhm 0805. 

Also I've commandeered the CMP for another task, so I hope the adc is up to it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For reference if anyone tries this, it works superbly. The ADC in the 1616 is very clean, and that built in 0.55v reference is very helpful.

I use a 50mOhm resistor and reckon resolution is around the 20mA mark. Very nice for not using an op-amp.