Ultrafire XML-T6 LED torch – a fix for the dysfunctional mode memory ‘feature’ #2

On review of the Ultrafire XML-T6 torch, I found the mode switching / mode memory so dysfunctional that it rendered the torch useless in my evaluation.

At Ultrafire XML-T6 LED torch – a fix for the dysfunctional mode memory ‘feature’ I gave a fix for that revision of the electronics, and updated it with description of a later fixed production model.

Years later, I bought two more of these due to switch failures on the originals… and guess what, the flash on power on returns.

Let’s pull them apart.

They have a new revision / version of the LED driver PCB, and it has provision for a resistor in parallel with the capacitor, but the resistor pads are not populated.

Above, the LED driver board with a 100k resistor added, it is the far component. This was an 0805 part that was on hand, but ideally should be a 0603. Continue reading Ultrafire XML-T6 LED torch – a fix for the dysfunctional mode memory ‘feature’ #2

ESP8266, ESP32 reset – the (ugly) detail

Like many microcontrollers, the ESP8266 and ESP32 series contain an in-Silicon bootloader which can be initiated at chip reset by holding a pin low at the moment of reset.

Documentation is not helped by less than common terms (like EXTRSTB for a pin that is really a /RST, and it is labelled EN on the ESP32). The other relevant pin is known as GPIO00, but can be thought of as a /BOOT bin.

Automatic bootloader initiation

The firmware is uploaded using ordinary RS232/TTL, and it is possible to use modem control signals to control the /RST (EXTRSTB) and /BOOT (GPIO00 or IO0) pins, indeed the common convention is to use RS232 signals RTS for resetting the MCU, and DTR for boot selection.

So, it is possible to connect RS232/TTL /RTS to /RST and /DTR to /BOOT, and ESPTOOL will automatically initiate the boot loader when accessing the chip.

Above is a simulation of that type of direct connection. The RTS/DTR scenario is that from ESPTOOL, but it can be seen that even if the RTS transition was delayed somewhat the /BOOT pin is low and when /RST rises the chip will initiate the bootloader. The critical timing is that /BOOT is low when /RST transitions from low to high. Continue reading ESP8266, ESP32 reset – the (ugly) detail

Logging temperature meter (ltm) v1 – prototype trial run measuring ECT

Logging temperature meter (ltm) is a ESP8266 based temperature measurement and logging device.

Above is the prototype, but for this test a small thin film NTC thermistor was attached to the existing engine coolant temperature (ECT) sensor. Continue reading Logging temperature meter (ltm) v1 – prototype trial run measuring ECT

A handy 230VAC 15A inline power meter based on an inexpensive module from eBay

This article describes a simple and inexpensive inline power meter for use as a test instrument.

CNC routing

The box cutouts were done on a CNC router, but they could be done with hand tools.

Above, calcs of feeds and speeds for the CNC router. The box is actually ABS, but cutting speed for Polycarbonate is the same.

Above is the tool path for one side of the box. The cutouts suit the 7P-2 strain reliefs. The gcode is generated from a custom Python file using a custom library of common shapes that I use. Continue reading A handy 230VAC 15A inline power meter based on an inexpensive module from eBay

Logging temperature meter (ltm) v1 – prototype Vin calibration

Logging temperature meter (ltm) is a ESP8266 based temperature measurement and logging device.

ESP32

The project is based on port of an existing ESP8266 Arduino project, and consideration was given to migration to the ESP32 hardware platform, but there are large differences to the WiFi related libraries… so for now, ESP8266 looks ok.

A bigger issue is that the ESP32 ADC is renowned for non-linearity, worse in some modes than others.

One poster offered the following graph of an ESP32 measurement to a discussion.

Some developers have worked on a per device look up table to implement a linearisation scheme. That means each individual device needs to have its input characteristic mapped and then used by the compensation code running on that device. Continue reading Logging temperature meter (ltm) v1 – prototype Vin calibration

Logging temperature meter (ltm) v1 – a preview

Logging temperature meter (ltm) is a ESP8266 based temperature measurement and logging device.

The project is based on port of an existing ESP8266 Arduino project, and consideration was given to migration to the ESP32 hardware platform, but there are large differences to the WiFi related libraries… so for now, ESP8266 looks ok. There remain development options for multi channel logging if needed.

Design criteria

The design criteria are:

  • small, portable, battery powered;
  • direct reading temperature scale;
  • flexibility for a range of sensors;
  • local display including bar graph, time, and temperature;
  • log measurements to a serial port of some kind;
  • offer remote access for recent measurement log.

Algorithms

The initial algorithm implemented is for a negative temperature coefficient (NTC) thermistor using the single ADC port on the ESP8266. The code uses the Steinhart-Hart model to solve for temperature.

Above is a plot of the Steinhart-Hart model (red) and the so-called B equation (green) for the NTC used in my car. They are quite similar in this case, but the Steinhart-Hart model is more accurate. Continue reading Logging temperature meter (ltm) v1 – a preview

Engine coolant temperature sensors – a closer look

Diagnosis of engine coolant temperature gauge issue with a certain vehicle discussed ECT sensors in a specific context.

The following table of coefficients for four common sensors was derived from published measurements by TSD of a single sensor of each type.

The so-called B equation model is \(T=\frac{1}{\frac1{T_0}+\frac1Bln\frac{R}{R_0}}\).

Part R25 B25/100
AMR3321 2246 3897
ERR2081 2218 3879
ETC8946 2450 3671
AMR1425 536 4356

These are measurements of a single sample, so average values might be a little different. Additionally, the R25 / B25/100 model is only an approximation. Continue reading Engine coolant temperature sensors – a closer look