Posts

Showing posts with the label hw

Let's make a ESR meter : Principle (part 2)

Image
Overview The complete schematic is as follows  It it made of 4 parts : Sinusoidal signal generation Resistance divider (impedance actually) Amplification Peak detection Sine generation The sine is generated using a timer controlled dma feeding the PWM to have a sine envelop on a high frequency signal (see previous post). A simple low pass filter will only keep the sine signal and it then goes through the  transformer. That transformer has been  salvaged from an old phone charger. It has a 1:20 ratio. So the input signal is ~ 3.3 v peak to peak with ~ 100mA max current, the output is 165 mv peak-to-peak BUT have a 2A max current. Since the voltage is so low, that helps for in-circuit measurement, the voltage is not enough to trigger a diode/ NP junction or most mosfets. Resistance Divider / Amplification / peak detection The output of the divider is Z/(R9+Z) x VccTransfromer Z is the total impedance of the capacitor at ~ 50 khz.  It is assumed the cap is high enough s...

Let's try to make an ESR meter (part 1: AC Signal)

Image
 I've stumbled upon this : https://ludens.cl/Electron/esr/esr.html A 100% hw ESR meter. The principle is simple enough :  - Generate an "AC" signal - Go through a transformer to lower voltage/increase current  - Measure the impedance across the capacitor to measure (and assume ESR >> Z at that fq ?) Let's do it with a MCU and a salvaged transformer from a 5v usb power supply. AC ? Since we are using a transformer, we NEED to use a AC source. DC will just heat the transformer. At first i used a sine oscillator made with an opamp, it sort of worked but was very unreliable in terms of replicating the circuit (gain was to be manually tweaked, its oscillation was changing, single fq ...) The 2nd try was with a plain square oscillator, driven by the MCU. It worked fine, but caused inductance effect on the transformer because the signal was square. The transformer output signal was very distorted. I could have used a CH32F103 or a GD32Fxx, which contain a DAC, but i a...

1.69' ST7789 240x280 rounded corner LCD

Image
 That screen is available for ~ 4$ on  ebay It has a few oddities. First the pinout, it is not easy to find but here it is : 1 GND 2 LEDK (connect to ground) 3 LEDA (connect to VCC with a few ohms resistor, like 10 Ohms) 4 VCC 5 GND 6 GND 7 DC 8 CS 9 SCL    (SPI Clock) 10 SDA  (SPI Data) 11 RESET 12 GND Second, it is a bidirectional SPI, meaning only 2 pins are used: Clock and Data Data is used for both as MOSI and MISO depending on the command. On those screen, reading is seldom used, so you could just use it as MOSI. The logical screen is a plain square 240x280 box, some pixels are just not physically there.