Tag Archives: Electronics

Elliptics network cloud and lookup requests

Currently elliptics network only supports plain lookup command, which will only tell the node address where object is supposed to live in given configuraion, but it does not check whether object is actually placed there.

So, to find out precise location of the data one has to perform at least two steps – lookup a node, where it is supposed to be, and issue direct request to that node to read part of the data. It is not very effective, so plan is to extend lookup command to perform actual object ‘touch’ if requested.

To date I kind of implemented needed FastCGI elliptics network daemon which lookups nodes according to URL it got, but it is rather limited from configuration point of view, i.e. there is a fair number of data hardcoded in the daemon, which should actually be read from config. I plan to use various environment variables FastCGI daemon is able to read to put there remote node addresses to contact, transformation functions to use, various timeouts and so on.

Also this daeomon will be the first user of the extended lookup command (yet to be written :).

Stay tuned, I plan to complete this whole setup and implementation this week and run some tests to find out whether solution with the direct data URL instead of getting it via elliptics network API is a good idea and what problems can be found in such installation.

Static HTTP content elliptics network

I decided to use fastCGI application to lookup needed node and use static processing web server to actually give it away.

To simplify things as much as possible following setup will be created: multiple server nodes will be combined into elliptics network cloud, where they will be ‘separated’ into multiple groups, where each group will correspond to some datacenter. To find out how this will be implement one can check homepage description related to redundancy and load balancing.

Each server will host a lighttpd server, which will be configured to give away some static data. URLs for that data will be generated by the appropriate fastcgi daemons running on the same servers. Each fastcgi daemon will be connected to the cloud as actual node, so it will be able to forward requests. Their main work will be actually to form static URL. Getting that there will be no updates in this setup at all (data objects will be loaded via external scripts into location, which elliptics network nodes can find), fastcgi daemon will be rather trivial.

So it will get data request, hash it into ID, lookup corresponding server within the cloud and return direct URL to that node and redirect status. Browser will receive 301/302 status reply and will connect to given node to actually fetch the data.

Currently there is no way to determine if object is actually present on given node in LOOKUP request, so fastcgi daemon can issue multiple lookup commands and return list of URLs where it can be found, so it will be a client job to run them one after another if no object was found or host is unaccessible. Or I can use read command and fetch 0 or 1 byte in fastcgi daemon to really find where object lives and determine if it is not accessible by one or another ID. Getting whole data object in fastcgi daemon is not a good idea, since files are rather big, number of daemons is very limited, clients can be connected over slow links and so on. Better model for such case could be a lighttpd plugin, but it is a different story.

In any way, fastcgi daemon’s job in this setup is to find the server and form direct URL to the object, which means that data can not be stored in the database, but should live in files only, which will be processed by the static-giving web server.

That’s the plan. So far I wrote my ever first fastcgi application, which so far only writes query parameters into the log. It is rather trivial, but I also managed to configure lighttpd and understand how the hell it can process different queries, which actually took a little bit more.

I believe most of the task is done. Almost :)
Its time to move home, omg, its tomorrow in Moscow already…

Building a lidar from the computer mouse

Actually it is not possible since IR diode, used in the mouse to track a speed of the ball, emits that kind of light which is almost not reflected by the surfaces, although it easily passes through the paper and not through the metal. It also decreases exponentially with the distance as shown below.

First, I found an electronic board from the old mechanical computer mouse, where IR diode and photo-transistor are used to track the speed of the ball rotation in the different directions. I do not know models of the components (and they are not written on the bodies), but electronics shop suggested that it looks like KingBright’s components, at least I used its datasheets and things worked.

Optical emmitter and detector are rather trivial. To implement a signal source I connected IR diode to the square signal generator. Detector is a bit more complex, it uses single operational amplifier, resistor and transistor itself.

Optical line

Signal will be reversed in this scheme. Let’s see how received signal strength depends on the frequency of the source. Signal source (about 5.3 V amplitude) was placed about 20 mm in front of the receiver.

Signal strength

Practical result with the cheapest IR components shows that it is possible to create upto 20 kHz optical data link for the hand-held devices, and with some tricky data extensions (like detection of the signal by its rising edge, since used transistor is quite slow and is not able to properly detect the level) upto 200-300 kHz. Of course we will have to use some redundancy coding scheme like LDPC encoding (source and the graphical demonstration of the recovery process can be found on the above link) perfectly suitable for this purpose. One can also combine Reed-Solomon encoding with the probabilistic LDPC one (similar scheme is used to communicate with the satellites, but iirc it is patented).

