Not so much a circuit I build this week, but rather a commercially bought circuit/shield that I thought I'd have a crack at repairing. I ordered some 18650 battery chargers which also double as a power supply (claimed 3V-1A and 5V-2A output). Everything looked wonderful until I didn't read the many warnings on both the board and the website and stuck an 18650 battery into the holder with the wrong polarity. ZAP!! Burnt finger for me, and magic smoke production for the charger.
Always read the fine print
I suppose a normal person would throw the whole thing in the bin and look for a commercial replacement at many times the cost. But after taking a closer look at the broken board I thought that only one component looked completely spooked by the experience - a little 8-pin TSSOP package sitting on the edge of the board. I couldn't tell what the label was through the charred remains, but in an un-fried version of the same board it seemed to be a FS8205A Mosfet Battery Protection IC. The cost of a new charger/power supply is around AUD 3.81, and cost of 10pcs FS8205A is around AUD 0.77, so no problem - order and wait. When the chips arrived, it was simply a matter of de-soldering the fried chip using a hot air gun, and then plonking on the replacement and re-soldering. I do enjoy the SMD soldering and if you are a little wary of it then order one of the many practise kits available and have a go - it's not that difficult. A pair of comically large enlargement glasses can help as well.
Normal operation
Fried guy
De-soldered old chip with keen replacements in the background
Re-soldered and ready for action
The end result is a working charger and power supply, and a glow of satisfaction for it's owner. Nice one.
Postscript: the "un-fried" charger went "fttt!" as well with the same component at fault, and this time I didn't put the battery in the wrong way, so obviously a bad batch of mosfets and probably the reason for offloading stock cheaply to unsuspecting Tasmanians half a world away. Anyway, a desoldering and resoldering session ensued and now I have two perfectly fine chargers/power supplies!
So the lovely 555 based square wave signal generator PCB arrived from JLCPCB. The story so far:
Dream up a suitable project to illustrate how easy it is to make a PCB, this one based on the 555 timer which can output a square wave signal of variable frequency
Use online software to connect all components in the circuit in preparation for ordering and manufacturing
Layout PCB design and order the PCB, then wait by the postbox for a couple of weeks
So now the only thing left to do is to assemble and test the PCB. Note that I used the TLC555 version of the 555 timer which is CMOS based and not only uses a lower voltage, but also requires very little current in operation. The TLC555 can also output a much higher frequency than the bog standard NE555 - 2MHz vs 500kHz. There are other versions of the 555 around as well - nice chip!
Some voltage regulators are known for their inefficiency, and some for their stability. The HT78XX series of regulators are touted as:
... a series of positive, linear regulators feature low quiescent current (5uA typ.) with low dropout voltage, making them ideal for battery applications. The devices are capable of supplying 500mA of output current continuously. They are available with several fixed output voltages ranging from 1.8V to 5.0V. Although designed primarily as fixed voltage regulators, these devices can be used with external components to obtain variable voltages and currents. These rugged devices have Thermal Shutdown and Current Limiting to prevent device failure under the "worst" of operating conditions.
I wondered if "500mA of output current continuously" is true, and also what are "worst" conditions and can I replicate that? Firstly though, what do you do with SOT-89 packages if you want to test a component on a breadboard in a circuit? I found a few options in the buckets including a legit SOT-89 to DIP adapter, a SOIC-8 to DIP-8 adapter and finally a standard two sided blank prototyping PCB.
These little blighters aren't cheap, and one thing spotted AFTER ordering (¯\_(ツ)_/¯) is that they have a max input voltage of 8V - not much compared to say the LM78XX which is happy with a 35V input. Anyway the "fun part" for me is the soldering so away to the bench.
Clipped prior to soldering
On the way to making the adapter
The DIP-8 version having headers added
The frankenstein version on a bog standard PCB
So now that we have the soldered versions ready to test - let's try a few variations on a theme, using the suggested "basic circuit" from the datasheet with a load of a resistor and 3W LED.
The last thing to try is maybe use this little linear regulator instead of a zener diode in the QX5252 circuit.
So you can see from the above that at 1V input to the joule thief, I replaced the 5.1V Zener with the HT7805 and it works! Not only for an LED, but wafting the ergs out to an Attiny13 with a blinky sketch also worked fine - now that could be very interesting for the future - watch this space.
Take two on this chip as those in the bucket originally were FAKE! So I got my money back from AliExpress and re-ordered. The wait was worth it because they turned up a few weeks later and actually worked as advertised - nice. There was only one unanticipated problem - the outputs from the CD4026 chip are "1" for "HIGH" which turns on each segment from a common cathode 7-segment display, but sadly if you only happen to have common anode 7-segment displays in the parts bucket then the result takes a little interpretation.
Red = what is lit, Green = what should be lit!
I have ordered some common cathode displays to make better (easier) use of the chip, but in the meantime I looked for a solution - is it possible to turn all "1" signals to "0" and vice-versa? Well, yes! You just need an IC that has multiple NOT gates - for instance a CD4069 Hex Inverter as per last week's blog would be perfect, just add one transistor based NOT gate to complete the seven required inverters and hey presto we have a display that works on "1"s and not "0"s.
In "real life" the result is as shown in the video below.
Eagle-eyed viewers will spot a lone resistor going from the transistor not gate to segment D. There's a case to be made for resistors on all outputs as seen in many circuits shown online. I just threw one in here as the single segment output from the transistor not gate was showing up brighter on the display and it became a little distracting. A 220Ω resistor cured the imbalance and the resultant overall display was more evenly lit.
What to do when your signal comes out reversed from what you need? If it is only one problem signal, then you could whip up a transistor-based solution as per this useful website. If you need seven signals inverted because of an ordering mishap, then a hex inverter (plus a single transistor solution) might be a better approach. An inverter is a common logic gate (NOT gate) which has the following symbol and truth table.
If you clump a few NOT gates together in a logic chip - you get a CD4069 hex inverter (see screenshot from the datasheet below). So a "1" or "HIGH" sent to pin 1 (A) returns a "0" or "LOW" on pin 2 (G=Ā), and vice versa.
Fortunately in the many buckets of bits I have a few CD4069UBE chips lying around looking for a purpose. The pinout is very straight forward, but before I use the whole chip to reverse a bunch of signals (next blog), I will test it on a very simple circuit - involving of course a blinking LED.
The 555 is not really disembodied out to the side, but it is just shown here providing a clock signal which is a "1, 0" square wave at a particular frequency. And to show that all of the inputs/outputs are ready for quality inverting, I've plugged all six in plus an extra transistor NOT gate - but why seven? Well, next time I'll look at "fixing" a seven segment display gone slight awry.
Now that the 555 signal generator circuit has been designed and tested, the next step is to arrange all of the components on a PCB and hit the manufacture button (oh, and pay!). There are heaps of options but there are just two important ones for me that I'll mention - a copper ground layer (which I always add to my PCBs now that I know how to do it) and panelising the design to maximise the number of PCBs for the price paid. I like to use a local autorouter, but hard core designers will lay down all the tracks as well - more power to them. My early efforts at manual routing took a lot of time, and although it was a good learning exercise I now just go straight to the autorouter running locally. Fast and accurate! Try not to stress too much about the design as I don't think I've yet ordered a PCB that I've been entirely happy with - there will always be a detail or two that you don't like and will need to change. Some of my PCBs are on their fifth or sixth iteration and I'm still unhappy! Keep experimenting with the design and take a few days and a few revisits before you hit the "order" button. I laid out this circuit on a board four times then had it manufactured, noting when it arrived that the connection between pin 6 and the potentiometer had not been made! I can still use the boards (after a quick solder), but this video is about version 5 which I hope has everything ironed out. Here is a quick video of the 555 signal generator (V5) being laid out.
If you want to make/modify this project, you will find all of the files zipped up and available through this link. When the PCBs arrive I will solder up the resulting PCB and run it through it's paces.
Once the prototyping and testing for the 555 timer based signal generator is complete, it is time to choose the preferred software to design the PCB and output Gerber files for manufacturing. I've tried a few different options including KiCad and Eagle PCB, but have gone back repeatedly to EasyEDA which works for me. I have made a lot of mistakes on this software - but after a few trials it is a pretty simple interface to use. There are some great video tutorials online so I am not going to do a step by step build of the circuit. If you really need that support, try the following:
For this post, I'm just going to show the EasyEDA interface with the components which are required for the 555 signal generator as discussed in "Your own PCB (part II)".
Next time I'll build the PCB online then after checking I'll submit it for manufacturing.