Archive for the ‘notes’ Category

MOSFET overdrive…

a forced contract job for Ryan of Falcon Scott. he’s been having some issues finding an overdrive suitable to his hollow-body guitar. i just got a lot of BS170s and thought this might do the trick. the distortion is pretty squared off on the oscilloscope and crunchy. the left pot is post volume while the right biases the BS170. overall, it sounds pretty good and that’s saying a lot coming from someone who isn’t much into “distortion” (personal bias does make a difference. hah).

a big thanks to Jack Orman at Musique.com for laying out the basis. i modified his schematic a bit to get the “best” results for my ear, but i couldn’t have done it without his work.

ngSpice: single frequency FM modulated signal generation

ever wanted to see how that 2N2222 might hold up as a linear RF amplifier? here’s a handy feature of ngSpice that i found recently. i’m rather new to ngSpice and at first was somewhat frustrated by its differences from other SPICE variants. however, i’ve earned a deep appreciation for it and its integration with the gEDA suite.

V1 n1 0 sffm(2 24 10k 5 1k)
.tran 0.01ms 2ms
.plot n1

the above code generates the waveform seen above. the corresponding values in the sffm() function run something like this.

Parameters Default value Unit
Vo (offset) Ampere or Volt
Va (amplitude) Ampere or Volt
Fc (carrier frequency) 1/Tstop Hz (Hertz)
Mi (modulation index)
Fs (modulation frequency) 1/Tstop Hz (Hertz)

LM386-based “Esteli” demo by Alex Wilson

an older video, but one i’ve been wanting to post for some time. this is Alex Wilson of Son Cats playing on one of the several cigar-box amps i’ve constructed. this one, in particular, had one of the best sounds during the more work-with-what-is-available days. i thought the video was a great demo of an application best suited for a small 1/2 watt amp. thanks, Alex.

MOSFET vs. BJT

a good rule of thumb pulled from this forum thread (http://www.electro-tech-online.com/general-electronics-chat/39339-mosfet-vs-bjt.html):

  1. Need a switch to be fully-on fully-off and carry lots of current -MOSFET
  2. Need a switch that needs to have lowish capacitance – BIPOLAR
  3. Need a cheap, dirty 2 or 3 component current source – BIPOLAR
  4. Need a low voltage/noise amplifier – BIPOLAR
  5. Need an amplifier with VERY low input/bias current – MOSFET
  6. Need a low noise AND low input current amplifier – JFET
  7. Need a one component current source – JFET
  8. Need switch or amp that must cost almost nothing – BIPOLAR
  9. Need multiple transistor package that has matching – BIPOLOAR
  10. Need switch that may be over-voltaged – MOSFET
  11. need switch/amp that sits in nasty RF environment – MOSFET (BIPOLARS rectify & cause offsets)


MOSFETs can generally switch faster (they certainly require less complex and less power to drive their gates). But if I’m not mistaken, BJTs designed for the task can switch very very fast since they have no gate capacitance to charge and can also operate in quasi-saturation mode for even faster switching at the expense of conduction efficiency. MOSFETs have less losses when used as a switch at “lower” voltages (lower as in industry’s definition which is <~200V).

MOSFETs act like a resistor when on while BJTs act more like diodes. The resistance can be modified by changing the “dimensions” of the MOSFET while the BJT’s “diode voltage drop” can’t be changed so easily unless the materials are changed. THis tends to make MOSFETs have less losses at the lower voltages but also means MOSFETs can be paralleled since current imbalances will cancel out.

With parallel BJTs, the best BJT will hog the current from the other “not so good BJTs” and burn out and the cycle repeats with the remaining BJTs until they are all burned. This is similar to parallel diodes. You can correct for imbalances by manually tuning resistors in series with each BJT, but for power applications that’s needing massive resistors and wasting lots of power.


thanks guys…

Arduino: Mellotronium loops…

a little improvisation i did after improving the LFO phase modulation and arpeggiator functions of the Mellotronium: an ATMega328P-based mirco-synthesizer. there are plenty of improvements to be made, but it’s surprising how much you can make of these microcontrollers do. combined with a Roland RC-50, it’s music composition on the fly.

you’ll have to excuse the loud hissing noise. apparently the power supply of my netbook isn’t exactly quiet. it sounds a lot better using the battery pack or the wall wart.

Mellontronium vs. the Sun…

the micro-synthesizer is getting fitted to draw it’s power from the sun via a 6V 200mA solar cell. it’s pretty impressive what the sun along with a cheap collection of photovoltaic cells can do.

TDA2040 Instrument Amplifier

the need for small and portable amplifiers has arisen mainly by a desire to come up with some sort of all-purpose busking amplifier. here is the first screen shot of the output from the preamp section. the entire amplifier is powering an Eminence Beta-12LTA off of a mere 6V. don’t ask me how. it took a while to find the right combination of resistors for the TL082 to run stable at such a low voltage. it’s also surprisingly loud being that it’s about 26V away from the recommended supply (±16V). i’ll probably be posting a schematic soon.

ARDUINO: Setting up a Gentoo development environment…

if you’re reading this post, most likely you’re having issues with setting up Crossdev as mentioned on the arduino.cc site. i tried countless times to configure my system for AVR compiling that way, but it always failed compiling avr-libc and would never compile avr-g++ no matter how i applied the USE flags. in short, i had to manually compile the necessary environment and this article is so i don’t forget how that’s done. it seems there are only a smattering ink blot’s worth of people developing Arduino sketches under the Gentoo distribution, but this should work (in theory) for most any Linux distro out there since it’s all manual installation. if anyone happens to hit a snag during their installation, feel free to let me know.

Download the tool chain…

getting the right version is the key. some newer versions don’t play nice with ATMEL’s chips for whatever reason.

1) BinUtils 2.20.1a: http://ftp.gnu.org/gnu/binutils/binutils-2.20.1a.tar.bz2
2) GCC 4.3.6: http://gcc.petsads.us/releases/gcc-4.3.6/gcc-g++-4.3.6.tar.bz2
3) AVR LibC 1.7.1: http://download.savannah.gnu.org/releases/avr-libc/avr-libc-1.7.1.tar.bz2

these are the versions that both myself and Jose Moldonado in Spain have been able to run without problems.

Additional downloads…

you’ll need AVRDuDe. i installed it from source just to be safe, though i think the portage install is just as good.

http://download.savannah.gnu.org/releases/avrdude/avrdude-5.11.tar.gz

PREFIX and PATH

this is how my system is setup.

#PREFIX=/usr/i686-pc-linux-gnu/avr
#export PREFIX
#PATH=$PATH:$PREFIX/bin
#export PATH

make sure to do this FIRST. not modifying the PREFIX variable could potentially hose the whole system.

Compiling…

then you can start compiling binutils:

# cd binutils-2.20.1a
# mkdir obj-avr
# cd obj-avr
# ../configure --prefix=/usr/x86_64-pc-linux-gnu/avr --target=avr --disable-nls
# make
# make install

then onto gcc…

# cd gcc-4.3.6
# mkdir obj-avr
# cd obj-avr
# ../configure --prefix=/usr/x86_64-pc-linux-gnu/avr --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp --with-dwarf2
# make
# make install

then avr-libc…

# cd avr-libc-1.7.1
# ./configure --prefix=/usr/x86_64-pc-linux-gnu/avr --build=x86_64-pc-linux-gnu --host=avr
# make
# make install

Symlinking your libs and includes…

now on my system, there was a /usr/avr folder that the Arduino IDE definitely looks in for the includes and additional libraries. i had to symlink two folders in order for the IDE to work.

# ln -s /usr/i686-pc-linux-gnu/avr/avr/include /usr/avr/include
# ln -s /usr/i686-pc-linux-gnu/avr/avr/lib /usr/avr/lib

…and that was that. the latest Arduino IDE ran without a hitch.

for more detailed information, go here: http://www.nongnu.org/avr-libc/user-manual/install_tools.html

SCHEMATIC: TL082 9V Active EQ…

an experimental EQ circuit based of the TL082 datasheet. i modified it to use a 9V battery, but could probably still use some work in terms of efficiency… as most things. nothing is ever finished really. the mid portion has a pretty high quiescence. fine tuning, of course, can be done with the resistor values and more dramatic differences by adjusting the cap values. if you happen to build it, shoot me an email and let me know what you changed or decided to change.

also keep in mind that the TL082 is a little noisy, so 6dB of highs will add in some noise. i kind of like it myself, but the TL072 is a better choice from what i understand.

SPICE: ngSpice plot test…

nothing too special here. i’ve been practicing my SPICE skills and attempting to work with a single-supply active EQ circuit based on the TL082. further research of this chip has pointed out that the TL072 is better for audio applications, but it seems that the differences are pretty minuscule.

here’s the spice code with the subcircuit that i downloaded off TI’s web site.

* Spice netlister for gnetlist
XU1 n7 	n2 	n1 	0 	n4 	TL082
C1	n4	n6				10U
C2	n5  n7				.1U
RL	n6	0				1MEG
R2 	n2 	n4 				10K
R1	n2 	0				10K
R3	n1	n7				10K
R4	n7  0				3.3K
V2 	n5	0 				SIN(0 1 1kHz)
V1 	n1 	0 				9
.TRAN 0.01ms 10ms
.PLOT n5 n6
.END

* TL082 OPERATIONAL AMPLIFIER "MACROMODEL" SUBCIRCUIT
* CREATED USING PARTS RELEASE 4.01 ON 06/16/89 AT 13:08
* (REV N/A)      SUPPLY VOLTAGE: +/-15V
* CONNECTIONS:   NON-INVERTING INPUT
*                | INVERTING INPUT
*                | | POSITIVE POWER SUPPLY
*                | | | NEGATIVE POWER SUPPLY
*                | | | | OUTPUT
*                | | | | |
.SUBCKT TL082    1 2 3 4 5
*
  C1   11 12 3.498E-12
  C2    6  7 15.00E-12
  DC    5 53 DX
  DE   54  5 DX
  DLP  90 91 DX
  DLN  92 90 DX
  DP    4  3 DX
  EGND 99  0 POLY(2) (3,0) (4,0) 0 .5 .5
  FB    7 99 POLY(5) VB VC VE VLP VLN 0 4.715E6 -5E6 5E6 5E6 -5E6
  GA    6  0 11 12 282.8E-6
  GCM   0  6 10 99 8.942E-9
  ISS   3 10 DC 195.0E-6
  HLIM 90  0 VLIM 1K
  J1   11  2 10 JX
  J2   12  1 10 JX
  R2    6  9 100.0E3
  RD1   4 11 3.536E3
  RD2   4 12 3.536E3
  RO1   8  5 150
  RO2   7 99 150
  RP    3  4 2.143E3
  RSS  10 99 1.026E6
  VB    9  0 DC 0
  VC    3 53 DC 2.200
  VE   54  4 DC 2.200
  VLIM  7  8 DC 0
  VLP  91  0 DC 25
  VLN   0 92 DC 25
.MODEL DX D(IS=800.0E-18)
.MODEL JX PJF(IS=15.00E-12 BETA=270.1E-6 VTO=-1)
.ENDS