But let’s return to our IR data link. How does the strength of the signal decreases with the distance to the source? Pretty dramatically.

Optical signal strength depending on the distance between signal source and receiver

Our IR signal will not spread more than several santimeters from the source with the given power of the IR diode. Essentially this exponent (and the pulse spread) forces real radars to use so huge power in each pulse that bird which happend to fly in the gaussian area of the impulse will be (sometimes completely) burnt.

So, it is not possible to create neither lidar nor somewhat long data link using IR components from the old mechanical computer mouse, but if we will use powerful laser diodes (like those in DVD players, which can damage an eye), things should be much better I think. Want to buy a DVD, crack it and run some experiments…

Stay tuned!

Operational amplifier and DC detection

To implement a protection scheme for the power amplifier I want to create a DC detection circuit. I decided to use opamp for this goal and main design issue is to put its rectified output (I used trivial repeater scheme) to the inverting input (non-inverting input is connected to the line to be checked for DC presence, like loudspeaker line or sound amplifier output, via simple RC integrator filter with the very small cutting frequency like 1 Hz).

If we put a capacitor between rectified output and the ground, it will become a peak detector (showed with the switch). One can connect output wire to the input of the opamp-based repeater (not shown) if needed.

DC opamp power detector

So far so good in the theory, but let’s check the practical results.

I implemented this simple scheme using NE5532 opamp chip, which has only two power supply inputs (like most of the others actually). Since I only work with the single-supply unit (although my lab PSU has two variable outputs, which I still lazily did not connect to each other, iirc there is even special serial mode for this), I connected negative voltage as a ground.

And got a complete crap. My first idea was of couse that something is wrong with the schematic (and it still may be the case :), so I ended up with the trivial repeater without any additional details to check the basics. And got this.

Opamp strange cut

I virtually spent several hours trying to understand what the hell did happen. I even thought that I burnt the chip, or that scope introduced so heavy interference, or some other fantastical ideas, but not the fact, that chip was connected to the single power supply unit, and thus its negative point is not a negative supply, but something very strange like the ground, i.e. it is biased by the half of the voltage.

So, I did not really test my scheme in practice, althouth found that it works as a positive peak detector, since input bias does not affect the maximum found voltage. Unfortunaltely DC detection, which should drop output to the ground when there is only AC voltage component, did not work because of the above operational amplifier bias.

Next time I will test it with the differential power supply. If it will detect the DC in the line, I will combine LM3886 chip with the simle NE5532 preamp, DC and loss-of-the-supply detectors and muting circuit based on them and the appropriate LM3886 function. First, it will be implemented not on the PCB, but as a two (or even four) channel amplifier on the kind of stripboard. If things will work well, I will start thinking about PCB and the proper cabinet for the whole amplifier.

The electronics day: DC supply and loss detection experiments

I found in practice that my dc supply detection scheme does not work, since, as expected in the first comment, operation amplifier will follow the non-inverting input signal and produce the output signal which will have effectively the same DC component. I also was not able to test the theory with the single-supply operational amplifiers, since it happend that op-amp chips do not support this: they only have two pins for the power supply and this is actually enough.

Since my DC detection scheme failed, I lazily analyzed the ones used in the bi-amp protection cicuits, and found that they are simple enough for me to understand and implement.

I will not use relays to switch off the loudspeakers (since I basically do not have the components), instead I will implement a simple enough addition (or actually change the relay control circuit from the above link) to turn off the mute current supply transistor, which will switch LM3886 into the silence mode when there is no power supply or it is not yet stabilized, so that amplifier output ‘feels’ that.

Also found a very interesting note on how this things are usually implemented. The first, AC supply turns off very quickly compared to DC one (likely because of the output filtering capacitors), so every loss-of-the-supply detection scheme should be attached there (I will not implement some cabinet stackable solution, but instead attach it to the rectifying bridge). Contrary turning-on detection scheme usually is not implemented, and instead a mute timer is used. I’m not ready to design it out of the head, but expect that it is somehow related to the capacitor charge and the fact that diodes (or transistor) eat 0.6 V of the attached potential, so it could be possible to attach a transistor with the appropiate voltage divider, so that when capacitor is charged enough, transistor would be opened thus turning off the mute function (or allowing the current to flow into the amplifier). Charging time could be specified by the appropriate RC-circuit (and its 2*Pi*f relation). Since it is not really needed for the LM3886, I will not play with it now.

DC power detector

