Sylonex and Arduino preamp - Page 2 - diyAudio
Go Back   Home > Forums > Source & Line > Analog Line Level

Analog Line Level Preamplifiers , Passive Pre-amps, Crossovers, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 7th February 2011, 06:24 PM   #11
oenboek is offline oenboek  Belgium
diyAudio Member
 
Join Date: Apr 2005
Location: Sint Katelijne Waver
Here is a block diagram of the analog part of 1 channel only. It shows the 2 optocouplers, but only the resistor part of it. For the rest it's only relais for input, for mute and for calibration.
The 3 INPUT-relais are clear, no comment needed.
REL_OUT is clear as well. It's used as mute by switching off the output during the calibration, and it links the output to the calibration circuit.
REL_SHUNT connects the output to the earth or to the calibration circuit. Connected to the calibration circuit, it makes it possible to measure the resistance of the shunt resistor. The connection to earth is needed to be able to measure the series-resistor.
REL_SERIES is there to measure the resistance of the series-resistor, in this case the output needs to be connected to the ground which is done by rel_shunt.
In total there are 8 relays in the stereo-preamp, steered by the Arduino through I2C. I used a Jeelab Output Plug. This is a small module containing a MCP23008T and a ULN2803 as a buffer. I added a hardware protection to avoid calibration and closure of input or outputrelais simultaniously as this would put DC on the output. My poweramp is linked in DC and I don't like the small of frying speakers. As a programming error is easily made, a hardware protection helps to sleep better.
Measurement of the resistance is done by a precise current source which sends current through the resisitor. A voltage buffer sends the tension over the resistor to an ADC. A famous law does the rest. The buffer board is the same as the one for the DAC, only some parts are different to make it really precise and stable. As an ADC I use a Jeelabs Analog Plug, based on a MCP3424. It's a 4 channel one, but only 1 is used at the moment.
The DAC is remaining now. That's a MCP4728 4-channel DAC. I dit put it on a small breadboard to be compatible with the Jeelabs connections.
Next time some pictures.
Attached Images
File Type: jpg BlockDiagram.JPG (16.4 KB, 709 views)
  Reply With Quote
Old 13th February 2011, 09:47 AM   #12
oenboek is offline oenboek  Belgium
diyAudio Member
 
Join Date: Apr 2005
Location: Sint Katelijne Waver
Here finally some pictures.
Picture 1 shows the complete unit.
> In the front you have from left to right the 3 I2C-interfaces:
- the Output Plug from Jeelabs, used for the relais
- in the middle the ADC-plug from Jeelabs
- and at the right the DAC-chip, soldered on a converter to DIL by Tirna-electronics.
> These boards are connected to the first big board that does the distribution of all signals and power to the right connectors on the backside. This big PCB is called the distribution board.
> In the middle between the 2 big boards are 6 small PCBs.
- 4 of them are to convert the output from the DACs to current through the LEDs, incorporating a 2nd optocoupler on the analog board in the feedback loop.
- 1 is the circuit to convert resistance to voltage
- and the last one makes to connections to the relais. Picture 2 shows a detail.
> The name of the last board is revealed above. The analog board contains the relais and the optocouplers, see pic 3 for a close-up of the Sylonex parts. Connection to input and output is done on the back.

The last picture shows the complete preamp, including the B1symmetric as buffer, and 2 power-supplies. 1 PS is used for the I2C-parts. A very good PS is needed to keep the DACs working stable. And the same quality of PS is needed as power for the opamps.

I still have to move it in the housing, but I need to swap my multimedia PC first. You don't see the Arduino. It will come in the same housing as the PC, far from the preamp. This will allow to have the buttons and display at eye-level, and the preamp close to the poweramp which is at floorlevel. All signal cables can be very short. A galvanic isolator between I2C and the Arduino will be added as well.
Attached Images
File Type: jpg Preamp Overview.jpg (672.1 KB, 727 views)
File Type: jpg Opamps Closeup.jpg (252.4 KB, 678 views)
File Type: jpg Sylonex Closeup 2.jpg (97.0 KB, 634 views)
File Type: jpg Preamp Complete.jpg (366.3 KB, 652 views)
  Reply With Quote
Old 13th February 2011, 10:10 AM   #13
maxw is offline maxw  United Kingdom
diyAudio Member
 
maxw's Avatar
 
Join Date: Jun 2004
Location: London
Wow!
  Reply With Quote
Old 2nd March 2011, 04:54 PM   #14
oenboek is offline oenboek  Belgium
diyAudio Member
 
Join Date: Apr 2005
Location: Sint Katelijne Waver
I have the calibration routine OK. The goal of the routine is to measure the current needed against the resistance asked. This is done for each optocoupler for 10 resistance values. The resistance values are chosen more or less logarithmic, which is obvious.
I keep the links between current (DAC-value) and resistance (ADC-value) in an array.
Calibration starts from the default value of the current. This value is changed until the resistance value has been met. At that moment the obtained DAC-value is written in the array.

The optocouplers are really slow, especially at high currents. Therefor I repeat each measurement until I have 5 identical resistance measurements. I observed that 5 stable results is really stable. For sure this does not work at the high resistances as they move (+- 2Ohm on 10kOhm), there a maximum number of tries stops the calculation. It took me a while to find out that waiting for stabilisation is a real must. Without this the loop is unstable.
I also needed to optimise the search for the correct value by avoiding too big jumps, too small jumps etc. This is described in detail in the routine I attached.

