Current way out of design spec in a project, can't find why. - Page 1
Forum section: electronics / projects

author: dmg
author_rank: Regular Contributor
timestamp: August 13, 2018, 04:28:42 pm
content: Hi,I have designed some electronics for a CO2 laser power meter. There are people who sell you calibrated anodized aluminium blocks that hook up to a thermocouple (looks like hard anodized aluminium absorbs 10.6um light very well). You dump your block in some water resting at room temp, dry it, record ambient temperature reading, fire your CO2 laser at it for a fixed and calibrated amount of time and wait until you reach peak temperature, and then peak temperature increase is proportional to laser power (we're talking 10's of watts here, from CO2 laser tubes).The guy who sold me the calibrated block designs them for use with a chinese thermometer and calibrates the things for 1W = 1ºC, and even though using the chinese thermometer is very easy I thought I could do better. Why not design some ad-hoc electronics to automate the process (check ambient temp stability, time the exposure and such) and also why not try and use a better thermocouple front-end to get high resolution and maybe, through some algorithm, derive a method to measure power in less time (currently it takes 41 seconds for my block).So I designed a litthe gadget with an MCP9600 thermocouple to digital IC, a PIC32MM0016GPL020-I/ML microcontroller (because PIC32 is the 32 bit architecture I'm most familiar with) and a SPI 128x64 graphic LCD screen I had in my junkbox (JHD12864-G08 from jhd-lcm, using ST7565R driver). Two push buttons and the typical passive stuff completes the circuit.I'm clocking the PIC32 at 1MHz from its fast RC internal oscillator. Only active peripherals are SPI1, ADC, internal bandgap (I use those to measure battery voltage) and coretimer (I2C uses software bit-bang). The rest of the peripherals are shutdown and disabled with the PMD registers.So, with that in mind, my expected current consumption was (datasheet:http://ww1.microchip.com/downloads/en/DeviceDoc/PIC32MM0064GPL036-Family-Data-Sheet-DS60001324C.pdf):PIC32:Operating current: 0.65 mA max @ 1MHz (as stated in page 210. I meet all the conditions they state except that I use FRC instead of external oscillator, so...)External oscillator current delta: 0.305 mA (page 213)ADC current delta: 0.45 mA (but I only sample once per second and use 10 bit mode, so it should be lower IRL)SPI current delta: can't find spec, but I suspect it's negligible (I only update the screen once per second)Total PIC32 max current: 1.405mAMCP9600:0.5 mA max most of the time1.5 to 2.5mA for 12ms every 320msScreen:Approx 300uASo, with these numbers, I expected a base current of about 2mA (probably less due to ADC not being used continuously) and peaks of up to 5mA, tops.I assembled the board, checked that there are no shorts, programmed the firmware and measured the current consumption. I own a uCurrent and a 121GW multimeter, and both measure around 3.5mA continuous current (no variation, no dynamic current, just DC) if the PIC32 is erased. I expected to see the MCP9600 power pattern (12ms peaks every 320ms, as this IC starts powered up) but nope, just 3.5mA DC.If I program the PIC's firmware, the power consumption jumps to 7.5mA, no matter what I do. If I put the MCP9600 to shutdown mode (and confirm it's shutdown), there's no 0.5mA drop in the measurement, it stays at 7.5mA. If I put the PIC to sleep, there's no power consumption drop. If I hold the screen in reset, there's no power consumption drop either, it's always ~7.5mA. The only way I can get it to change is by pressing the buttons (I use the PIC's internal pullups and every time I press a button I get about 0.15mA extra current).I have tried to measure current with the uCurrent and my oscilloscope, but I fould that my uCurrent is useless as it's affected by the oscillating opamp thing (I'll have to fix it I guess), so no high-bandwidth measurements...Any clue on what might be happening? The supply voltage is 3V nominal, from 2xAAA. All measuremets I've done used a 3V bench PSU instead of the batteries.