Usually every scheme requires some kind of a DC detector, which may be used to disable or enable the load when a DC is not yet stable.

Namely for the amplifier this may be crucial, since turn on and off PSU non-linearity results in a DC sneaking into the loudspeakers scheme, where it may damage the tweeter or at least produce very loud snaps.

Some amplifiers (like LM3886) have a special muting function which if enabled does not allow input signal to be passed through (amplified or not), which should be turned on each time supply DC changes (namely when turning on and off the PSU). Other amplifiers may have relays attached to the loudspeaker circuits to detouch them.

Before going to sleep I decided to think on the DC non-linearity detection problem, and that’s what I ended up with.

DC power detector

If I got things right, when PSU is turned on, the DC increases non-linearly for some time (limited by the PSU filtering circuits), during this time operation amplifier should have half of the voltage as its non-inverting input, and thus the same on the output (DC gain factor is 1 because of the capacitor), which should open one of the JFET transistors, which control the mute current.
The same logic applies to the PSU turn off time (actually the second JFET transistor is not needed, it was added for the differential voltage supply, so that PSU turn-off time would result in a negative op-amp output).
It is also possible to add rectifying diodes after the amplifier.

So far it sounds correct to me, but may be completely wrong in practice :)
I will experiment with this scheme (hopefully soon) to be sure.

Weekend electronics day: single supply NE5532 preamp

By the people’s suggestion I bought myself a breadboard and decided to implement simple (I would even say trivial) single-supply NE5532 chip preamp. Let’s see what was done.

Single-supply NE5532 chip preamp made on the breadboard

Single-supply preamp schematic

I dropped PSU filters and Zenner diode voltage limiter, since used lab PSU with 15 V voltage.
‘Amplifying’ resistors are selected to be the same (and thus preamp actually becomes a real one with amplifying ratio equal to 2) and to be equal to the input chain resistance (single supply shift made as resistor-based voltage divider and input resistor) to minimize bias current. That’s why there are so many resistors on the actual scheme to match resistance.

Now the results.

Square wave signal

Square wave signal has noticeble peaks at the edges, let’s see them in details

Square wave signal peak details

Given the huge amplitude of the input signal (more than a volt) this may be not a limiting factor actually.
What is a real problem, is the input signal range as a whole. Since I used 15V as a supply voltage, its inner ground will be roughly at 7.5 V (there is an appropriate voltage divider attached to the non-inverting input signal), so having total output amplitude of 4 V may be not appropriate for the chip operational amplifier.

Big sine signal cut

Experiments showed that this chip preamp operates correctly when resulted output signal does not exceed 1/10 of the supply voltage (i.e. about 1.2 V max). Triangle and sine signals after some level (when input signal amplitude is about 3-4 V) start producing reversed output signal in the cut area above, i.e. in the middle of the cut line small sine or triangle signal starts growing.

Now question, why do we need chip preamp for the chip amplifier? I believe that the main reason for preamp is to allow to connect power amplifier which may have not very high input resistance, so small preamp with good characteristics (like huge input resistance and very small output one) will not distort small enough input signal. But I think that most of the modern chip sound amplifiers like LM3886 already have big enough input resistance (as all others they have differential amplifier as the first cascade), maybe not that high if would be built with field-effect transistors, but I wonder if that is ever noticeble.

Single supply LM3886 amplifier.

LM3886 datasheet provides a simple scheme for single-supply amplifier, which basically creates differential signal where ‘ground’ point is selected to be somewhat in the middle of the supplied input voltage. It is achieved by using n-p-n transistor, which base is connected to the resistor voltage divider, so it controls potentially big current simultaneously providing needed voltage after base-emmitter drop.

I already implemented this design, but it did not work good, apparently because of transistor (it either was broken or I connected it wrongly, since it is quite hard to find datasheets for the russian transistors and other active components). So I replaced it with Fairchild’s 2n3904.

And things exploded.

Exploded capacitor

History can not tell us what the input voltage had the exploded bypass capacitor, but apparently it was not enough. I remember it was something like 25V, but input voltage was just 30V. Explosion was quite loud and a bit ‘dirty’. Here are the only parts of the capacitor left.

Exploded capacitor details

So I replaced it with the 63V capacitors and reran the test. Somewhat surprisingly, there were no new explosions.

LM3886 single-supply amplifier output

As you see, it works not bad, without evident distorsions. I even connected single channel to the loudspeakers and dropped the headphone output signal in software, since it would be way too loud for the signal I used without amplifier. Someday I will test it, neighbours will not sleep safely anymore :)

