Switched on?

Another project that’s been on hold for a very long time because I did not really need to finish it….

It’s a balanced two-in/two-out passive switch box which I intend to use partly to add an additional input to a spare amp, and partly to build a more comprehensive test setup for comparisons of sources and amps.

The signal switching is done via relays (see here for original post – oh how time flies!) and the power supply for the relays is an IRM power supply module as showed a few weeks ago. Switching of relays is done with latching button switches that I still need to wire up once the front panel is drilled and that’s about it really 😀

The relays are transistor controlled and 5V types, so while it is simple for now there is plenty of scope for adding functionality via an Arduino/ATtiny-based controller of some sort. The most obvious feature would be an IR remote control, but another thing I was originally thinking would be to add ABX-logic to try some blind testing. I sort of gave up on figuring that out, but if anyone knows how to build this in Arduino code give me a shout 🙂

More ATtiny experiments…

Since I managed to breathe life into my ATtiny-based speaker delay project I’ve been working on more ATtiny-based boards. There are many potential applications I can see (if I look hard enough…) for a small SW-based controller and that is what I’ve tried to build. The hardware was done a while ago, but the software was lagging (and still is somewhat).

I also received my TinyLoadr programmer a few weeks ago and it was definitely worth the wait. I’ve mounted the board to a piece of aluminium to keep it stable and now its more or less a perfect tool – very highly recommended if you want to play with ATtinys!!

To speed up my development cycle I’ve build a prototyping setup with a ZIF-socket and a solderless breadboard. I’m not a fan of solderless breadboards in general, but they do have their occasional uses and this would be one of them. I bought a few small ZIF-sockets from ebay and together with the tinyloadr programmer they make up an excellent prototyping platform. Swapping ICs from one ZIF to the other is still a bit of an annoyance, but it’s far more flexible than the alternative 🙂

If you need more memory space (or more I/O-pins) than the ATTinys can provide then I am also working on an update of my AmpDuino-concept. This will be a fully-fledged controller based on a stand-alone ATmega-chip that can do the same as the old version AmpDuino, but in a more optimised way. Connections etc. will be laid out for what I consider to be typical audio applications. ETA is, as always when there is software involved, unknown 😀

Project files: ATtiny-based power delay

As the PCBs for my next ATtiny-based designs have landed over the weekend and I am back from my holidays, now seems to be an appropriate time to post this 🙂

What is it?
It’s my ATtiny85-based power delay controller which can be used for speaker protection etc. as described here. In addition to the controller board itself are also a couple of relay boards to do the actual signal switching. One board is stereo and based on 10A relays, the other is mono and based on a 30A relay.

The controller board includes an on-board 5V regulator, an LED coupled directly to the ATtiny to indicate when the relay is engaged (or another purpose) and two FET-switched outputs. The last two ATtiny I/O pins can be used to trigger the chip with buttons, sensors etc. which gives tremendous versatility.

How big are the boards?
All three boards are my “industry-standard” 2”x2” (app. 51 x 51 mm.) in size, meaning they can be stacked on top of each other if needed.

What is the status of the boards?
All three boards are version 1.0 and the prototype boards looked and worked as expected.

Does it use any special/expensive/hard-to-find parts?
Nothing serious this time either 🙂

  • The small heat sink for the regulator is a Fischer type SK95 with an M3 hole in the bottom, but if you’re having trouble finding this there should be plenty of other small heat sinks that will fit. In any case, the heat sink isn’t always required, it depends on your input voltage and current draw from the 5V line.
  • The relays are standard types, either Omron G5LE (small board) or Omron G8P (large board). I’ve quoted Omron part numbers to give you something to go on, but there should be plenty of identical replacements from other manufacturers available.

