• Using up some old Qi chargers

    Dan Julio11/12/2023 at 19:19 0 comments

    I had a couple of Qi charger circuit board kits I got from Adafruit and from a client project. 

    A small Eureka moment ensued when I read my iPhone supported Qi charging as well as Apple's proprietary wireless charging.  For some reason I still had the box the iPhone originally came in and it turned out to be a perfect dimension to hold a Qi transmitter and easily align the phone over it.  A little cutting with an X-acto knife, a little hot glue and a cut piece of 0.25mm thick styrene modeling plastic and I had a bedside charger.  I did have to put a piece of black electrical tape over the blue LED on the transmitter to prevent what looked like a nuclear accident from lighting up the ceiling over the night stand.  I'm glad the era of Blue LED power indicators is over.

    I still had another transmitter and one good receiver (the other was damaged it turns out during an experiment).  So a quick OpenSCAD design made for a second 3D printed charging base.  The modeling plastic is attached using double-sticky scotch tape.  The design is included as one of the project files - charger_base.zip.

    A couple of black plastic nuts glued over the transmitter LEDs made for very nice circular charge indicators visible through the top surface.

    And then I hacked my gCore based hex calculator to include one of the wireless receivers.  The Qi charger just connects to the USB 5V line and ground.   It can deal with USB power being applied too so there was no need for any isolation circuitry.

    The calculator also includes an accelerometer used to automatically power it on when picked up.

    All-in-all a set of pretty quick little hacks with very useful results.  

  • Faux Nixie Caller ID Clock

    Dan Julio10/12/2023 at 19:24 0 comments

    I live in some foothills and cell service is terrible.  So I have an Ooma VOIP box as a landline and an old GE DECT wireless phone on my desk.  Unfortunately most of the calls I get are spam so I decided to use a circuit I had built for weeBell testing and the great spandsp library to make a Caller ID box so I can see who is calling before picking up.  Doing nothing but displaying the rare Caller ID Information seemed boring so why not make a clock too.  And if one is going to make a clock, well it should be a nixie clock.  Or at least a faux nixie clock and I'd get to use up an old Adafruit 3.5" 480x320 pixel touchscreen where the touchscreen part no longer worked.  I even had an old picture frame to give it a faux classy look that fits in with my log house!  For this project I was able to source everything from stuff I already had.

    In North America, the Caller ID process works by encoding the phone number, timestamp and optionally other information like caller name with a 1200 baud FSK Bell 202 modem and transmitting that on the line after the first ring.  At minimum a Caller ID box has a FSK decoder fed by an analog input.  In my case I also used a pulse generated by each ring waveform to help identify a good time to start the decoding process.

    The test circuit I originally built for weeBell was designed to let me safely look at the audio and ring information to debug its Caller ID generation capability.  I started with the circuit diagram I found with this Arduino project and ended up modifying it slightly based on the parts I had on-hand and the desire to add a little more filtering.  The schematic for my test circuit is shown below.

    A typical waveform looks something like this.

    The audio output is on channel 1 and the ring output is on channel 2.  The actual caller ID transmission can be seen after the first ring (the analog signals associated with the ring pulse are just low frequency noise that made it through my filters).

    Initial failures

    The spandsp library is based around 8 kHz audio sampling so I figured I could use the 12-bit ESP32 ADC being read by the I2S peripheral to generate the audio stream.  Unfortunately days of effort amounted to a very unreliable detector.  I never could figure out why.  I dumped the data I read, it looked OK.  I tried a bunch ways to properly scale the data and remove DC offsets.   Decoding would usually work the first time and then rarely after.  Finally I gave up on this approach.  I think for all its promise the ESP32 ADC + I2S is just problematic.

    Using a real codec

    Fortunately I had the AI thinker board I had originally bought when I first started playing with Bluetooth Handsfree telephony at the beginning of the weeBell project.  I ported over the ES8388 audio driver to my test code and was rewarded by reliable decoding almost right away.

    Now I could start on the real gadget and some quick google searching led to some great nixie tube photographs.  I carefully cropped each digit and then used those as the basis for a set of bitmaps (the zero digit has a second copy with the intensity turned way down to use when leading-zero blanking for the hours display).  A picture of the Russian INS1 neon indicator made a great colon (the second colon is just the original image rotated a bit).  Actually 4 pictures of the colon were developed (two for it ON and two for it OFF so it can blink every second).  Once again I used LVGL as my goto graphics library to provide the GUI.  The LVGL website has a utility that let me take all the images and convert them to bitmaps to display on a canvas widget.  The Espressif IDF has support for NTP time setting so it was easy to make a clock that would get its time using Wifi and then constantly update itself.

    The final gadget resides behind the picture frame sitting on...

    Read more »

  • Big Battery Buddy

    Dan Julio08/19/2023 at 22:03 0 comments

    A recent camping trip left me wanting a USB Battery pack with a built-in LED light.  Of course there are no end to inexpensive options available online but why buy when you can build?  Are we not makers?  Plus I wanted my USB Battery to have a proper on/off control and not be controlled by the current draw of things plugged into it.  Fortunately upon returning home I had enough stuff laying around and Big Battery Buddy was born pretty quickly.  OK, 2-3 days effort which is a lot more than just buying the damn thing.  But I'm going with "it's the principle that matters".

    Big Battery Buddy Features

    • 6600 mA battery
    • Up to 3A charge from a USB-C or Micro-B USB connector (OK, one isn't going to get 3A through the Micro-B... but it's wired in parallel to the USB-C on the dev board)
    • Up to 3A 5V output (1A on a Type A USB connector, 2A on the USB-C connector)
    • Soft power control with low-battery shutdown
    • Battery level readout
    • Built-in LED illuminator

    For this project I was able to supply over 99% of the parts.

    Parts List

    1. Maxim MAX77751 dev board.  This is a 3A charger with the ability to also generate 5V @ 2A on the same path it uses for input so a USB-C connector could both source and sink power.  I can't even remember why I had this board.
    2. My own Battery Buddy board.  This harkens back to 2013 and was an early attempt at a Li-Ion battery device.  It is essentially a boost converter with a low-power PIC micro-controller providing power control, battery level monitoring and low-battery cut-off.
    3. A 3-cell 3.7V 6600 mA Li-Ion battery (I think originally from Adafruit).
    4. A Sparkfun USB Type A breakout board
    5. A bunch of small warm-white LEDs, 0805 sized 110 ohm resistors, a switch, misc perf board, wires, screws, etc.

    The Battery Buddy board provides power for the Type A USB connector and the same enable that is connected to its boost converter chip also enables the MAX77751 boost circuit.  It also provides power button, battery level LEDs and low-battery cut-off functionality.

    The MAX77751 is high-current charger for a single-cell Li-Ion/Lipo battery designed for USB-C connections.  The thing that I found interesting about it is that it has a boost converter and can also back-drive the USB C charge input.  It's also smart enough to know not to enable the boost if it is currently charging.  That lets my BBB drive 5V out of the Type A connector and light the LEDs when it's charging if I want too.

    Assembly

    The hardest part of this project was removing all the test connectors from the MAX eval board since that thing has a lot of ground planes!  I had to use a big iron.  Then the Battery Buddy and USB breakout were simply double-sticky tape mounted to it and wired up.  The Battery Buddy takes power from the MAX SYS output.

    I wired short and heavy gauge wire between the battery pack protection PCB and the MAX board since the currents could be over 3A (I also tested the battery to make sure it could supply more than 3A).

    D- is shorted to D+ on the Type A USB to signal the typical "dumb" charger to anything plugged in.

    The LED board was fairly easy to wire together using a piece of a perf board.  The LEDs are wired in parallel, each with its own series current limiting resistor (~16-18 mA/LED) and powered from the Battery Buddy 5V output.   Somehow I damaged one LED so I ended up with a total of 9 at the end.

    The most time was spent in OpenSCAD designing the case (and with calipers measuring).  The source is attached and generates eight different sub-assemblies.  Five of them I could print on my own printer but three of them were printed by a friend who also has transparent PLA.   I count those pieces as something that had to come from elsewhere.

    The case halves are screwed together with the endplates sitting in slots.  The LED diffusers are glued in place and the slide switch cover just rides...

    Read more »

  • Home Network DC UPS

    Dan Julio08/17/2023 at 18:37 0 comments

    Like many people I had a traditional AC-DC UPS supplying power to my home network.  One day I awoke it it beeping away and running on battery power even though the mains power was present.  And then it died.  So I did what any maker might do, I optimized the repair by replacing it entirely with my own DC-DC UPS powering an Arris Cable Modem, Routerboard GigE Router/Firewall, Ethernet Hub and a Wifi Access Point.

    (Don't worry - this ugly mess is in my lab where normal people never venture)

    This project - now over a year old - is what led me to contemplate the "Use It UP!"  campaign.

    I was able to supply 100% of the parts from my own stash.

    1. Custom Solar MPPT Charger
    2. Dell 19V 3A Laptop power supply + 1000 uF electrolytic capacitor
    3. 12V 18 Ah Lead Acid battery
    4. PJRC Teensy-LC controller
    5. Adafruit 96x96 pixel Sharp Memory LCD breakout board
    6. MPT3055 N-Channel MOSFET
    7. Meanwell 15W Boost-Buck DC-DC converter with 12 VDC output
    8. Linear Tech LT3053 Buck DC-DC converter eval board with 3.3 VDC output
    9. Plastic Project Box, various wire and cables, protoboards, jacks, connectors and hardware

    The Solar MPPT charger is a device that I designed for a client to power wildlife cameras in Asia and Africa.  It has a Silicon Labs micro to implement the charge controller and a Laird smart LoRaWAN to remote control and status access.

    Normally the LoRaWAN module accesses the charge controller via an I2C interface but I had a board with no LoRAWAN module.  This lead me to the idea of adding a status display using the Teensy-LC and Sharp Memory LCD.  A quick Arduino sketch let the Teensy read out various parameters and format them for the display.

    (In reality I rarely look at it, but it has been useful - and shows the efficiency of a DC-DC UPS)

    The laptop supply output voltage is just about the perfect solar panel voltage for a 12V system and the charger simply locks on to its output voltage as the MPPT setpoint.  I did have to add some bulk capacitance (1000 uF) at the charger input in order for it not to crowbar when the charger starts up and has a big inrush.

    A total of four DC voltages are provided to the networking devices.

    1. Regulated 12 VDC for the Arris Cable Modem using a Meanwell DC-DC converter.
    2. Unregulated battery voltage for the Routerboard Router (it has a very wide input range).
    3. Regulated 3.3 VDC for the Ethernet Hub using an LTC Eval board (replacing it's original AD-DC supply).
    4. Regulated 5 VDC for my lab's local Wifi Access Point using the charger's built in DC-DC covnerter.

    The charger is capable of low-battery shut down so I kludged a wire from DC-DC enable signal coming off of its charge controller to the gate input of a beefy N-Channel MOSFET.  This allows a low-side power switch for the remaining DC supplies.

    (Guts of the UPS)

    (Teensy-LCD and Sharp Breakout)

    (LTC Eval board powering Ethernet switch)

    Coda

    I initially worried about the LTC board powering the Ethernet Switch since it can take a bit of power but the whole setup has been very reliable.  It's capable of keeping my network alive for most of a day. 

    Sadly the same can't be said for the internet service itself, provided by Comcast (Xfinity).  Since I live outside of my city there is at least one battery-backed up box between me and their main plant.  It seems to have only enough power for about an hour of runtime when the power goes out.

    Shameless Plug

    In 2019 I made another smart Solar MPPT charger designed for the maker market.  You can buy it on tindie.  It can be the basis of a DC-DC UPS as well.  Which is where the idea for this UPS came from.