With 25V input voltage LM3886 is not very hot (I did not connect radiator yet), apparently because amplifier drains only 20-30 mA current (as PSU tells me). This will grow when input (and thus output) signal is increased. LM3886 is closed when single-supply input voltage drops below 20V, ground point will be set at about +9-10V, and this is a limit for the differential input voltage. Without input signal there is a silent enough signal, it looks like a sine (at least it is something repeated), and I suspect mute function, since I use simple resistor as a current source and this may be not enough and polar transistor should be used instead. This is not related to the input signal or input voltage (since I use the lab PSU), but I may be wrong that lab PSU is great at it.

I will experiment with the operation amplifier preamp next. I want to combine two-channel preamps and LM3886 on some usable board (maybe even on PCB) and hide into the cabinet with the simple PSU I have transformator, Shottkey (or just rectifying bridge, I need to test both) diodes and huge capacitors for.
And I want to think about next scheme, but that’s already a different story.

Now I’m drinking the beer, listening my single channel audio system connected to the laptop and huge PSU. And you know, I like it.

The electronics night.

Ded Moroz (aka Santa Claus) brought me the new equipment, so my lab contains following items now:

  • soldering station
  • Rigol DS1102E scope
  • Victor VC2002 functional signal generator
  • Mastech HY3003-3 DC power supply
  • HP Compaq nc6000 laptop
  • mountains of electronic components
  • several convolutions of the brain, somewhat straighten arms and other physiological equipment

Lab setup

Electronic details will likely do not match my next scheme (frequent reader will obviously notice this essentially a rule), even although I have really lots of passive and (noticebly smaller amount) active components now. I got several rectifying bridges at least, so will not use part of the transistor as a diode, and couple of the stabiliers.

But we will see, and now let’s return to my first LM3886 amplifier with differential PSU, which did not really work like expected. I’ve attached differential signal from the lab PSU and volia, 20+ amplified output signal. That’s how it looked.

Medium frequency sine signal looks good. Well, it almost always looks good.

Low frequency square signal

It shows some problems, but apparently it is the generator, which is not able to produce correct square signal on the small frequencies. If you could see how it tries to do it at 1Hz and smaller frequencies. Looks like it does not use comparator at the output chain for the square signal and just relies on differential and integrating circuits of the operation amplifier, but I may be very wrong of course.

High frequency square signal

High frequency (about 15 kHz, not really high, but high enough for the sound amplifier) amplification produces some delay and stabilizing pike, but it is expected when working with interpolation active filters, which are likely used in LM3886.

Found interesting problems with my LM3886 amplifier and chip behaviour in general during my tests:

  • Amplifier differently drains input voltage, when it is turned on, I get -10V and +20V on the terminals. This may be related to the fact, that ground point in the PSU is not really a ground, since it is not ‘connected’ to the input voltage source, i.e. looks like current does not flow between ground and positive or negative terminals (when connecting voltmeter for example).
  • after some short enough time (about several minutes) amplifier stops producing output signal, I checked input voltage, and found that negative voltage dropped from -10V down to -8.5V. Experimenting with the input voltage I found that when negative input voltage drops below (in absolute numbers, i.e. -10 is ‘below’ than -20 here) -9V, LM3886 is closed and no output signal is produced.

I think input voltage flows likely because of some problems with bypass capacitors connection or wrong ground potential. That analysis I will keep for the next experiments.

Some new scheme will be implemented soon and likely be tested with the loudspeakers during the New Year vacations and celebrations. Stay tuned for the news (operation amplfiers, comparators, timers, stabilizers, bipolar (including Darlington pairs) and mosfet transistors, they all will be used for something I do not yet know exactly what :)!

Loudspeakers assembled.

Visaton loudspeakers

They sound just freaking awesome, very deep and powerful bases, extremely precise high tones and clear middle.

I attached them just to the headphones output of the notebook, so they are obviously not very loud, but they have enough reserve for the amplifiers I build (I will show something new soon with lots of new equipment).

Speaker’s crossover contains of three parts: two-level low-frequency filter for the woofers, high-frequency filter and Zobel circuit for the tweeter. Physically woofers are separated by the hidden wall, so effectively lower speaker has more than 30 liters of the closed space, so acts like subwoofer with kind of phase inverter. Its output hole located at the back of the loudspeakers and produces very low tunes.

I do not regret any second spent building them, excellent sound justifies the efforts.

Weekend – the electronics days.

