Notes on Pre amp design
background - had a 32 tape digital potentiometer with up down. Arranged in a rheostat inverting layout. This had gain changes that where to high at one end. Also there was more noise that I would have like (no noise is great but not real).
Initial board design is based on sparkfuns board. https://www.sparkfun.com/products/9964, there are some pretty interesting design features that they have.
Also because I want more steps I've had to go to SPI interface not up down. I should be able to write something that will work here. I believe (maybe I should test this first, in bread board). SPI will also require 3 pins to drive not 2 so extra pin. might be able to reduce this but more work needed.
This design focused on improving the noise and also putting in better gain increments. Some very interesting background documents around application, where where
Chip Options
MCP42XXX, 100K, 256 positions, 2 pots, , cost 3.60 Mouser, dip about $2 futurlec
MCP41XXX, 100K, 256 positions, , cost $2.37 Mouser,dip about $2 futurlec
AD5160 - 100K, 256 positions, SOT-23-8 single pot, cost about $3 mouser,
MAX5400-MAX5401 - 255 tapes, cost $3.57 Mouser
AD5270 - 1024 tapes, $7.11 Mouser.
note - could have R1 as smaller thus giving greater gain, if I needed more than 255.
resistor value - go for higher as less chance of drawing to much current but don't really know what the down side of this is 100K. but 10K should also work . Can expect max voltage is 3.3 volts. I cannot see how this will be a problem, R1 needs to be low and its only going to happen when I have alternative layout, gain in inverting = -r2/r1. So if I have 10K min resistance can be about 33 ohm so current i=v/r = 3.3/33 = 0.1amp or 100m amps. Quite a lot but gain of 255, 60 gain give about 4*33 = 3.3/(4*33) = 25mA, still quite large, so need 100K I'd say. or 50K which would give 20mA max and 5mA at 60 gain, which is good enough I think. What can opamp source. I use opa344
Note
Filter the Signal
20140214 - Lee Nicolson suggested that I filter signal. Yes this is a good idea. Know you noise and what I want out of it. I think with current design I have quite a lot of low frequency noise. I could filter this out and maybe if there is high frequency stuff look at that as well. wiki has some stuff on filters. http://en.wikipedia.org/wiki/High-pass_filter
Also has some interesting stuff on human hearing and speech. http://en.wikipedia.org/wiki/Hearing_range does look like I should be able to filter out 50Hz and not interferr with the voice frequencies, http://en.wikipedia.org/wiki/Voice_frequency, although male have a pretty low fundamental frequency of 85Hz so I would need to make sure that this was not interferred with to much (or just accept that is would). OMG using the formula for op amp filter pass I get cut of frequencey Fc = 1/(2+pi*R1*c1) = 3.38 Hz. If I decrease the resistance to 1/20 of the current value (10K) then my cut off frequency would be about 67Hz. But sure how much this would effect 50Hz signal.
link I should read around http://forum.allaboutcircuits.com/showthread.php?t=64773.
Also because I have a two stage op amp circuit I could do more filtering at the next stage. This should help with low signals which is what I'm looking for. i.e. first stage won't be overtaken but noise so I don't need to filter everthing out there. I also think that closer to the final output would be better. this has some info http://www.4shared.com/web/preview/doc/6PK1xm21, more on filtering http://www.ece.mtu.edu/labs/EElabs/EE3305/Active_Filter_Lab.pdf, high pass filter will get ride of 50Hz signal. Higher frequencies I can make low pass filter and also if I really want I can have a notch filter to slide up and down.
Note - KNOW your NOISE
20140214 - Noise in signal at present
connected up to oscilloscope and the 50 Hz signal is 750mV, 100Hz 380mV and 200Hz 120mV, but sometime the gain goes up and its much higher. Any way its clear this is a dominant signal. With its harmonics also dominant. Do the harmonics come from the 50Hz or are they there own signal. ACtually in 50Hz jumps there are some other harmonics there also. The 5V power supply looks pretty good. Although I'm not sure seems to spike up to 100mV this is significant, not sure why the fft on my scope doesn't show this. Also when I look at a larger frequency range than 1kHz I'm getting some pretty noise stuff happening above 7 kHz, below 100MV at the moment but up to 50mV. and spikes happening at several places above 6 Khz. Signal that we can see is around 50mV. So If I could remove the 50Hz thing and band width limit it then I should be able to clearly see 50mV maybe even low so that increase in gain of 75/5 = 15 maybe down to 30mV 750/30 = 25 gain more. That is fanastic stuff. I have a gain of 16 that works so another 25 on top of that is 16*25 = 400 overall gain. So have to go with the 1024 or double digital pot arrangement, gain of 255 is not enough. Lower gain is 15*16 = 240 upper gain is 32*25 = 800. Now thats amazing. This depends on the gain that I have in the circuit I can check this probably just 16 not 32 could be even lower ?? Even if its 16 then 240 to 400 max gain. actually a gain of 255 is not longer enough. So might need three stage gain. Or some configuration that means that I have another smaller pot say 10K and 100K with 255 slots, so max gain is then 2550 but min gain is 10 where as before I had min of 1. Which was needed in some cases. unless I go to 1024 by 2 this would give me better gain up to 1024 but would be pretty jumpy at the higher gains above 128. This might correspond to log scale and all might be good. OK how do I test this circuit? and gains. First remove the 50Hz signal, in ideal situation this might not be as good as I would like it. OK looked at gain is only 8 so we need to go from 8*15 to 8*25 or 120 to 200 Gain. 32 is not enough. AP - need to check on circuit that doesn't have a long mic lead (now where did I put the sound board, or have I used them all up?). So we are back to 255 tapes which might be enough. max gain 255. OK if I get to that this I will be happy.
This link has background information on harmonics - http://www.danfoss.com/NR/rdonlyres/3A3E1AB4-65B7-46C3-B059-5986F6E911EC/0/BasicHarmonicsTraining.pdf
active filter reference -http://en.wikipedia.org/wiki/Active_filter
Next - 20140212
Initial board design is based on sparkfuns board. https://www.sparkfun.com/products/9964, there are some pretty interesting design features that they have.
Also because I want more steps I've had to go to SPI interface not up down. I should be able to write something that will work here. I believe (maybe I should test this first, in bread board). SPI will also require 3 pins to drive not 2 so extra pin. might be able to reduce this but more work needed.
This design focused on improving the noise and also putting in better gain increments. Some very interesting background documents around application, where where
- http://ww1.microchip.com/downloads/en/AppNotes/01316A.pdf, here microship discusses the different potentiometers and different arrangements of these. I'm going to go with type B potentiometer and one with 256 tapes and resistors, this give me full control but need to not use the 0 level as this will give zero resistance, the 255 level will not give zero resistance (this is a characteristic of this type of pot). Also it looked at different layouts, I'm going with their alternative circuit, which has two digital pots and allows ful control over the gain, but at increase complexity and also board size (MCP42XXX use a 14TSSOP 0.65 pitch 6.4by5mm, or 14 lead soic pitch 1.27mm 6by8.7mm ). The other option is that I use the simple inverting configuration, If I accept 20% gain as my increment then I can get up to a gain of 50 to 60(MCP41XXX). considering that I was maxing out at 32 gain before with noise issue, if I could get times 2 signal out that would be fab. chip size (5mm by 6mm). Chip size is not much smaller than the two chip board using microchip, but easier to solder. The AD5160 is only 3mm by 3mm so this is much smaller(pin separation is 0.65mm, omg that's small), but only single pot. note - I've done 0.95mm separation. (I'd like to do 0.8 for the atmega328). The decision here is what gain I think I need to aim for, if its 50 to 60 (on top the the pre amp gain of 100x) then simple design with one digital pot is all I need. If I want more gain then I should go to two pots and increased board size and complexity, then I could have a much smoother gain up to 255. I'd like low noise situations. But what can I expect to get that much out of the design?. Another option is the MAX5400-MAX5401 chip SOT-23-8 which is same size as AD5160 and glitchless single pot. This document show designs that use less parts than mine but get about the same gain increments. I could also use AD5270 which has 1024 tapes MSOP 10 pin chip (3mm by 5mm sep 0.5mm) single pot.
- There was also a reference to how to have low noise using digital pots and op amps, on my tablet. Main points I took where 1) put 0.1uF caps close to the power supply of the chips to and also 10uF chip of op amps. These where decoupling but I think the 10uF one was more to supply extra power when needed. Also to have low signal and high signal lines away from each other.
Chip Options
MCP42XXX, 100K, 256 positions, 2 pots, , cost 3.60 Mouser, dip about $2 futurlec
MCP41XXX, 100K, 256 positions, , cost $2.37 Mouser,dip about $2 futurlec
AD5160 - 100K, 256 positions, SOT-23-8 single pot, cost about $3 mouser,
MAX5400-MAX5401 - 255 tapes, cost $3.57 Mouser
AD5270 - 1024 tapes, $7.11 Mouser.
note - could have R1 as smaller thus giving greater gain, if I needed more than 255.
resistor value - go for higher as less chance of drawing to much current but don't really know what the down side of this is 100K. but 10K should also work . Can expect max voltage is 3.3 volts. I cannot see how this will be a problem, R1 needs to be low and its only going to happen when I have alternative layout, gain in inverting = -r2/r1. So if I have 10K min resistance can be about 33 ohm so current i=v/r = 3.3/33 = 0.1amp or 100m amps. Quite a lot but gain of 255, 60 gain give about 4*33 = 3.3/(4*33) = 25mA, still quite large, so need 100K I'd say. or 50K which would give 20mA max and 5mA at 60 gain, which is good enough I think. What can opamp source. I use opa344
Note
- futurlec has MCP41XXX in DIP format. So could get some of these to try out library, only about $2 each. Or could just go for it. ( note - they have energy meter chip, interesting, what are they)
- Interesting that some of these chips have line out, so they can be connected in series.
- Stencil and oven work might be a lot easier to do. But hand soldering will be first option until I have that under control.
Filter the Signal
20140214 - Lee Nicolson suggested that I filter signal. Yes this is a good idea. Know you noise and what I want out of it. I think with current design I have quite a lot of low frequency noise. I could filter this out and maybe if there is high frequency stuff look at that as well. wiki has some stuff on filters. http://en.wikipedia.org/wiki/High-pass_filter
Also has some interesting stuff on human hearing and speech. http://en.wikipedia.org/wiki/Hearing_range does look like I should be able to filter out 50Hz and not interferr with the voice frequencies, http://en.wikipedia.org/wiki/Voice_frequency, although male have a pretty low fundamental frequency of 85Hz so I would need to make sure that this was not interferred with to much (or just accept that is would). OMG using the formula for op amp filter pass I get cut of frequencey Fc = 1/(2+pi*R1*c1) = 3.38 Hz. If I decrease the resistance to 1/20 of the current value (10K) then my cut off frequency would be about 67Hz. But sure how much this would effect 50Hz signal.
link I should read around http://forum.allaboutcircuits.com/showthread.php?t=64773.
Also because I have a two stage op amp circuit I could do more filtering at the next stage. This should help with low signals which is what I'm looking for. i.e. first stage won't be overtaken but noise so I don't need to filter everthing out there. I also think that closer to the final output would be better. this has some info http://www.4shared.com/web/preview/doc/6PK1xm21, more on filtering http://www.ece.mtu.edu/labs/EElabs/EE3305/Active_Filter_Lab.pdf, high pass filter will get ride of 50Hz signal. Higher frequencies I can make low pass filter and also if I really want I can have a notch filter to slide up and down.
Note - KNOW your NOISE
20140214 - Noise in signal at present
connected up to oscilloscope and the 50 Hz signal is 750mV, 100Hz 380mV and 200Hz 120mV, but sometime the gain goes up and its much higher. Any way its clear this is a dominant signal. With its harmonics also dominant. Do the harmonics come from the 50Hz or are they there own signal. ACtually in 50Hz jumps there are some other harmonics there also. The 5V power supply looks pretty good. Although I'm not sure seems to spike up to 100mV this is significant, not sure why the fft on my scope doesn't show this. Also when I look at a larger frequency range than 1kHz I'm getting some pretty noise stuff happening above 7 kHz, below 100MV at the moment but up to 50mV. and spikes happening at several places above 6 Khz. Signal that we can see is around 50mV. So If I could remove the 50Hz thing and band width limit it then I should be able to clearly see 50mV maybe even low so that increase in gain of 75/5 = 15 maybe down to 30mV 750/30 = 25 gain more. That is fanastic stuff. I have a gain of 16 that works so another 25 on top of that is 16*25 = 400 overall gain. So have to go with the 1024 or double digital pot arrangement, gain of 255 is not enough. Lower gain is 15*16 = 240 upper gain is 32*25 = 800. Now thats amazing. This depends on the gain that I have in the circuit I can check this probably just 16 not 32 could be even lower ?? Even if its 16 then 240 to 400 max gain. actually a gain of 255 is not longer enough. So might need three stage gain. Or some configuration that means that I have another smaller pot say 10K and 100K with 255 slots, so max gain is then 2550 but min gain is 10 where as before I had min of 1. Which was needed in some cases. unless I go to 1024 by 2 this would give me better gain up to 1024 but would be pretty jumpy at the higher gains above 128. This might correspond to log scale and all might be good. OK how do I test this circuit? and gains. First remove the 50Hz signal, in ideal situation this might not be as good as I would like it. OK looked at gain is only 8 so we need to go from 8*15 to 8*25 or 120 to 200 Gain. 32 is not enough. AP - need to check on circuit that doesn't have a long mic lead (now where did I put the sound board, or have I used them all up?). So we are back to 255 tapes which might be enough. max gain 255. OK if I get to that this I will be happy.
This link has background information on harmonics - http://www.danfoss.com/NR/rdonlyres/3A3E1AB4-65B7-46C3-B059-5986F6E911EC/0/BasicHarmonicsTraining.pdf
active filter reference -http://en.wikipedia.org/wiki/Active_filter
Next - 20140212
- Try out the protocol for controlling the chips from arduino
- Decide on single pot or double. and if single 256 or 1024. Certainly like the idea of 2 give smoother transistion up to 255 gain. very nice
- Q - do I have split supply for each op amp or one that supplies both, current I have one but I wonder about signal interference. two means that the level will not be the same. One has noise issue maybe.
- Q - what about putting opa344 to opa2344 i.e. both op amps in same chip. Not sure about this idea either. Noise versus size?
- Q - why don't I just put the gain of the initial chip up? this makes it even simpler. why not hey? not sure what the considerations are here? in this case we want gain to go from around 100 up to 100*255 = 25500, ok difficult to get this gain
- Q - maybe I should be puttin in logarithmic gain in as this aligns more closely with what I want to hear in the sound levels. omg yes. So simple design is not so bad but need to reduce the noise level.
- Q - find out what mics I'm using - I see I have notes on CMA-4544PF
- put in pull up or down resistors if I need these with new layout. Also power led.
- Make new board with caps and improved layout
20140218 - OK so change in direction. Played around with shielding and tin foil grounded works, but at a overall gain of about 5000 was getting other effect, very managable, looked like low frequency stuff largely, but at 100 000 was not helping really. Talked to dave and he said that it could be railing with not having the right DC offset, yep it could be. Talked to Dave and he said that I could do a differential AC coupled , non inverting design with bi pass cap output to the neg input (this stops feedback I believe). Don't understand all these names but did some googling and come up with a few links that where really interesting
1) http://www.egr.msu.edu/classes/ece480/capstone/fall08/group09/Documents/Electret_Amplifier_Application_Note.pdf, this design is very interesting in that eliminates the noise input on the lines by the inherent design of the circuit. I like the zener diode application also. These notes don't have values to use but I should be able to figure that out. It is directly related to condenser mic design and usage.
2) Also found that a regulator can supply a stable voltage to the circuit mic and also voltage divider, seen as small fluctuations in these will give a large response to change. I think I would put in SOT-223. Also with zener they put in quite a lot of thermal noise. Interesting.
3) http://www.ieee.li/pdf/essay/single_supply_op_amp_design.pdf, this also had some very interesting points and looked at the zener and resulator design and had cap and resistor values, not directly related to condensing mic design but related to op amps. Very good. Need to re read it. Had a regulator ADM663A and ADM666A. which are interesting but now obsolete ! not sure what is so good about them.
4) Another interesting concept is the gain bandwidth. Don't fully understand this but interesting, and for what I'm using I don't think that its an issue. Although I need to understand about which the frequencies are done.
5) power amplifer in this is interesting http://pdf1.alldatasheet.net/datasheet-pdf/view/212589/NSC/LM324.html, also AC coupled amplifer and the photo voltatic design (could use this for light detection?) And a AC coupled non inverting design, gee and I think I almost understand all the bits and what they do here. AP - need to get a bit more of a feel for this.
6) omg - how far down the rabbit hole do I want to go, here is another design, http://www.analog.com/static/imported-files/seminars_webcasts/3688645364170Section1.pdf, interesting in that figure 1.9 has a design for instruments.
7) and a tutorial on it. http://maecourses.ucsd.edu/callafon/labcourse/handouts/LC_handout.pdf
note I'm using the LM324 , http://www.ti.com/lit/ds/symlink/lm324.pdf, but ordering the opa344. Not sure what the difference is here and which one is the best one. BUt not sure that I'm at the level that I need to be worried about this. Also Dave stated that the data sheet should have designs to use. texis instruments doesn't.
AP - calculate the gain of the differential amplifier in