21 November 2016


My partner saw a neat tutorial on how to make a simple cellphone powered LED light, basically it uses a DC-DC converter to step the μUSB port voltage from 5V to ~3.7V. The problem I saw with the simple design was that there was absolutely no current limiting or over-voltage protection on the phone μUSB port, this can be a bit of a worry if your phone was designed without them in mind. So another idea was born, make a similar device that offered these safety features.

Component Selection

Having a look through DigiKey I found this neat little IC, the PAM2863ECR, which fit the description perfectly and even had the ability to control the current flowing though the LED (thus adjusting it's brightness). For circuit protection I added a 5.6V zener diode (MMSZ5232B-7-F) on the μUSB power line followed by a 0.5Atrip resettable fuse (MF-PSMF020X-2). Finally for the light source I went with the TL1F1-NW1,L(S which was a cheap yet powerful LED I managed to find on Element14.

Circuit Design

Next up I drew up a schematic in Altium and started the PCB design. One thing to note is that the LED and IC both have power losses with the LED being so significant that sufficient cooling (usually in the form of big copper planes) is required for the LED not to cook itself. As an experiment I decided to completely ignore these and see if I can get away with a tiny board (man I must have some sort of fetish for small PCB's...), here is that the board was going to look like:
And here is how it actually came out to be, minus the μUSB connector:

Lessons Learned

Surprise surprise the device did not function as expected here is why:
  • You guessed it the tiny PCB did not have adequate heat sinking capability, this caused the LED & IC to heat up to ~150°C, a fair bit over their rating... One interesting this I did get to witness was the LED slowly failing, you could see the current being constant but the brightness slowly fading away.
  • Something else I should have expected was the voltage drop across the resettable fuse. This reduced the IC input voltage from 5V to ~4.5V, and since it's minimum voltage is 4.5V it did not behave as designed. Removing the resettable fuse solved the problem, until the whole thing got hot again...
All in all i r8 an 8 outta 8, good reminder on the things to look out for when designing a circuit like this. 

17 November 2016

PROJECT: EMG Amplifier, Update #1

Sometime around mid this year I decided to make an Electromyography (EMG) amplifier circuit. This idea came alive because I like the though of human augmentation, and making something along these lines would be super neat.


So I set out on my journey of learning, reading many Masters/PhD papers to try and see what exactly makes an EMG signal and how to successfully amplify/capture it. From this I found:
  • The easiest way to capture an EMG signal is by using an Instrumentation Amplifier (IA), this is because unlike normal amplifiers these have a super high input impedance which does not collapse the waveform.
  • Another neat thing about IA's is that they have a high Common Mode Rejection Ratio (CMMR), this means that any unwanted signal present on both inputs (such as the annoying 50Hz hum) will get automatically attenuated/"removed".
  • One way which you can further process the signal is by using an active filter, this allows you to filter out any frequencies that you are not interested in. For example the range I was interested in was 50Hz ➝ 200Hz.


With that knowledge in hand I then designed the active filter circuit with the help of the electrical engineering bible (The Art of Electronics), and simulated the circuit in LTSpice:


After a few more iterations and additions I then decided to jump the gun and design an actual PCB:
Board all laid out and ready for OSH Park.

Breadboarding, what I should have done at the start...

My Band Pass Filter almost working as expected :D


Though this was the densest board I have made to date (2-layer 50mm x 30mm) rushing and making the board without first prototyping the circuit turned out to be a big mistake, as I learned:
  • Trying to assemble a board full of tiny components is tedious, especially if you don't have a solder paste stencil. 
  • Not all components are designed equal and some can withstand heat better than others, this is what happened to the heart of the circuit as all amplifiers were cooked to death ; - ; luckily I had a few boards and components to spare.
  • Trying to debug a busy board like this is not fun. In the future I should either make it on breadboard first, or add lots of jumpers to be able to bring sections in/out, plus lots of accessible test-points would not hurt as well.
  • Experimenting too soon can really mess things up. My downfall was that I decided to try and use two SIM card contacts as the EMG contact, when instead I should have started off with something that I knew would work (like this). Again this made debugging harder as I did not know if it was the circuit or contacts at fault.
  • As I mentioned earlier your IA needs to have a high input impedance, using the INA827 instrumentation amplifier was not good enough. Something like the INA826 (yeah I'm cheap) would have been better, 
  • If you do decide to power your circuit from a single rail (as in Vcc to GND not Vcc to Vss) make sure your amplifiers are designed for it. With my circuit I initially went with TL974 when I should have gone with something like MCP6004.
  • An addition to above, make sure that any active elements are also designed to work from a single rail. For my circuit the active full-wave rectifier was designed to work from a dual rail supply...
So now the project is on hold as other things have taken over, but I do look forward to coming back and getting this thing finally working :D