This weekend did not bring something exciting, but still there are some things done.

First, to get the middle ground point in the +/-20V DC source I tried to replace resistor voltage divider with the capacitor one. I would not say it worked, since quickly after the start positive shoulder of the divider jumped rougly to the +30..32 V DC (from +20) and negative dropped by the same bias. Which likely moved lm3886 amplifier out of its voltage range and it did not open. Do not really know why that happend, but apparently using passive dividers is not appropriate way to create the differential signal for the operational amplifier, and there should be some kind of a feedback (to the input transistor for example) to prevent voltage draw from the middle point.

Second, I made two crossovers for the speakers being built.

Loudspeaker crossovers

I but did not test them yet, since there are no cabinets for the speakers themself. And here we come to the last, but not least, thing I spent my time on. Actually I devoted most of the weekend to this.

Loudspeaker cabinets

Plastered, polished, mordanted, varnished, so far with the first layer, it will dry couple of days, and tried to make a photo, which I did not succeed though: was not able to move things around or change the light (cabinets are close to black actually) so that not to make the varnish layer dirty.
I think it will be not bad, we will see (and listen of course, that’s the main goal).

Loudspeakers implementation.

Do you know what random kernel hacker can implement with several wood plates during the day?
If straightening his arms, he can saw the sound coffins for example.


That’s how this was made…

It was not something particulary complex project to implement, although I found number of wood-work gotchas and made several mistakes, namely confused narrow and wide cabinet walls, so speakers will be attached to the wide wall and not narrow how it was originally designed… Idiot.

But I still like how it was done.

First I thought on how to saw straight lines along and across the wood’s fibres.
The final implementation is rather simple.

Sawing the straight line

Without screw-clamps straight line sawing would be quite complex if not impossible task.

Screw-clams are the must have instruments in the wood workshop

That’s how coupled walls look like after being sawn.

Screwed walls

Walls stand themselfs, which means sawed edge is not bad.

But straight line sawing although not trivial, but possible without additional things. But how to make round holes for the speakers themself? Since I do not have appropriate instrument, even task of drawing them looks impossible.

Well, almost. After 6 years of the quantum physics studying, I can create appropriate equipment myself using one screw, strong wire and a pencil.

Rocket science of drawing the circles

Sawing them should not be very precise, since speakers have about 5-7 mm of the covering reserve, so it was not that complex.

You already saw the end result, but here it is again for the maximum enjoyment.


Loudspeakers are not yet completed, I will polish the surfact after bits of plaster are hardened, mordant cabinets to the ebon tree colour (expect it to be essentially black), cover it with varnish several times and attach back wall with small woofer (without phase inverter though, with the hole only), install speakers (they are not fixed on the picture), crossover and input jack.

Likely next weekend I will have my own self-made audio system… Stay tuned!

Question to the audience: how do you create PCBs?

And do you make them yourself, or buy from appropriate manufacturers?

I want to make simple enough two-layer (at most) PCBs myself, since I want to prototype and test simple enough circuits, and having standard textolite plates with holes is way too unconvenient especially when I need to change something: lots of wires, which hung and have to be rewired when some components were replaced.

I used to believe that ferrum chloride can be used to put away unprotected by varnish layer copper from the textolite, but never tried that myself.

Another way it so scratch isolation ‘roads’ on the copper and implement IC as a set of squares. This can be used to create single-side board without need to drill the textolite.

Are there other ways to implement circuit board not using extensive amount of wires and allowing simple component access?

Single supply amplifier. Loudspeakers design.

Weekend – time for the new amplifier!

This time it is single supply amplifier from LM3886 datasheet. Since I’m pretty sure previously built non-differential PSU is not that bad (although pretty trivial) for the non-stabilized voltage source, I expected single supply amplifier from the vendor to behave really good with it.

Single-supply chip amplifier based on lm3886

I was very disapointed, since amplifier I made does not really amplify the input signal, but instead outputs 4 times less signal than input one.

I turned on and off every detail in the datasheet which was marked as optional, tuned various parameters expecting some changes, but it just does not work as it should (or I thought). All DC voltages are correct, PSU should provide enough current, details match, but amplifier does not work.

First I managed not to connect ground input for the lm3886 chip, which I found during DC probe-and-analyze for the resulted scheme, when found that ground pin does not have potential of the ground. I wonder if this could lead to the chip’s death, since by the datasheet it is required to drain at least 0.5 mA from the mute pin to turn mute function off, but when I connect it via appropriate resistor (mute pin has about +20V potential iirc with +40V single supply input), even that silent sound dissapears. But if I connect a big enough capacitor (220 uF) to that pin and ground, I get a bit louder sound (still much less than input signal).

