Delayed delay…

Was going to post something else today, but as I managed to finish something that includes software (which happens very rarely) I had to show that instead 🙂

It’s a small delay-circuit, useable for amplifier muting etc. via external relays. Nothing new in that as such, but unlike many other such circuits this one is based around an Arduino-enabled ATTiny85 microcontroller. This means that in addition to basic mute-on-startup functonality there’s room for expansion as well, including connecting external sensors etc. to the board.

The (laughably) basic Arduino sketch that I have just made to do mute-on-startup and read a manual mute-switch for control is less than 1kB in size, so even with just 8kB of memory on the ATTiny there’s still quite a bit of room to add software-based features to suit any particular application.

In terms of hardware, the board includes FETs for driving the relays, a separate indicator LED attached to one if the pins on the ATTiny and also a 5V power supply. The board is wired so that the relays are driven from the raw input voltage with the FETs acting as level shifters. In the standard configuration there is two I/O-pins left for control purposes, but with a bit of hacking it’s easily possible to repurpose either the LED connection or one of the relay driver pins if required.

I have a few other ATTiny85-based projects where I have done the hardware ages ago, but now with a (modest) success under my belt I feel much more inclined to start developing software for those as well 😀


Building an Electronic Load

One of the tools that I sometimes need but haven’t bought yet is an electronic load for testing circuits such as power supplies. Of course you can make do with fixed resistors (and I have so far), but you practically never have the right value/wattage to hand when you need to test something (in my case, usually on a Sunday afternoon…grr!).

The solution is a programmable electronic load, or basically an adjustable current sink (or a “reverse power supply” as some people call it) that can simulate the load from any fixed resistor within reason. I haven’t bought one of these yet, partly because I didn’t feel I needed it enough to justify the expense, and partly because I am rapidly running out of space to store instruments that are only used occasionally.

Some weeks ago I started toying with the idea of building one myself to at least get started. I’d seen some nice designs on Tindie, but wanted something that was capable of higher power and something which I could more easily tweak for myself. A bit of googling turned up a few promising pages, most notably this one on Kerry Wong’s (excellent) blog.

I liked Kerry’s design as a starting point, mostly because it is relatively well documented and the control code is Arduino (which I can work with). I therefore started revising the circuit to suit my needs and laying out a PCB for it as well.

Key changes from the original:

  • I’ve scaled it down from three pairs of MOS-FETs to two because that is what I could fit on the Eagle board (being constrained by the freeware version).
  • I’ve replaced the parallel LCD connections with I2C to simplify the PCB layout and free up Arduino pins.
  • I’ve mounted the controller (an Arduino Nano v3) onboard. That wasn’t the original plan, but the space was there so why not?
  • I’ve broken out a pair of analogue Arduino pins, a pair of digital Arduino pins plus a second I2C-connection that can be used for other purposes. Top of the list for me would be a real-time clock (RTC) module for data logging purposes and some sort of thermal sensing and fan control, but I am sure there are many other potential uses (web-interface anyone? 😀 ).
  • plus a bunch of other minor tweaks 🙂

This is still work in progress, but I have received the prototype boards in hand and I have started the assembly as you can see from the pictures. Still to do:

  • Do the mechanical work on the heat sink (in progress)
  • Rewrite the software to work with the I2C-display (also in progress, but might take me a while)
  • Test whether the damn thing works! 🙂

EDIT 13th March 2016: The schematic for my v1.0 PCB can be found here. There are at least two know issues that need to be corrected. 1) The “sense” pin (A3) is connected directly to the output but should actually have space for a voltage divider. 2) The spare opamp (IC1B) should have pin 6 and 7 connected together and pin 5 connected to AGND.

Tiny teaser…

Just a short “teaser” for one of my work-in-progress ideas, a (sort of) universal audio controller based on the ATtiny85 microcontroller (hence the slightly saucy headline…) and the Arduino IDE. It’s not ready yet, but some progress has been made.

The idea was to make something much smaller than the Ampduino and then make a few versions for different purposes. So far the “pipeline” consists of the following:

  • Universal motorpot controller, partly inspired by the controller I did for the Ampduino project.
  • Universal model with all pins broken out, to be used as the “brain” of a preamp or also (in the longer term) to control soft start circuits, clipping indicators, speaker protection circuits etc.
  • RX/TX version for remote control, although the RX-version may end up being something bigger based on a “full-on” ATmega328P like the Ampduino (and the normal Arduino boards).
  • Matching linear PSU if there is no other power supply required for a given circuit (or if a suitable aux-voltage isn’t available).