Anything else I need to know?

  • The intention is that the ATtiny chip should be programmed using the Arduino IDE. That means you need to have either a dedicated programming shield for ATtinys or wire up the chip to an Arduino board that is used as an ISP. You also need to have the ATtiny cores installed in your Arduino IDE (see explanation here) and you have to burn the Arduino bootloader onto the ATtiny yourself before filling it with the actual program.
  • For programming, I highly recommend something with a ZIF-socket because it will make the whole thing much easier. I’ve got one of these on order (which recently came back in stock) because that looks brilliant, but there are shields on ebay that can be used as well. I’ve been working with this one so far and it works well, but of course you need a dedicated Arduino board to run it.
  • As you can see from the schematic, the intention is that the controller board is fed from a higher voltage (9-24V) than the ATTiny requires, in order to be able to use relays that draw less current. The onboard regulator will provide the 5V that the ATtiny requires.  If you are using the big mono relay boards, be aware that the worst-case power draw for these is around 1.2W each. This means that if you are using a pair of 9-12V relays here you’ll need to be sure that your power supply can handle that.
  • The second output is intended as just that – a secondary switch – but since it’s connected to one of the ATtiny pins that provide a PWM-output, you could probably do something clever and use this for controlling a variable-speed fan fed from the same voltage as the relays. If anyone does that I would love to steal, ehm…. borrow your code 😀
  • Although the relay boards have on-board protection diodes across the coils, there is also space for optional SMD diodes on the bottom of the controller PCB. Use these if you’re driving off-board relays etc.
  • There is a sample sketch included in the download file, but please don’t laugh (too loudly) at my pitiful attempts to code – it’s just an example 🙂

Downloads:
Download design files here

Related information:
Note: Always read the “intro post” for additional important information about my designs.

Most of the complexity here is around the coding. There are tons of links available around the web for how to use ATtinys with Arduino, so I’ll not list them here. Start from the link to the official Arduino page and then do your own search from there.

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 😀

Project files: A PGA231x Volume Control

What is it?
A “digital” volume control based on the well-known PGA2310/PGA2311 ICs from TI. These aren’t actually digital, but just digitally-controlled resistor attenuators integrated on an IC – which doesn’t really matter anyway.

As is often the case, there are two board versions: One is a “normal” stereo version with a single PGA chip onboard, the other is a balanced/multichannel version that has two chips onboard (for balanced setups) and the possibility to daisy-chain more boards (for multi-channel systems). The boards are intended to be controlled from an Arduino or a similar microcontroller via an SPI-interface. I haven’t included any software in the download file, but there should be plenty of examples online that shows how to do this integration (especially for the Arduino).

As even the not so keen-eyed observer will notice, this isn’t a new layout. I recently realised I didn’t post these before and as the project they were meant for died somewhere along the way I am not sure I’ll ever pick these up again (at least not within the foreseeable future).

Note: I had some minor noise-issues with the boards. As I never got beyond bench-testing, the noise could be from any number of sources other than the layout (my shoddy test wiring, poor PSU, the poor USB supply that I used for the arduino etc.). This means that although the PCB layout is made according to (what I believe are) the TI recommendations for the PGA231x, I cannot guarantee that the finished board will perform 100% flawlessly without tweaks.

How big are the boards?
The stereo board measures 2.525” x 1.6” (app. 64 x 41 mm.)
The balanced board measures 2.525” x 2.65” (app. 64 x 67 mm.)

What is the status of the boards?
The boards are v1.0, meaning finished and technically working as I expected. Please do note the caveat above around noise though.

Does it use any special/expensive/hard-to-find parts?
None, really.

Anything else I need to know?

  • There are plenty of examples online for interfacing the PGA ICs with Arduino and other microcontrollers – do a search of diyaudio and the Arduino forums for a start.
  • The PGA chip wants to be driven from a low-impedance load and the input buffer sees to that – use whatever dual opamp you prefer here. If you don’t have a favourite already, I’d recommend the LME49720/LM4562 as long as they are available:) The PGA has a buffer of its own on the output and it is spec’ed to drive loads down to 600 ohms which should mean that all common configurations are catered for.

Downloads:
Download design files here

EDIT 23/4-2017: In response to the reader comments below, here is a basic BoM for the single board. As the dual-board is basically two sections of the same circuit, you should be able to work out the BoM for that yourself 🙂

Related information:
Note: Always read the “intro post” for additional important information about my designs.

Please also refer to the data sheet for the PGA2310 for information about controlling the chip etc.

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 😀

tinypot-1

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.