Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ericfont/6e9d99f2a6d436b6afb130159e940b1e to your computer and use it in GitHub Desktop.
Save ericfont/6e9d99f2a6d436b6afb130159e940b1e to your computer and use it in GitHub Desktop.
circuitjs for converting balanced audio into single-ended biased around 1.65v and remove noise.
$ 65 1e-8 263.0686190299136 63 5 43 5e-11
w -496 208 -336 208 0
w -496 384 -336 384 0
b -809 125 -356 485 0
x -796 79 -578 82 4 12 Model\sof\show\sthe\sbalanced\saudio\scomes:
x -797 101 -436 104 4 8 •\s60\sHz\snoise\s(B)\sfrom\spower\slines\sgets\sadded\sin\sphase\sto\soriginal\ssignal\s(A)\sand\sto\sinverse\ssignal\s(-A).
209 -128 384 -208 384 0 0.000009999999999999999 1.6190470112865065 1.65 0.1
209 -128 208 -208 208 0 0.000009999999999999999 1.6505183937354877 1.65 0.1
212 -624 208 -576 208 0 2 a\pb
g -528 416 -528 448 0 0
g -528 240 -528 272 0 0
w -672 384 -672 208 0
w -688 320 -688 416 0
w -688 416 -656 416 0
w -688 320 -688 240 0
w -688 240 -656 240 0
403 -480 208 -368 272 0 0_16_0_135170_1.25_0.1_-1_2_0_3
403 -480 304 -368 368 0 1_16_0_135170_1.25_0.1_-1_2_1_3
212 -624 384 -576 384 0 2 -a\pb
x -761 201 -664 204 4 12 A\sis\sdesired\ssignal
x -803 443 -639 446 4 12 B\sis\sundesired\snoise\sto\sremove
r 256 384 160 384 0 50500
w 336 288 352 288 0
403 336 208 560 288 0 21_16_0_x121102_5_0.000390625_-1_2_21_3
w 160 384 160 304 0
w 256 384 256 288 0
w 160 208 160 272 0
x -600 351 -545 354 4 12 V\s\q\s-A\s\p\sB
x -604 175 -553 178 4 12 V\s\q\sA\s\p\sB
b -193 175 -140 407 0
x -193 145 -129 148 4 12 AC\scoupling
x -191 154 -141 157 4 8 Big\scapacitors
x -191 171 -121 174 4 8 •\swhile\sisolating\sDC.
x -644 185 -532 188 4 8 original\ssignal\s(A)\splus\snoise\s(B)
x -639 363 -524 366 4 8 inverse\ssignal\s(-A)\splus\snoise\s(B)
x -192 162 -118 165 4 8 •\spasses\saudio\sfreqs.
x -135 103 -46 106 4 8 •\sCenter\sinputs\s(\a\soutput)
x -465 202 -381 205 4 8 signal\s(A)\splus\snoise\s(B)
x -486 378 -371 381 4 8 inverse\ssignal\s(-A)\splus\snoise\s(B)
x -132 95 -40 98 4 12 1.65v\sDC\sBiasing
v -752 416 -688 416 0 6 40 0.1 0 0 0.5
w -752 208 -672 208 0
R -752 384 -784 384 0 3 60 0.5 0 0 0.5
R -752 208 -784 208 0 3 3506.5 0.76 0 0 0.5
s -656 384 -624 384 0 0 false
s -656 208 -624 208 0 0 false
s -656 416 -624 416 0 0 false
s -656 240 -624 240 0 0 false
w -672 384 -656 384 0
w -672 208 -656 208 0
O 384 288 544 288 0 0
r -528 208 -496 208 0 50
r -528 384 -496 384 0 50
x -802 461 -737 464 4 8 •\splus\swhite\sNoise.
x 319 152 449 155 4 24 clean\soutput
x 323 166 446 169 4 8 •\stwice\soriginal\ssignal:\sA\s-\s(-A)\s\q\s2A
x 325 176 435 179 4 8 •\swithout\sany\snoise:\sB\s-\s(-B)\s\q\s0
x 325 184 456 187 4 8 •\scentered\saround\sVhalf_bias:\s\p1.65v
x -802 451 -677 454 4 8 •\sharmonics\sfrom\s60\sHz\spower\slines
x -797 90 -424 93 4 8 •\sSignal\s(A)\sis\swhat\sis\sdesired.\s\sA\sis\ssent\sin\sboth\sregular\sand\sinverted\sform,\sbut\salong\swith\sundesired\snoise.
x -797 112 -480 115 4 8 •\sThere\sis\ssome\soutput\simpedance\sand\sresistance\salong\sthe\swire\sI've\sgrouped\sas\s500\sohm
c -336 208 -336 272 0 1e-9 -0.7381283997450289 0
w -336 208 -272 208 0
g -336 272 -336 288 0 0
g -336 448 -336 464 0 0
c -336 384 -336 448 0 1e-9 0.7379074857650534 0
w -336 384 -272 384 0
c 288 464 288 384 0 4.7e-12 -0.19354673065438946 0
g 288 464 288 480 0 0
w -64 384 0 384 0
w -96 208 64 208 0
w -64 384 -128 384 0
x 397 330 633 333 4 12 Clipping\sdiodes\sprotect\s3.3v\smicrocontrollers
b 666 415 366 314 0
w 256 384 288 384 0
b 334 495 258 410 0
x 242 505 344 508 4 12 Remove\sMhz\snoise
x 101 164 207 167 4 24 subtractor
x 324 194 434 197 4 8 •\sclipped\sto\srange\sof\s0V\sto\s3.3V
x 325 203 519 206 4 8 •\sno\snoticible\sdistorition\sbetween\s0.15\sV\sto\s3.15\sV\sor\sso
x -354 192 -282 195 4 8 filter\scellphone\snoise
b -354 197 -281 482 0
x -237 61 629 64 4 28 Convert\sBalanced\sAudio\sto\srange\sof\s0v\sto\s3.3v,\scentered\saround\s1.65v
x 400 340 660 343 4 8 •\sred\sLED\sturn\son\sslowly\sto\sindicate\sgetting\sclose,\sand\sbright\swhen\sexceed
w 384 304 384 288 0
g 384 432 384 448 0 0
x 400 349 662 352 4 8 •\sin\sseries\swith\s2.0v\sZener\sdiode\sas\ssecondary\sprotection\sto\shard\scut\s>3.3v
w 384 288 352 288 0
x 75 175 240 178 4 8 •\sremoves\snoise\s(B)\swhile\spreserving\ssignal\s(A)
w 112 208 160 208 0
w 0 384 32 384 0
34 fwdrop\q2 1 9.32e-11 0 3.3479240811663615 0 1
162 -96 208 -96 240 2 fwdrop\q2 0 1 0 0.01
162 -96 176 -96 208 2 fwdrop\q2 0 1 0 0.01
34 zener-2 1 1.7143528192810002e-7 0 2.0000000000000084 2 1
z 384 432 384 368 2 zener-2
34 fwdrop\q1.6 1 9.32e-11 0 2.6783392649330895 0 1
162 384 304 384 368 2 fwdrop\q1.6 1 0 0 0.01
x -135 110 -20 113 4 8 •\sLED\sturns\son\swhen\ssignal\sinput
x -135 118 30 121 4 8 •\sLED\sbrightness\sindicates\show\sstrong\ssignal\sis
g 208 320 208 336 0 0
r 160 384 64 384 0 50500
w 32 384 64 384 0
w -272 208 -240 208 0
w -208 208 -240 208 0
w -272 384 -240 384 0
w -240 384 -208 384 0
r 64 208 112 208 0 50500
w -528 224 -496 224 0
w -496 416 -464 416 0
w -768 336 -704 336 0
g -752 416 -768 416 0 0
r 112 208 112 256 0 50500
209 112 256 112 288 0 0.000009999999999999999 1.6491060893706375 1.65 0.1
g 112 288 112 304 0 0
w -128 208 -96 208 0
g -96 288 -96 304 0 0
r -96 240 -96 288 0 3970
R -96 128 -112 128 0 0 40 3.3 0 0 0.5
r -96 128 -96 176 0 3970
w 336 288 304 288 0
r 256 288 304 288 0 130
409 160 288 256 288 3 0.6 0 0.023100000000000002 2
R 208 256 224 256 0 0 40 5 0 0 0.5
o 49 8 0 x123102 3.0664396061001256 0.0001 0 3 23 3 25 3
38 42 F1 0 0 2 -1 Max\sVoltage
38 42 F1 3 10 10000 -1 Frequency
38 97 F1 0 1000 100000 -1 bottom-resistance
38 103 F1 0 1000 100000 -1 top-resistance
38 115 F1 0 1000 100000 -1 green-LED-resistance
38 113 F1 0 1000 100000 4 \0
38 20 F1 0 1000 100000 2 \0
38 108 F1 0 1000 100000 3 \0
@ericfont
Copy link
Author

rev 5 has limiting output using 130 resistor in series with zener diode of 3.3V, thus output never goes above 3.3V.

@ericfont
Copy link
Author

ericfont commented Apr 1, 2022

rev 6 uses two 1.6v LED diodes in series, in parallel with a 3.3v zener diode, to provide a smooth clipping around 3.2v and then a hard clipping at 3.3v:

parallel_leds_and_zener_backup_protection

@ericfont
Copy link
Author

ericfont commented Apr 1, 2022

@ericfont
Copy link
Author

ericfont commented Apr 1, 2022

that simulated omp amp is LM324. Earlier revisions seemed to work physically with LM358. I will try some more opamps.

@ericfont
Copy link
Author

ericfont commented Apr 2, 2022

It may be possible to remove the top line's input resistor and resistor though capacitor and maybe that capacitor too...the top line LEDs can probably act as the top input signals escape path.

Also can use "dual potentiometers" to control two resistors at the same time equally. Like control the input attenuation at both inputs.

@ericfont
Copy link
Author

ericfont commented Apr 5, 2022

rev 8 uses shared sliders for resistors:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment