I recently bought a few Arduino Uno clones. They were not cheap. They utilise the ch34 IC, which is a USB to UART solution. They all have SMD atmega328pb soldered on them.
The problem is that two of them stopped working with the Arduino ide. On inspection, i found out that my software was not updated so firstly I updated the software which now includes a configuration for the atmega328pb.
But somehow the internal bootloader in these SMD chips got corrupted and it stopped working. I then probed the chip with AVRdude prograamer.
Found that the chip is atmega328pb. The configurations were not included at the time of installation. But the avrdude program allows you added other avr parts from Atmel.
I need to monitor battery voltage to check weather my charging system is working correctly or not. But to do that i have get up and walk with my multimeter towards the battery and i have to take these reading in night.
I placed my battery in a corner where there is very little light. So I added a transistor switch which can be controlled using Bluetooth to turn on the led light. Which provides enough light to act as a night light.
The ESP32 also has an ADC built into it. Which is very poor in terms of accuracy. It gets you the idea that there is something to work with but it does not give very precise reading like a multimeter.
Also, the ESP32 ADC is non-linear. The ADC also has an attenuation feature. Which by default is set to 11db. which gives us a workable range of up to 3.3V. But there are flat-out regions which need to be taken into account if you want to measure anything from this ADC. There is a 0 – 0.2V region in which the value read is constant, and there is a 2.9V to 3.3V region which also gives you constant reading values.
Resolution is 12-bit by default.
To measure a large voltage using this device. I made a voltage divider.
TIP3055 BJT is used as a low-side switch. R1 gives a base current of 330uA(=3.3/10000) which gets multiplied by the beta or hFE 70 of transistor to get a collector current of 0.023A or 23mA.