Learn · Solar Tracker, Build it · First power-on and the resistor test

11.3 The resistor test

Prove that the charger stops charging below 0 °C and above 50 °C, with two fixed resistors in place of its thermistor (R4)

14 min · You need: A multimeter with a 10 A socket, A 47 kΩ and a 2.7 kΩ resistor, Two crocodile-clip leads, A certified USB-C phone charger and its cable

Step 1 of 12 Two layers, both proved

A lithium-ion cell must never charge below 0 °C, and charging it hot wears it fast. So the tracker has two independent layers (R4):

  1. The charger's own thermistor stops charging below 0 °C and above 50 °C. It's built into the charger chip, so it works even if the firmware crashes.
  2. The XIAO's thermistor stops it below 2.0 °C or above 45.0 °C, through the charger's CE pin.

You can't make the bench −10 °C, so you fool the charger instead: a fixed resistor in place of its thermistor reads as a fixed temperature.

Danger: Until both layers have passed, the tracker stays indoors, and charges only while you're with it.

Step 2 of 12 Why these two resistors

A thermistor like these, 10 kΩ at 25 °C with a B value of 3435, has more resistance as it gets colder:

ResistanceReads asWhat should happen
47 kΩabout −10 °CCharging stops
28.7 kΩ0 °CThe charger's lower limit
26.2 kΩ2 °CThe firmware's lower limit
10 kΩ25 °CCharging
4.85 kΩ45 °CThe firmware's upper limit
4.1 kΩ50 °CThe charger's upper limit
2.7 kΩabout 63 °CCharging stops

Both test values sit well outside the limits, so a resistor a few percent off its value still gives a clear answer.

Step 3 of 12 What you'll see

The resistor test: the meter in the cell's lead shows charging with the thermistor on THERM; with 47 kilohms in its place the charger reads about minus 10 degrees and charging stops, with 2.7 kilohms about 63 degrees and it stops; the XIAO's own layer sets D6 high to stop charging+−12cellmeter on 10 AB+protectionChargerLIPOTHERMCEUSB-C inPGOODCHG−10 °C0 °C25 °C50 °C63 °Creads ascharger chargesGNDAthermistor 1 on THERM10 kΩ: about 25 °CchargingGND47 kΩ in its placereads as about −10 °Ccharging stops0.00 ACHG may stay lit:trust the meterGND2.7 kΩ in its placereads as about 63 °Ccharging stops0.00 ACHG may stay lit:trust the meterGNDXIAOD6D23.3 V47 kΩD6 high: CE high,charging offD6 low:charging allowedD6 is heldthrough sleepfirmware: 2 to 45 °CA0.00 A
The thermistor on THERM reads about 25 °C, so the charger charges, and the meter shows the current going into the cell.47 kΩ reads as about −10 °C, below 0 °C: charging stops, and the meter reads 0.00 A. The CHG light may stay lit.2.7 kΩ reads as about 63 °C, above 50 °C: charging stops again.

The plan for this lesson: the meter goes in the cell's lead, so it shows the current into the cell. Then, one at a time, a fixed resistor takes the thermistor's place on THERM. Step through what the charger reads each time, and what the meter shows.

Step 4 of 12 Put the meter in the cell's lead

To see charging stop, measure the current into the cell: the meter goes in series with it.

  1. Switch off, and take the cell out.
  2. Unsolder the holder's red lead from the protection board's B+. Lesson 10.2 left it a little long for this.
  3. Red meter lead in the 10 A socket, black in COM, dial on DC amps.
  4. Clip the red probe to B+, and the black to the holder's red lead.
  5. Put the cell back in, and tape the thermistors on.

The charger can charge at 1 A or more: too much for many meters' mA socket. The 10 A socket takes it.

Tools

  • Multimeter, two crocodile-clip leads

Check before Worked

Step 5 of 12 A meter on amps is a short

A meter on its amps socket is almost a plain wire: in the cell's lead it reads the charging current; with its probes across the cell it shorts it, and the leads get hot in a second; to measure volts, take the cell out first, then move the red lead back to V10ACOMVΩVA+−B+protection0.42 AIn the cell's lead, the meter is almost a plain wirethe charging current flows through it, and it reads it: what you want+−> 10 AAcross the cell, it's a short through the meterthe leads get hot in a second, and the cell can be damagedcell out0.00 VTo measure volts: the cell out first, then the red lead back to Vnever move a probe on the amps socket while the cell is in
In the cell's lead, the meter on 10 A carries the charging current, and reads it.Across the cell, it's a short through the meter: the leads get hot in a second.To measure volts: the cell out first, then the red lead back to V.

On its amps socket, the meter is almost a plain wire. That's what you want in the cell's lead.