Current status is that I have hardware prototypes for most of these already (only the Rx remote receiver is missing) but as usual when there’s software involved that takes a bit longer for me to get around to and so I haven’t really tested anything yet. I have bought a couple of development boards for the ATtiny which seem to work well for testing and optimising code (which will be a definite requirement with the ATtiny-chips as they have fewer I/O pins and less memory than the ATmega-series) but I still need to get started on coding in earnest.

As usual there is no real timeframe for finishing these boards, but right now the Scandinavian summer is definitely working in my favour by nearly constantly bringing weather that makes you want to sit inside and code instead of being out and about 😀


More Ampduino testing…

I am still making more tests with the prototype Ampduino board and everything still seems to be working OK. The only problem seems to be persistent issues either with the FTDI-drivers or the Nano board I am using – I have a couple of more Nanos on order though, hopefully that will help. Now, when I ordered the boards I ordered a few “extras” as well 😀

The first is a motor driver board based on the L293DD H-bridge driver. This (and the circuit) is nothing out of the ordinary – it is basically lifted straight from AMB’s implementation on the LCDuino-board, including the option for sensing the position of the pot using an analog input pin. What is a little out of the ordinary is that I made the board very small and included pads so it can be mounted directly to the back of an Alps motorised potentiometer. This seems to work well so far – the attached picture shows the board mounted to an Alps RK16816 for testing purposes.

The second extra is an I2C isolator board based on the Analog Devices ADuM1250. This chip can do isolation of an I2C-line and it supports both bidirectional communication and level-shifting (by means of different supply voltages for the two sides of the isolator). The board is tiny and can either be used inline or installed permanently on the Ampduino using an angled header that is soldered to the board. I haven’t put this together yet because I don’t really have an application for it until I start controlling DACs via I2C, but it looks very useful so thanks to Zwack at head-fi for the suggestion 🙂

Basically this means I now have the display functioning, an IR-receiver connected and working and the basic motor driver working – not bad I think 🙂 Further expansion of the Ampduino is also in the cards as I have a PGA2310-based volume control board in the works. Prototypes have been ordered and hopefully in a couple of weeks or so I can test that and see if the Ampduino can do SPI as well 😀

Ampduinos in the wild…

Now the AmpDuino project is starting to take shape 😀

I received the prototype boards yesterday and quickly assembled one to try it out. So far it has only been a very basic test with an I2C display and an IR-reoeiver and both seem to work without issues.

There are a couple of minor cosmetic issues with the boards and some of the connector placements might cause some problems later on (note the angled header for the SPI port – a straight one with a cable would probably block the USB port 😦 ) but so far it seems to be minor niggles only.

Programming-wise it also seems to be working well, apart from some annoying issues with the drivers for the FTDI USB-serial chip on my mac – they don’t seem to want to stay installed and working…

Next up is to do more testing on the AmpDuino itself and a few “bonus” boards I ordered as well, plus of course start building on the code base for the AmpDuino – stay tuned! 😀

The “AmpDuino” project

Since I finally realised that even I could probably benefit from incorporating a little bit of software in my otherwise purely hardware-based projects, I have been toying with the idea of building a more generic controller that could be used for many different audio projects. Obviously this is very much inspired by the LCDuino, the HiFiDuino and other similar projects, but I have tried to give it my own flavour anyway 🙂

The AmpDuino is a dedicated shield for an Arduino Nano v3 board. It incorporates most of the connections that would be necessary for audio-based projects while hopefully being expandable enough to be used for other things as well. The standard “breakouts” available are:

– Two I2C connections (display and one spare)
– Dedicated port for rotary encoder w/ push button.
– Two “trigger” outputs designed to be isolated via a PC827 optocoupler (which is of course optional)
– Three “general purpose” digital inputs/outputs (for IR receiver, IR transmitter or similar)
– Dedicated ports for interfacing with a motor driver for volume pots and sensing the position of the pot (shamelessly copied from the LCDuino…)
– SPI port for controlling DACs or PGA23xx type devices
– Power LED (if there is no Arduino mounted to indicate power)
– Reset terminal broken out to connector (although the Nano onboard RST can be used as well)
– 5VDC input with a another smaller connector that can be used for output.

The board measures 1.95″x2.3″ and is two layers.

