I've been working in the background on replacing the NiMH battery in the candle project with a supercapacitor. It's been quite the journey and at times I definitely did not believe that it would ever happen.
There is a great benefit when you are a mad pioneer in being ignorant of what is conventionally regarded as not possible, so I just assumed in my usual trial and error, and error, and error method of experimentation that the problem would eventually be solved.
Three impossible things needed to happen for this project to be completed:
1. A supercapacitor needed to be able to run a microcontroller (just ticking over anaemically at a very low clock rate) for a useful amount of time (e.g. overnight) - done
2. A microcontroller (e.g. the PADAUK PFS154) needed to be able to detect when it was night time just from the charge profile of a capacitor - done
3. A circuit designed to have at it's heart a NiMH battery would need to be fooled and use a collection of passives instead
The final result needs more polishing, but all three miracles have occurred and now the candle project will be re-imagined as a supercapacitor project. Done?
The SOP8 version of the CH32v003 is pretty amazing, and one "feature" is the ability to remap many functions/protocols to the same pins.
This is fine up to the point where there might be a clash. For instance, just look how busy pin 8 is - overloaded including the function that allows it to be programmed and reprogrammed (the one-wire SWIO "single wire" protocol) that for some reason is on the same pin as serial TX.
So...what if you have engaged serial communication AND want to reprogram the chip?
Disaster! But, there are a few ways I have found to get around the problem.
1. Use the minichlink program as we saw in a previous blog and video.
2. Only open up Serial when you need it, and then the chances of interrupting the program to "reprogram" are increased (dodgy I know)
3. Use a mysterious function on a mysterious piece of software to somehow use the one-wire protocol to "printf" from pin 8.
4. Re-map the pins! (see below)
5. Buy the version with more pins you cheapskate!
Now the deep deep deep dive into pin re-allocation took me through many websites, forums and configurations files, but here is what you need to do:
a) find the files PeripheralPins.c and variant_CH32V003F4.h in the core directory as follows:
b) Make the following config file edits to re-map the pins:
After that the only "gotcha" is to remember to switch the connections as follows:
Then you can reprogram at your leisure and enjoy serial communication as well. Speaking of enjoyment, please see the video below and let me know if any of these workarounds did the trick for you as well.
Looking to power a fan to keep an Orange Pi 3B cool inside it's enclosure, I turned to a "power" mosfet I hadn't worked with before, the super little guy AO3400.
Rated to 30V and a fanciful 5.8A it seemed to be perfect for the job because it could "open the gate" at around 1.1V.
I designed a suitable circuit, soldered the little bits together on a SOP8 to DIP8 adapter (!!) as per below:
The design seemed to work for an LED circuit, so I boxed it up and ran it from the 5V rail of the OPi 3B.
See the result below. Please add comments on YT below the video, especially if you have a view on fan orientation!
Newbies with cool tech like me are prone to "bricking" chips which basically means you can't program the things anymore.
Different chips react differently in these circumstances. Once upon a time I invested in a High Voltage AVR Programmer for reviving ATTiny85 chips that I had unwittingly fried with poor code. And it worked a treat!
The CH32v003 peeps in their wisdom have fortunately included in their one-wire communication protocol the ability to reset and therefore un-brick a chip.
There's a little VCC dancing to make it happen, but...well, take a look...
I've had great success with the Orange Pi range over the years. I will say that I've always bought the cheap(est) option and even now I'm not sure if I'd take the plunge on an OPi 5 with all the fruit - that's a lot of dollarydoos!
In the meantime I have an OPi 3 LTS chugging away in the background on both PiHole duties as well as a Media Server - and it works great!
But recently I grabbed hold of the holy money belt and shook like crazy to purchase the following pack of goodies.
I think that this machine might end up being the new NAS and Pi-hole combo. The first thing to do is roll-my-own Armbian. I did start off with a community version of Ubuntu, which booted fine, but I had trouble copying the system over to the EMMC module - so roll your own Armbian it is!
The addition of a 1Tb NVME solid state drive should give a few options for video and music streaming - time will tell. It's my impression from reading that you could use this fast SSD option to preload or buffer video and audio from a larger HDD and thus smooth out some rough edges that occasionally appear.
Here are the stats on this little beauty - I still think it's cheap for the power and the potential, a nice mix of stats and options making it one of the more versatile units in this range.
And the video? I've tried to show the whole process from unpacking to running the desktop on the device.