Actually single supply scheme in the datasheet works as a differential one, except that voltage divider turns on simple transistor based current source, which provides ground point and strong enough input current. So I suppose that I just burnt an amplifier chip, although it pushes the input signal to the output. Also changing negative feedback resistor (which creates amplification ratio) does not change output signal: I decreased it by the factor of two, and expected amplification ration to decrease from 20 to 10, but output signal was essentially the same. Whilte I wrote that I thought that maybe input transistor was killed, so very small current will be drained from the PSU and thus chip will not work as amplifier… Do not know.

So, next task is to implement another amplifier, now using own (simple) design based on what I read in The Art of Electronics to check the new knowledge, since while I moved quite far reading the theory of the electronic circuits, my practical skills (and more IC design experience) are far from being good IMO.

I use 9400 uF output filter capacitor (made of two 4700 uF) in PSU, but apparently it is not enough to completely eliminate low-frequency buzz, so I added another 6600 uF bypass capacitor (three 2200 uF) and still hear it when turning off the input signal. I use quick Shottkey diodes with small capacity in rectifiying bridge, but low harmonics sneak in. Probably I have to use stabilized source, which should eliminate them.

Now let’s talk about another work I’m doing at home right now: loudspeakers design.

Visaton speakers

I got Visaton speakers and wood plates for the audio system (I plan to build Visaton Clou speakers), and work has been started: sawing, smoothing, screwing, mordanting, varnishing, soldering, connecting and finally enjoing. The latter is postponed waiting for the appropriate amplifier to be built though.

Loudspeakers wood plates (raw (left), mordanted and single-layer-varnished (right)

If things will go smooth, I will have something to show tomorrow… And now will need to have some rest, since weekend sleeping routing became somewhat awkward: work upto 6 AM, sleep 7 hours, work upto 19 o’clock, sleep till 23, work upto 6 AM and so on. And it is 6 AM in Moscow…

Detailed guide in pictures to how not to build an amplifier.

You have been warned, this story will show how I did my first single-chip amplifier and PSU, and how you do not want to build it. For example there was a small explosion and other crappies, result is somewhat unexpected and described at the end of the page…

And now a bit of midnight electronics horror.

As I wrote yesterday, I somewhat implement single-channel single-chip trivial chip amplifier. To test the implementation I need a power supply unit. It should be simple enough, since LM3886 has voltage stabilizer built-in. So just transformator, four diodes to create a rectifier (I used Schottky diodes, it is possible to use usual ones, one can shunt them with capacitors), several huge capacitors to smooth out the resulted voltage, and resistor which will be used by capacitors to charge out when there is no load. Simple.

PSU. Version 1.0
Simple PSU. Version 1.0

Since most of the chip amplifiers use differential voltage, you likely have to have two PSUs, which will be connected in the middle point (+ of one and – of another) to create a ground. It is possible to use single supply, but it is rarely used.

PSU. Version 1.0
Closer look at power supply unit

Noticed different look of the PSUs? This is because they are different. Very different. What could be simple than 5 details scheme? Nothing, but even there one (read: me) can break things. Since I’m stupid enough not to properly count all needed details in advance, I got not enough Schottkey diodes and did not get any usual one at all. Actually I got exactly 8 Schottkeys, but I did not pay attantion that they are coupled with common cathode. Which basically means that 4 boxes can not create two rectifier bridges… So, I created one PSU with 3 diode couples, and still have single coupled Schottkey diod. Sounds as a deadlock? Not at all. As we know, each transistor somewhat consists of a pair of diodes. They can not be used simultaneously, since base controls current between collector and emitter, but I happend to have two yet unused transistors, so I connected their bases and emitters as diodes into rectifier bridge. I also shunted them with two small capacitors. That’s how it looks.

Detailed PSU view. Version 1.0
Detailed PSU view

Ok, both PSUs are ready, let’s turn them on and check the output voltage.

Turned on PSUs. Version 1.0
Turned on PSUs

Connected, turned on, attached voltmeter. Good. Almost. Actually not that good. Really bad I would even say. Voltage differs more than 10 volts, while AC voltage should be the same according to manufacturer. Since it is not stabilized PSU it could not that bad, but now it is not possible to connect them together to get ground point, since it will have about +10 V voltage. I was curious where and why exactly there is that big difference, so tried to put voltmeter probes to the transistors and managed to short-circuit one of the shunt capacitors to the input (note, that capacitor shunts single diode, so effectively it is connected to input and one of the outputs), so it got charged by more than 30 V AC. It could not be that bad, except that capacitors I used were only capable of working with 15 V. Result is quite expected.

Exploded capacitor in one of the PSUs
Exploded capacitor in one of the PSUs

Solder them out and replace with 250 V capacitors. Should be rock solid now. Probably, since I do not remember if base-emitter can be connected to 30 V AC. That’s how new version looks.

PSU. Version 2.0
PSU. Version 2.0

I also made a simple voltage devider using two 8 (iirc) kOhm resistors connected one after another, so that middle point could be a ground. With above changes I got about 29 V DC and thus about 14 V as a differential signal.

Connected to the amplifier, soldered connectors, started a signal from the notebook (audio output with about 20-30 mV amplitude) …

PSU and amplifier
PSU and amplifier

… and got silence output (well, there some noise about 10 mV which does not depend on input signal and was present even if there were no input signal at all). Removed all output filters, so that scheme essentially looked as simple operation amplifier with negative feedback to the inverting input, but still no changes.
Its time to look into the datasheet… And find out that LM3886 requires input differential voltage minimum 20 volts, I checked differential signal when amplifier was connected to the PSU and found that it is about 22-23 V, so it is close to the limit, but it should work.

Hopeless. No ideas. Finita la comedia. But I’m lucky. Some electronics gods decided to move my eyes couple of lines below input voltage description to the mute function of the chip. It happend that open or grounded mute pin means mute and 0.5 mA current means pass-through amplification. At least I wanted to believe that, since I actually was not sure how to translate that lines exactly. So, simple resistor to the pin and V-, turn it on and…

Amplifier output
Amplifier output

yellow is input and blue is output signal for some amplification ratio. I used my drop-headphones as load, and they do produce the amplified sound. Curious about its quality? Guess that…
It is awful :) So far I do not know where the crap interference sneaks in, but I will think, likely it is somewhere at the input chain or voltage circuit, since with and without the output filters results are the same.