I wanted this to be as compact as possible, but I have also deliberately based this on the Arduino nano instead of just the microcontroller on its own. The Nano boards are very cheap and having a “complete” Arduino available should make tinkering and tweaking much easier than having to mess with in-circuit programming etc. (ok, this may just be my irrational fears at play here ;)) I have also deliberately moved away from the LCDuino form factor, because a “normal” board can be positioned in many different enclosures. Using I2C for the display driver gives more options than just a standard 16×2 LCD. The I2C display connection also makes it possible to get rid of the LCduino’s port expander and still have enough digital pins for most applications (I think).

Discarded ideas:
– Onboard PSU (not really enough space, probably easier to add an external regulator depending what voltages are available already and how much current is needed)
– Dedicated port for IR sensor (could be done, but he current D1-D3 ports are more usable and will allow other usages as well (real-time clock etc.))
– Onboard components for the IR receiver. Could be done, but would mean the sensor would have to be mounted closer to the board, so probably easier done with an expansion module which has the sensor and the external components on the same board.
– Onboard SSR for power connections: Could be done (with something like a Sharp S202), but again it is more versatile if kept offboard.
– Onboard motor driver for volume pots: Not really enough space and would not always be needed. Instead, I have retained the basic connections and I am working on a dedicated board that can be soldered straight to the terminals of the motor on Alps pots (or at least that’s the plan)
– Real time clock: This is obviously a very nifty feature in the LCDuino, but I can’t see myself using it in many applications.
– Input selection: This is a tricky one, but initially I’ll keep it offboard. Anyway, for relay-based selection you can always “cheat” and send pulses to a 4017 instead. (hmm, probably should make a breakout board for this one…)

Any comments/suggestions? Is this a lousy idea? 😀

I am going to get some comments from people (diyaudio thread here) and then make the final tweaks to the board layout before sending them off for manufacture.

Photoduino (or not…)

After I started playing with the Arduino, it wasn’t long before I had a flash of inspiration. Why not use the Arduino to control my Canon 650D DSLR camera and then be able to auto-fire it based on inputs from sensors for sound, light, pressure etc. Since I wasn’t near an internet connection at the time I started drawing block diagrams on paper and even managed to come up with a snazzy name for the thing – Photoduino. Once I got home and back online, it took me around 20 seconds to find out that such a device – including the snazzy name – already exists 🙂

Block diagram of my camera controller idea (redrawn from the scrap piece paper it was originally on 😉 ).

Oh well, great inventors aren’t discouraged by minor setbacks like this and so I am going to persevere and make a better version of the same concept (or at least one I think is better). The basic camera control for a Canon DSLR like mine is exceedingly simple. It’s just a 3-pin interface for ground, focus and shutter where shorting one of the pins to ground will trigger the function – try it with a cable and a crocodile clip if you want 🙂

Trigger pinout for Canon DSLR

I do have some basic thoughts and requirements for what I think this thing should be able to do.

Hardware features:

  • Standalone unit for inside and (protected) outside operation (surveillance, wildlife shots, timelapses etc.).
  • Same board size as a 20×4 character LCD (so app. 10*6 cm) so they can be bolted together.
  • IR remote control for at least basic functions.
  • Support for internal and external power sources.
  • Support for as many different sensors as possible with external connections.
  • Outputs for controlling lights, flashes etc. as well.

Software features

  • Basic operation as sensor controlled trigger, remote controlled trigger, intervalometer and self timer.
  • Shot counter when running as an intervalometer.
  • Variable delay (positive/negative) for outputs to sync lights etc. with the camera.
  • Dimmable/defeatable display.
  • and a few other things that I will be able to add as the project (and my programming skills) evolve…

So, lots of things to get started on here – obviously I just need to come up with a new name first…


Enter the Arduino…

I have spent a lot of time since I was a teenager tinkering with audio and electronics, but somehow micro controllers and programming has never really caught my imagination. However, the world is going software and so it was probably inevitable that even I caught up eventually.

A while ago I stumbled across the excellent hifiduino blog ( via diyaudio and saw how the Arduino board could be used to control a DAC. Since I was looking for a DAC project of this type and quality, I dove further into the posts and started reading more about the Arduino. After a while of checking code samples and downloading the Arduino IDE it dawned on me that even I could probably manage this, and that it would be possible to make many of the features I wanted in my projects quite easily this way.

So, on to ebay to buy a board and some accessories and then start coding my first project – a remote-controlled LED! Ehm, not really of course, but since a big part of what I want to do is to be able to remote control things, first test was to lift hifiduino’s code for the Apple remote and see if I could get to work controlling an LED. It’s working fine, so now I need to start investigating what exactly to use it for.


Arduino-controlled LED 😉