Author Topic: Autorange current measuring with ESP8266  (Read 2348 times)

0 Members and 1 Guest are viewing this topic.

Offline mdijkensTopic starter

  • Regular Contributor
  • *
  • Posts: 146
  • Country: nl
Autorange current measuring with ESP8266
« on: February 28, 2017, 05:56:15 pm »
I'd like to build a wifi current measuring device based on an ESP-12E and an ADS1115 I have laying around with a range from 1uA to 500mA.
I thought of using a 1 ohm 1% resistor for the mA range and a 1K ohm 1% for the uA range.
Now I am wondering if I could make it auto-switching by automatically putting the 1 ohm in parallel with a MOS FET Trigger Switch Drive Module from eBay controlled by the ESP when measured voltagedrop over the 1K becomes to high ....

This might be a very beginners' approach but is this feasible ?
If so, could I extend this approach with more resistors and more mosfet modules to get a better range or better accuracy?
 

Offline fki82

  • Contributor
  • Posts: 34
  • Country: de
Re: Autorange current measuring with ESP8266
« Reply #1 on: February 28, 2017, 08:07:48 pm »
I'm not sure what you mena exactly with  "MOS FET Trigger Switch Drive Module from eBay", but i assume your curcuit would look a lot like what Dave preseted here:



 

Offline mdijkensTopic starter

  • Regular Contributor
  • *
  • Posts: 146
  • Country: nl
Re: Autorange current measuring with ESP8266
« Reply #2 on: February 28, 2017, 08:37:13 pm »
No a bit more simplistic. I want to use http://www.ebay.com/itm/201662448218 to switch a 1 ohm shunt parallel to the 1k shunt.
 

Offline fki82

  • Contributor
  • Posts: 34
  • Country: de
Re: Autorange current measuring with ESP8266
« Reply #3 on: March 01, 2017, 12:41:57 am »
The Ebay offer doesn't really say which MOSFETs are used and how the circuit works, so not really sure how well this module would work. But for $1.33 there is not much to lose anyway...


What kind of current do you want to measure? (AC/DC)
What Voltages are to be expected?

Of course, you can do it with parallel shunts.
But there are some risks for the connected devices, you need to take care of.
If the current/voltage on the shunt resistor rises very quickly, the uC could be too slow to switch the second, low value, resistor and the adc is fried. :-BROKE
The same applies if the uC is off.

You should protect it via a high value series resistor at the ADC input. You could also add some clamping diodes, just to be sure (The ADC should already have internal ones, I didn't check if they would do the job on their own).

The precision also could be an issue.
Depending on the leakage current of the MOSFETs, the lower current range could be off for low currents.
This may or may not be a problem for your application.
 

Offline mdijkensTopic starter

  • Regular Contributor
  • *
  • Posts: 146
  • Country: nl
Re: Autorange current measuring with ESP8266
« Reply #4 on: March 01, 2017, 09:40:44 am »
Thank you for your valuable comments.

I will measure fluctuating current draw from one 18650 cell in the range of 1uA to 500mA. Main reason for this project is to have it automatically switch the ranges sinces the current draw will fluctuate all the time and without it it is difficult to read the sub mA currents which occur to short to change range manually.

The high value resistors, should I put them on all 4 inputs of the ADC? What would be a good value to start with?

About the precision, I was hoping to correct that in software but of course I don't know if the correction is linear or more complex (maybe calibration table)...
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf