Page 1 of 1

ADC input

Posted: Mon Oct 21, 2013 10:42 pm
by philip davies
Hi,

Is there somewhere on this forum that I can read/learn on how to use the ADC input using flowcode?

Its for an old amplifier that I am restoring. I would like to be able to use the volume control pot to display its set position on the display in dB.

Many thanks in advance :D

Phil

Re: ADC input

Posted: Tue Oct 22, 2013 7:35 am
by Nico595
Hi Phil,

If you want just display volume in dB without control you can use ADC but you must add a Continue Current in your audio input line with capacitor in input and ouput of potentiometer.


If you want control volume, you can use AD5204 digital potentiometers in SPI with Pic or Attiny
http://www.google.fr/url?sa=t&rct=j&q=& ... 3115,d.d2k

Your old potentiometer connected on ADC but without audio, just Continue Current.




Regards
Nico.

Re: ADC input

Posted: Tue Oct 22, 2013 7:23 pm
by philip davies
Hi Nico,

Many thanks for your reply. That's an interesting looking digital potentiometer. The original circuit uses a 4-gang motorised pot. Two of the four gangs were used for carrying the L and R audio channels and the third used for adc input and the fourth is just a spare. I would like to keep to the original design as it would require modifying of the preamp board.

Many thanks

Phil

Re: ADC input

Posted: Tue Oct 22, 2013 8:36 pm
by medelec35
Hi Phil,
When you use and ADC component and use:
ReadAsByte, the the value retrieved will be 0 to 255 (0 to 5V)
ReadAsInt, the the value retrieved will be 0 to 1023 (0 to 5V)
So you can use one of the above and convert from bytes or int direct to dB's

I did create a flowchart that works as a volume control which can be found here:
http://www.matrixmultimedia.com/mmforum ... 99&#p45599
instead of volume you can have dB's
My guess the easiest way is to use the fourth gang of the pot and feed it with +5V one end and 0V the other, then the voltage out from the wiper will be proportional to the how far spinal has been rotated.
E.g if using ReadAsByte, and spindle is rotated a quarter of the way then
Voltage on the wiper = 1/4 * 5 = 1.25
Bytes = 255/5 * 1.25 = 64 or 255/4 =
Or if using ReadAsInt:
Int = 1023/5 * 1.25 = 256

Next thing to work out is the relationship between bytes (or int ) and dB's
There may not be so then you will need to use look-up tables (information on LUT's can be found by searching the forum)
Then you can directly enter the value of dB and the corresponding value of bytes.

There are free online courses and examples of different flowcharts in the learning centre:
http://www.matrixmultimedia.com/lc_index.php?p=12

Martin

Re: ADC input

Posted: Wed Oct 23, 2013 12:30 am
by philip davies
Many thanks Martin for your help and suggestions. That's quite an interesting volume control that you have put together there.

I will also look at the learning centre of this website and see what I can find :D

Phil

Re: ADC input

Posted: Wed Oct 23, 2013 7:22 am
by medelec35
Thanks Phil,
Once you know what value of dB you want for each pot position, 'If you give it a go and create your flowchart, Im sure we can help you procedure further.

Martin