Current Flow

Endeavours into the world of programming and electronics


MintyVCAtt - Altoids Tin VCA

For the last couple of months I’ve been pretty hooked into audio projects, specially music creation related. This was the first quick project I’ve built to hopefully end up with a semi-modular synthesizer in a very distant future. The main idea is to basically build a bunch of the simple building blocks of a modular synth in the worst way possible, using Altoids tins and project boxes instead of a rack, which will make patching a real nightmare, but I’m sure will look even messier than a rack modular synth.

The final project

The project turned up rather well, it was designed to be extremely simple and easy to build, and had to fit inside the tin with the 9V battery and the connectors, this lead to some restrictions in the size of the circuit (compromises).

Schematic

As you can clearly see the circuit is extremely simple, but gets the job done quite well. I’ve used the simplest method of voltage controlled attenuation, the LED coupled with a LDR, this gives it very low distortion, but a very slow attack speed compared to other designs. The circuit accepts a 0-3V CV signal which controls the current thought the LED, so more CV means the input signal will be attenuated!

You can also notice something weird in the CV input jack, that’s a very handy trick to incorporate a power switch into a project, I learned this method from DIY stompboxes around the internet. The idea is that you connect your power negative to the ring (right channel) of a stereo jack, so that when you connect a mono plug into the socket, the ring and sleeve will be shorted out, connecting your power negative to your circuit’s ground.

Close-up of the circuit

The circuit is pretty simple and was made as a quick hack to do some audio experiments, but feel free to play around with it, and feedback is always welcome!


Flower Pot Night Light

A couple of months back (April if I recall) I was bored and looking for a nice project to kill some time in a rainy saturday. I decided to build a nice night light for my bedroom. I had a set of restrictions put in place so that I would be pleased with the final result, these were:

  • Must run on AAs
  • Adjustable intensity
  • Small and cute
  • Should be built entirely with parts that I had on hand

In use

The first challenge was to find a nice enclosure, since this was going to be used as decoration it couldn’t just be a bare protoboard with some LEDs or a boring project box. While looking through the pile of stuff (most people would call trash) I had stored in various places around the house, I found a couple of cubic flower pots made in various materials. I thought the ceramic one would fit my bedroom quite well, so that part was done.

Sanding the case

The next thing would be to find a diffuser to cover the LEDs and and give a more uniform light. My first idea was to use acrylic or something like that, but sadly I didn’t have any on hand so I had to improvise. Again I went looking through my stuff and found an empty Ferrero Rocher enclosure (I knew I would use it some day), all I had to do was sand and cut it so it would fit the flower pot.

The finalized board

The last and most boring part was to solder all the LEDs, they are in a series parallel arrangement, with 9 parallel groups of 2 in series so that I could use a 9V supply. For driving them I decided to build a simple constant current sink with the two NPN transistors in a feedback configuration and designed it in such a way that it would be adjustable up to 100mA.

If you want to see more pictures of the whole process they are all available in this album:


Incredible Chinese USB Car Power Supply

Recently I bought a couple of those super ultra cheap cigarette plug extensions to distribute 12V in the lab for various things. As usual with everything chinese, I decided to open it up to see how horrible it was inside, but I also did that to upgrade the wiring since I would be pulling a couple of amps from this and I want to minimize the voltage drop.

The thing

This is the incredible thing I found inside the thing as the 5V supply for the USB socket. A 7805 regulator and a 20 ohm 1/4W resistor in series with the 5V output. I guess it could have been worse, they could have used a 5.2V zener or the worst of all just a resistor voltage divider.

China never ceases to amaze me.


MintyUSBoost: A tiny boost converter for low power projects

The MintyUSBoost in its fitting enclosure

First of all a bit of a back story: This is my first attempt at a DC-DC converter, I’ve always thought they were magic black-boxes that you just had to accept and building one yourself without a dedicated chip was something extremely difficult, something that could only be done with some high-speed complex analog circuitry or high-speed microcontrollers. I think a lot of people think the same way and I decided to try out my luck and it worked fine, switchmode converters are not black magic (now only RF is black magic), and I hope I dismistify them for you too in this article.

The idea for this project came because I built a nice portable Class-A headphone amplifier (blog post coming in the future) and I wanted a simple power supply for it when I was using it with my computer, so I had to step the 5V from the USB to the 9V required by the amplifier circuit, the amplifier even though it’s Class-A has a low current consumption, so the 2.5W from a normal USB was more than enough. Taking into consideration all this I needed a boost converter with the following specs:

  • 5V input at 450mA maximum to work with any USB port
  • 9V output able to source up to 110mA (more than enough for my amp)
  • Acceptable voltage ripple and noise since this will be used with pre-amps and the headphone amp

Schematic of Rev A

As you can see there’s not a lot happening, and that’s the beauty of this design, since it was made for low power projects it doesn’t require any of the complexities, it was designed to be minimalistic and easy to build for someone that is new to switchmode converters. The entire feedback control loop is contained inside the PIC12F683 microcontroller, it is a pretty tiny and under-powered micro, but as you will see it works perfectly for this task.

First the power input goes through a 3.3V regulator which provides power to the PIC and also acts as a voltage reference, then the microcontroller takes control of things and starts the PWM, pulsing current through the main inductor L1 while sensing the output voltage, if the voltage is lower than the set voltage it increases the PWM duty cycle, if the voltage is higher than the set voltage it decreases the PWM duty cycle, and that’s all you need to create a simple switchmode converter. Here’s the code that runs the whole thing (I still need to improve it, so changes are coming):

If you’re a bit more experienced with DC-DC converters you’ll notice that the components used are a bit overkill, but that’s by design because I wanted very low ripple at the output, also in the topic of components, I selected a IRL520 MOSFET and this is very important, since I’m driving the gate with very low voltages a logic-level MOSFET is a must, if you want to use a regular MOSFET you’ll have to increase the gate voltage using a technique shown here.

A very handy tool for everyone designing their own DC-DC converters is Adafruit’s DIY DC-DC Boost Calculator, it was extremely useful to choose the components used in this project and it’ll surely help you in yours too. I’ve also written a R script to have a offline version of the calculator, it’ll be improved in the future, but it’s usable right now.

The only issue that I’m having with this project so far is the fact that no matter what I try, I can’t get the crystal to oscillate, I checked everything, set all the registers correctly and I still can’t get it to work, if anyone wants to help it’ll be greatly appreciated.

Noise Figures

Since all my designs have a lot of local decoupling to keep any noise or ripple from the power source away from sensitive parts I didn’t care too much about having extremely low ripple/noise, but if you want to upgrade this you can add a small shunt regulator to really kill any ripple or just add a LC filter to the output.

If you’ve got any questions feel free to ask and I’m open to suggestions for improvement.