-
Designing a Battery Charger that avoids battery usage when USB is connected
06/09/2022 at 12:46 • 0 commentsNow lets design a Battery Charger circuit.
I decided to use a TP4065 over a TP4056... No this is not a typo.
Due to some research on twitter I got the hint that the TP4065 is smaller in the footprint and has a way lower quiescent current than its brother the TP4056.
But where to get this little beast.... This was a very hard mission. Everywhere you search for TP4065 you will always get search results for TP4056.
Luckily I found some parts as a leftover stock at LCSC.
What is the Magic about this circuit:
You see this MosFET next to R33. Once External USB Power is connected this MosFET prevents that any power is drained from the battery.
The Voltage from the battery is completely shut down. The Battery is still charging but no current is consumed out of the battery.
-
LOW POWER Opperation with an RTC
06/09/2022 at 12:39 • 0 commentsTo reduce the Current consumption I decided to design a RTC into my design.
This RTC can disable the complete Power supply with an MOSFet.
With this little trick the Quiescent current drops dramtically when the keyboard is not in Use.
According to the datasheet this leads to a low current of 50nA when the design is not in use.
This RTC Chips wakes up based on the the resistors designed around the Delay Pin.
With this Resistors you define the sleep period between the Mikrocontroller shall not get any POWER
Once operation of the keyboard is finished the Microcontroller can send a "Done" Signal to the RTC to send it to sleep earlier than defined by the resistors.
-
Design a Schematic
06/09/2022 at 09:57 • 0 commentsSo lets Design a Schematic in Kicad
What do we need:
Power Supply:
I decided to use a well known Low Drop out Voltage Regulator: RT9013.
Key features: Low DropOut Voltage, low quiescent current. This is important for battery operations
Keys to press:
I decided to go go for Cherry MX Keys RED. They have a perfect press and work quite stable: Side fasct: The can be illuminated with an LED from underneath
To save some IO Pins I decided to arrange the keys in a 3x3 matrix
Some RGB-LEDs because Ble light makes everything better
My typically used SK6812 or WS2812 do not fit under the MX Keys. Therefore I searched a lot and found a better fitting RGB LED
SK6812-Mini: They are small and perfectly fit in a hole under the keys. And most important they work with fast LED.
-
Component Shortage in a Design phase
06/09/2022 at 09:47 • 0 commentsComponent shortage is a big topic nowerdays.
Atmel/Microchip 328p is hardly availible or at an incredible price. Therefore I had to look for other components on the Microcontroller side.
A new star rises on December 2020 from Espressif. The old but gold ESP32 got a replacement called ESP32-S3
In the end of 2021 Espressif announced on their website that ESP32 Wroom is "not reccommended for new designs". At the same time they gurantee a 12 Year of support for the ESP32
At the same time ESP32-S3 was not available widely nor was the Arduino support good or stable. Lots of SW issues are reported and ESP32-S3 seams to be a nightmare (Interrupts, GPIOs,...)
So what to do now? Stay on the old reliable ESP32 or switch to ESP32-S3 with a very immature SW and rare availible chips
So how to handle this situation?
Lets make this design as Generic as possible
Luckily i found out that most of the Pinout of ESP32 Wroom and ESP32 -S3 is identically.
Only two pins are different and these one can be ignored in a custom made design.
Conclusion:
So can we design a Board where ESP32-S3 and ESP32 Wroom fits and most features work?
Lets give it a try:
Both Chips have different strapping Pins, issues with PWM output on ports during boot up, Pins that may not work as ADC if Wifi is enabled, and several other issues.
So I carefully made a table with a side by side comparison of each pin of the ESP32 and ESP32-S3.(SPOILER: It did not work out)
Discoveries:
ESP32-S3 Findings:
- ESP32-S3 has some pins that are not useable if you use Octal SPI Chips
- ESP32-S3 has no more DAC
- Crashes if you use AnalogRead() to often
ESP32 Findings:
- ESP32 ADC2 does not work if WIfi is on
- Internal Pullups of ESP32 are weak