Follow along as I float through the C of integer division and trace my way through the maze of my own misconnections. From hand-assembling boards to troubleshooting pin connections and bit-banging I2C, this project teaches me a lot about writing firmware on an ATTIY45 chip, keeping inside the limiting 4kb of memory.
The schematic consists of two main parts, the current sense opamp which is offset by VCC/2 so that I can measure current direction, and the attiy45 chip which drives the OLED and does the calculations from ADC to current.
Github project: https://github.com/PocketConcepts/MiniAmmeter
The PCB was designed using KiCAD 8.0, and coming out of a 2 year stint of Altium I have to say I've very impressed! I found Altium bloated, buggy, and needlessly obfuscated at times so coming over to KiCAD felt fresh and fluid. It feels like it sits somewhere between EasyEDA and Altium. Still getting to grips with the component management but I have plan to build a submodule library and share between projects.
Getting my head around C/C++/Arduino coding was an addicting challenge that I did not expect to grab be so much, but it's headache inducing charm kept me coming back for more, and limiting myself to the ATTINY45, over the equally priced 85 was an additional challenge on top, but can now be added to the small library of OLED projects that use the 45.
This project on it's own is really nice just to have lying around, but it's a component of a larger project which you'll see more of in 2025 ; )
Resources:
https://www.youtube.com/watch?v=zYYM_8Znk3E
https://zl2pd.com/SWRmeter.html
https://www.youtube.com/watch?time_continue=1&v=w_ibgtgXcII&embeds_referring_euri=https%3A%2F%2Fwww.google.com%2F&source_ve_path=MjM4NTE