At the end I stored the calibration values as fixed values in the program, this is the default used at startup. But I can do a re-calibration whenever I want. Best is to do it at working temperature. Changes in values after calibration are very small. I think it would be interesting to see it over a very long term to evaluate the drift of the optocoupler.
Measuring the 10 values for 4 optocouplers, including the stabilisation etc takes less then 5 minutes. Therefor it's not an issue to do it from time to time. To change the default values, I need to change the program. I want to change this in the future and put the new values in eprom. But first I need to put it in the final housing.
Attached Files
File Type: txt Calibration.txt (6.9 KB, 123 views)
  Reply With Quote
Old 10th March 2011, 06:57 PM   #15
oenboek is offline oenboek  Belgium
diyAudio Member
 
Join Date: Apr 2005
Location: Sint Katelijne Waver
Galvanic isolation is really important !!
I had an issue during programming of the Arduino. To program it, I need to connect the Arduino with USB to the Audio-PC in my stereo. That PC is earthed, and it's linked with USB as well to my DAC. This gave me 2 problems:
1st issue:
There is an earth loop between the PC and the DAC causing noise during playback. This was not too bad at the start, but became really annoying after putting very short powercables. Probably this reduced the resistance in the loop too far. A solution for this was the implementation of a USB-isolator between the PC and the DAC. I installed the Ultravox from Diyparadise and the sound became a lot clearer immediatly. Also the noise coming from the PC dissappeared completely.
2nd issue:
There was a similar loop between the PC and my preamp, coming from the USB-cable, and coming from the fact that the ADC in the calibration is linked both to the ground of my preamp and to the ground of the Arduino. I could have solved this by putting a relay to connect the DAC to ground only during calibration, but I was too lazy for that. Another solution was to isolate the Arduino completely from I2C. Therefor I used an ADUM1250, which is a galvanic isolation IC for I2C. As it's too small for my fingers and soldering gun, I asked Tirna Electronics to solder it for me on a SOIC8-adaptor. With this in (see at the arrow on the picture), the sound is 100% clean again. It blocks also possible noise on the lines that could come from the Arduino.

I noticed that the Arduino can possibly create a lot of noise. At a moment I had the Arduino not earthed at all. This made the Arduino transmit a hell of noise in the preamp, even with the galvanic isolation inbetween. The transistors were at only 200mm from the Arduino at that moment, but it shows it can be a real noise transmitter. Connecting it to the PC (earthing) made the noise disappear completely. It shows for me as well that connecting an Arduino straight to audio will inject noise into the earth. Now I send the noise to the PC which is galvanic isolated from the audio.

I'm happy I will be able to put the preamp at a meter away from Arduino and PC by using the galvanic isolated I2C-bus. Keeping noise at a distance is always better. Also my DAC will be far from the noisy sources. I sleep better now .
Attached Images
File Type: jpg IMG_6990_arrow.JPG (379.4 KB, 279 views)
  Reply With Quote
Old 10th March 2011, 07:06 PM   #16
diyAudio Member
 
linuxworks's Avatar
 
Join Date: Jul 2008
Location: santa clara, CA
we've had zero issues with the arduino and noise.

I would check your ground design and layout.

we've tested the arduino in our 'a10 preamp' (amb.org) and its at the same level of noise as our test gear (RME firewire box usually used for testing).

you may want to consider ferrites to link grounds if you are not already doing that.

running from computer usb will always be a problem. I use that for debug but never for actual audio use. yes, you will have ground loops with pc's and earth ground vs. usb ground.
__________________
My Photostream:http://www.flickr.com/photos/linux-works/
  Reply With Quote
Old 11th March 2011, 06:48 AM   #17
oenboek is offline oenboek  Belgium
diyAudio Member
 
Join Date: Apr 2005
Location: Sint Katelijne Waver
At the moment I have zero noise, even with the Arduino linked through USB. That's achieved by using galvanic isolation. I keep the Arduino linked to the PC as I use the PC as remote control for the Arduino (for Volume, IO-selection and calibration.
And I only have the noise when the Arduino is not linked to earth at all, which should never be the case. At that moment even the earthplane on the board acts like an antenna. As soon as the Arduino is grounded, the noise disappears completely.
I use ferrites on several places, but as I use galvanic isolation between audio and digital, it's not of major importance. I use them to avoid HF passing through the power supllies. HF is always present on the mains, and I keep it out in several steps (ferrite on mains, filter on mains, ferrites on low voltage).
  Reply With Quote
Old 12th March 2011, 12:50 AM   #18
maxw is offline maxw  United Kingdom
diyAudio Member
 
maxw's Avatar
 
Join Date: Jun 2004
Location: London
I just built a PGA2310 module for use with an arduino. When using USB from my computer powering the whole digital section I do not get any noise at all. No its not ideal, but still. No ferrites or any sort of isolation
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arduino controled HIFI Preamp ialpha Parts 20 27th November 2012 10:08 AM
My Preamp Project: Arduino, I2C, relay selector+attenuator, tube stage maxw Analog Line Level 57 30th December 2011 12:26 AM
Arduino for audio projects? glt Parts 5 9th March 2011 05:28 PM
Arduino based Input Selector for preamp _atari_ Analog Line Level 5 30th June 2010 02:42 PM
Can DIY audio be like Arduino glt Everything Else 1 3rd April 2009 03:57 PM


New To Site? Need Help?

All times are GMT. The time now is 08:52 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2