But it is already very different story…

LM3886 amplifier. Take 1.

7 A.M. is the right time to write what was done (especially when hands do not hold things and head feels dizzy). I started to implement my first chip amplifer based on LM3886 chip. There are two main problems: absence of a good electricity circuit, so I use standard textolite with lots of holes and link details with usual wires on the bottom of the plate; and details I have. Or better say I do not have.

So I have to replace some with another. When I did that 15 years ago things never worked, but now I’m a little bit smarter (at least I used to believe that), so maybe it will be ok. For example if there is a filter for cutting frequency of 160 kHz, I believe I can crop it a little and replace inductance coil with ‘bigger’ one with appropriate resistance/capacitor change. That will change impedance dependency on frequency if I understood correctly, and that may be harmful, especially in loudspeaker crossover, but I will think some more on this problem, particulary there is only single resistor I do not have (powerful 10 Ohm one for Zobel’s circuit for the tweeter, there is only 2.2 Ohm, and changes there may be wrong) there and yet did not start the implemention. In some cases datasheet does not require exact parameters, although provide them, and shows an equation. So I increased several capacitors, one incuctange coil and changed some resistors.

Part of the LM3886 amplifier

So far I essentially finished gain stage of the single channel (not tested yet), next is to build a preamp/buffer for this channel, build a simple PSU (the simplest task actually) and test the results (oops, I have no loudspeakers, but I will look at the oscilloscope with small gain factor first). It is also possible to test this cascade without preamplifier, which I will likely do after PSU is finished.

Things may be screwed of course, but that’s the main feature: to experiment and find out (if possible) what went wrong and how to improve the situation.

The only reason to experiment with various things is just to answer a simple question: how it’s doing. Children do not grow up, only toys are changed :)

Amplifier, generator and something else.

Although in a bit disassembled condition. Starting the first chip amplifier.

A bunch of electronics

Although amount of details is enough to build a dozen of similar amplifiers (not exactly, there are only 5 operational amplifiers (ne5532) and only two main amplifier chips (lm3886)), I will build only one sound amplifier, generator (triangular and rectangular impulses) and will think about what to do with details after that. I have lots of ideas, but first I want to finish amplifier to get a little bit of experience. This reminds me how I started with linux kernel: read lots of mails and things looked like I know them, before I started practicing… I do not know it even now :)