But touch its probes across the cell, or across any + and GND, and you short the cell through it. The wires can get hot in a second, and the cell can be damaged.

So while the red lead is in the 10 A socket:

  • the probes stay clipped in the cell's lead, nowhere else;
  • to measure volts, take the cell out first, then move the red lead back to V.

Danger: Never move a probe that's on the amps socket to another point while the cell is in.

Step 6 of 12 Charging, with the thermistor

Plug the certified phone charger into the wall, then its cable into the charger board's USB-C. Stay with it while it's plugged in, on a surface that can't burn.

The charger's PGOOD light comes on, then its CHG light. The meter shows the current flowing into the cell.

Step 7 of 12 47 kΩ: as if it were −10 °C

  1. Unplug the USB-C from the charger board, and take the cell out.
  2. Unsolder thermistor 1's lead from the THERM pad, and tape its end.
  3. Clip the 47 kΩ resistor between THERM and GND.
  4. Put the cell back, plug the USB-C back in, and wait ten seconds.

Charging must stop: the meter should read 0.00 A. The CHG light may stay lit: in a temperature pause, the charger's CHG pin can still read "charging". Trust the meter, not the light.

Step 8 of 12 2.7 kΩ: as if it were 63 °C

With the USB-C unplugged, swap the 47 kΩ for the 2.7 kΩ, still between THERM and GND. Plug the USB-C back in, and wait ten seconds.

Charging must stop again: the meter should read 0.00 A.

Step 9 of 12 Put everything back

  1. Unplug the USB-C, take the cell out, and take the 2.7 kΩ off.
  2. Solder thermistor 1 back onto THERM.
  3. Put the cell back, and plug the USB-C in: charging comes back, close to your first reading.
  4. Unplug the USB-C, and take the cell out.
  5. Unclip the meter, solder the holder's red lead back onto B+, in heat-shrink, and put the cell back.

Check before Worked

Step 10 of 12 The firmware's layer

The resistor test: the meter in the cell's lead shows charging with the thermistor on THERM; with 47 kilohms in its place the charger reads about minus 10 degrees and charging stops, with 2.7 kilohms about 63 degrees and it stops; the XIAO's own layer sets D6 high to stop charging+−12cellmeter on 10 AB+protectionChargerLIPOTHERMCEUSB-C inPGOODCHG−10 °C0 °C25 °C50 °C63 °Creads ascharger chargesGNDAthermistor 1 on THERM10 kΩ: about 25 °CchargingGND47 kΩ in its placereads as about −10 °Ccharging stops0.00 ACHG may stay lit:trust the meterGND2.7 kΩ in its placereads as about 63 °Ccharging stops0.00 ACHG may stay lit:trust the meterGNDXIAOD6D23.3 V47 kΩD6 high: CE high,charging offD6 low:charging allowedD6 is heldthrough sleepfirmware: 2 to 45 °CA0.00 A
The XIAO's thermistor sets D2's voltage. Below 2.0 °C, D6 goes high and charging stops; it's allowed again only above 2.0 + 1.0 °C.

The XIAO has a thermistor of its own, taped to the cell beside the charger's. It forms a voltage divider with a 47 kΩ resistor from 3.3 V, read on D2.

On each wake, the firmware turns that voltage into a temperature. Below 2.0 °C or above 45.0 °C it sets D6 high, which pulls the charger's CE pin high and stops charging. It allows charging again only 1.0 °C inside the limits: that's hysteresis.

This layer stops charging a little sooner than the charger's, and it tells you why, with a status code. It needs the firmware, so lesson 13.5 proves it with the same two resistors.

Step 11 of 12 The XIAO's thermistor divider

Cell in, switch on. Red lead in V, dial on DC volts. Measure from the XIAO's D2 pin to GND.

At 25 °C the thermistor is 10 kΩ, so D2 reads 3.3 × 10 ÷ (10 + 47), about 0.58 V. Colder rooms read a little more, warmer ones a little less.

Step 12 of 12 Check you've got it

Why does a 47 kΩ resistor in place of the charger's thermistor make it stop charging?
With 47 kΩ in place, the CHG light is still on, and the meter in the cell lead reads 0.00 A. Has charging stopped?
The meter's red lead is in the 10 A socket. What must you never do with the cell in?

In short

  • A colder thermistor has more resistance. 47 kΩ in its place reads as about −10 °C, 2.7 kΩ as about 63 °C (10 kΩ, B 3435): charging must stop for both.
  • Watch the current into the cell, with the meter in the cell's lead. The CHG light isn't proof: in a temperature pause it can stay lit.
  • The firmware's own layer, at 2.0 and 45.0 °C, is proved the same way in lesson 13.5. The tracker goes outside only after both pass.