It will be rather simple ampliier with two channels, one LM3886 chip per channel, and two buffer preamps. I have to admit, I got existing scheme from ixbt (in russian, link to IC image), since it has its characteristics already measures and shown good. Although I understood any detail in the scheme, and it looks similar to what was suggested in the datasheet, but still it is not mine. I read internet forums and found several simple extensions which will be used in the amp (like increased capacitors). Plus I will implement own power supply unit, which will be trivial though, since LM3886 can stabilize voltage itself: just a powerful transformator, diodes (I decided to use Schottky’s diodes and do not shunt them with small capacitors) and huge output capacitors.

I also booked and already read Bat’s book about amateur loudspeakers design and theory (С. Бать. “Любительские громкоговорители 3” (S. Bat’, “Amateur loudspeakers 3”), and while again undestood how to design and implement loudspeakers, decided to first try to build something with existing prooved scheme. So I ordered 6 Visaton speakers to build something like its Clou system. Did not yet get wood though. Speakers will be delivered next week, although already it will be a bit different, since bass speakers will have 4 ohm resistance instead of 8 (there are no appropriate speakers in Russia yet).

Let’s see how all this will end up. I expect something extremely interesting. And now back to the drawing board to design some connection circuit for the amplifier.

The amplifier.

Finished reading operational amplifiers and feedback chapter of The Art of Electronics, so its time to apply my new knowledge to the practical exercise, so I decided to implement a simple enough (sound) amplifier. I also want to create speakers, since I do not have a sound system, but easily work with wood plates, screws and math.

Since I do not have neither common details, nor more specialized set for particular amplifier, I’m about to dig into www.diyaudio.com to find out some advice on what chip to use (I do not need a schematic, since want to calculate it myself based on vendor’s data and own expectations) and to find out details on speakers build process and calculation, iirc there is appropriate forum topic there.

Another must-have instrument I’m about to create with operational amplifier is rectangular and triangular generator to test amplifiers, the only problem is to create sinusoidal generator, which is a next chapter though :)

I checked the electronic components shop and found way too many different amplifiers from micropower upto 2x100W monsters in a single DIP package, so if things will not be 100% clear on what to select, I will just pickup several random chips and check theirs characteristics one by one until find out something appropriate. I think I can get several different chips and compare the resulted amplifiers as long as speakers are ready, so expect my first steps in this area described here sooner than later.
I’m pretty sure there will be not only negative experience :)

Microchips (lm317, maxim3232).

Another couple of trivial schemes I managed to make (quite long ago actually): voltage stabilizer (lm317) and dc-dc converted (maxim3232) used to connect digiatal GPS receiver (some brand started on letter X) input/output (3.3-5 V) to rs232 (12 V).

These are actually pretty much trivial, there is no way to make a mistake there I think.

LM317 voltage stabilizer, diode, couple of resistors and capacitors

Maxim3232 DC-DC converter connected to X-something branded GPS receiver

You know, it does work (i.e. digiatal GPS receiver inputs/outputs (3.3-5 V) can be connected to the analog 12V RS-232 via Maxim DC-DC and LM317, and nothing breaks), which is likely an exception from the rules, than a rule, for my electronic devices :)

Solid state amplifier.

I got new toys and decided to make a step into the practical electronics.
Here comes a short description with pictures of the trivial solid state amplifier creation journey.


Working place

I created simple solid state amplifier with single transistor (common emmitter scheme), couple of filters, and set of resistors. I calculated it from scratch according to excercises in “The art of electronics”.

Theretical calculations

Unfortunately I do not yet have lots of details (if you could see my stocks 15 years ago). Instead I only have an old broken rs-232 mouse, old casette player board and three transistors I managed to find in the box. Also set of chips I do not yet know anything about.

Components I have

So, practice does not match the theory even remotely. Well, that’s where the main part of the hacking starts: to do what you decided to do using tools you have right now. So I started to recalculate the scheme according to my components set (for example decreased input impedance by the order or 100, which in turn decreased input voltage, which in turn resulted in a very unstable transistor input point and so on). But nevertheless…

Oscilloscope input (lower) and output channels

As you can see, it works and even amplifies by the magnitude of 2-3 times. Because of bad components set amplifier is quite unstable: for example with small output load resistance it frequently moves into saturation and some circuit part starts resonating, also quality is rather bad (with high enough noise level especially when there is no input).

Here is the result

It works. And the first step has been made. At 5 A.M.
Now move to the third chapter of “The art of electronics” and operational amplifiers with the proper feedback.