Simple function generator pt. 5 – XR2206


This is translated archive post from my polish language blog. I will be successively post translated version of some of my archives.

I had shortages in free time recently, but I try to complete all the projects that I have currently opened, so it’s time to get rid of that one too. And it was this lack of time that led me to revise my noble plans to develop it from scratch – I decided to use the ready-made generator circuit.

Ha. Good joke. It is easier to say than to do. In THT technology there is probably no longer any producer who would sell something like this. There were cult systems, one could say, but they have gone down the line of history, and if you want to buy some of them, you have to prepare yourself for the expenses….

So, we once had a choice of:

  1. ICL8038 – up to 300 kHz, withdrawn from production in 2004. Theoretically, it can still be bought from some stock.
  2. MAX038 – with a very broad spectrum (up to 20 Mhz), precise, very widespread and popular, not produced since around 2008. I even was considering it for a while, but the basic drawback of it – through its functionality, was the price, which now can reach even over 30$ per unit. I’ve fear of buying i t anyway, because after Maxim withdrew it from production, it was massively counterfeit in Asia. And to pay more than 30$ for something that can be a fake is a pure nonsense.
  3. Integrated circuits of EXAR production, including XR-2206. Complete average comparing to the above two. It is possible to reach the frequencies around 1 Mhz on it. Common, due to Chinese DIY generator modules (with very poor design). Mass counterfeited, but thanks to this fact all the time quite cheap (although in principle the chance to hit a fake one is very high).

One can try to create something using DAC circuits, but the main problem with such a solution is the scale of integration – I don’t want to lose my nerves and time for soldering with the accuracy of millimetres.

Looking for some reasonable alternative that is not a Chinese scheme, I found the TAN-005 application sheet and I realized that there is no further reason to look for one. This is it, it meets all my requirements, in fact I have all the parts, except for a few potentiometers and the Exar circuit itself…. which I bought on for around of 6$ with shipping.

I draw the schematic in KiCad, created myself a PCB pattern and soon I intend to close the subject of the generator to the workshop once and for all.

If someone is interested in the effects of my work, the complete KiCad project is downloadable – here.

Simple function generator pt. 4 – Reset


This is translated archive post from my polish language blog. I will be successively post translated version of some of my archives.

I spent several dozen hours with this system. Analyses, theory reading, measurement, reworking. Nothing. It does not work. And I have no idea how to force it to work. Everything is OK in theory. Simulations, as you can see, worked, but… not all of them. In TINA-TI 9 I couldn’t force it to work. I suspect that this has something to do with the initial parameters – but in order to get the subject complete, I didn’t even manage to run something that is shown as a rectangle generator in the LM324 documentation (page 17, fig. 27…).

I give up…

What does not mean that I am not going to do it anymore, but I will try to use a different operation amplifier for this purpose, the TL082.

My polish post also contains several dozen of references to the documents and theorems about operating amplifiers, but in polish language, so I skip that here.

Simple function generator pt. 3 – Errare humanum est.


This is translated archive post from my polish language blog. I will be successively post translated version of some of my archives.

How could I have been wrong? Yes, attentive observers probably noticed that in previous schematic, apart from the first one, each of amplifiers was connected in reverse. Invert output connected to ground…. *double facepalm*

This annoying routine…. I drew these layouts several dozen times, always for the convenience of drawing inverting ones on top…. and starting to work in this KiCad routine got me. I didn’t notice that by default the layout has + on top…. and so it went. While checking, I analyzed the network of connections and did not pay attention to the reversed operational amplifiers….

So what should it look like? That:

Well, I should pay attention in the future.

Simple function generator pt. 2 – not so simple


This is translated archive post from my polish language blog. I will be successively post translated version of some of my archives.

NOTE – The diagram below is not correct. It will be explained deeply in the next episode.

It was supposed to be a simple weekend job, which turned into a caring for the layout and wondering what was not working. But one after the other.

First I made a diagram in KiCad.

I’ve etched the tracks, made PCBs.

I put together the elements and solder them to the board.

I powered the circuit, connect an oscilloscope and…. nothing. It does not work.

Path analysis showed that there was a lack of connection between the first RC bridge and the operating amplifier, but restoring the connection came to nothing because…. the circuit does not produce rectangle at the beginning. And I do not know why, because this part should work.

At some point I looked at the documentation of the LM324N system and found a slightly changed schematic there, in place of R1, R2 should be 100k, and the whole system should be additionally controlled by the voltage supply connected to the positive leg (+) of the first amplifier via the 100k resistor.

Such a system started to work, I managed to generate variable square waveforms controlled by a potentiometer… but it won’t run through integrating amplifier … that’s why at the moment only one phase is working for me. Now I have to think about how to transform the whole system in order to start the next stages….

Well……. This will not be an easy task. Also, the course of squarewave is not perfectly rectangular, but that’s was expected.

Simple function generator pt. 1 – Design


This is translated archive post from my polish language blog. I will be successively post translated version of some of my archives.

Looking for a very simple function generator, I’ve found out such a diagram.

It’s a very simple generator, based on the astable multivibrator as a comparator. It generates rectangular waveforms, which are then passed through the op amp integrator, producing a pretty neat triangular waveform. The higher harmonics are then cut out from the triangle, resulting in a sinusoidal. Simple use of simple elements.

The system has its drawbacks. The largest is this cutter. It limits the bandwidth because for higher harmonic frequencies it will fall above the filter bandwidth and low frequencies will be distorted. The second flaw is a variable amplitude depending on the set frequency.

I’ve simulated this system – here. You can see how the change of resistance on the potentiometer (“Resistance” on the left side) affects the sine amplitude.

The amplitude changes can be partially compensated by setting the amplification on the last operational amplifier. This can be done using a reversing amplifier system controlled by a potentiometer (equations).

The second option is to choose a different type of potentiometer and resistors on the final operating amplifier and equip the system with the “GAIN” control gauge.

Final system simulation – here.

And that is the task to do in one weekend.

Funny spam…

Even the ordinary spammers have their moment of surprise…

This one almost get me…. censored, for not advertising those pathetic solutions.

Well, they could give up already. I read every comment before I post them, so there is no chance to publish something without my permission. And I put those IP on the black list. You can even break the “Captcha Three-Zillions”, but can’t get past the masters attention, you rats.

Workshop improvements

So, I’ve cleaned the workshop, but where I should put my workshop laptop?

I have no space for my laptop, due to little space I have for my entire workshop. I have to think about some alternative solution.

Let’s see, what is necessary for laptop to work.

Well, reduced to simple motherboard, it have the potential to improve.  And I have this thought, why not hang whole set on the cabinet door, that it will be super accessible when I work. It should fit, and if i hang only necessary parts on them, it should not be overweighted. So, I’ve start to cut the wood for the new laptop casing.

I’ve started with cutting holes in first part:

Then I’ve fit the first part with the bottom part:

After some similar work on the other parts:

The front lid requires a power switch. Now, at first I have a thought to solder new switch on the wires, but when I think of it, I decided to use front lid from the laptop casing itself, so I had keyboard indicators and speaker holes.

In  the meantime, I also made power supply holder:

and the ventilation intakes for the CPU and GPU cooler.

After gluing the wires, WiFi antenna, speakers, mounting the HDD and other required elements:

It’s time for hang the monitor and first tests:

It works, so I added more improvements:

Front view:

After some use, I’ve decided to restore the laptop LCD, because some of the boot processes or legacy consoles will only appear on main display, which is the laptop one, not the one attached to the VGA output. This is not changeable in BIOS, either.

So I made it. Another fine job!

Own bench power supply 0-30V 0.002-3A, part 3


This is translated archive post from my polish language blog. I will be successively post translated version of some of my archives.

This fan control system I’ve mention, it’s not so obvious, because our favorite designer of the AVT2857 kit, had to do it opposite to common sense. This means that at the output of the thermostat the normal state is high, which after reaching the preset temperature reaches a low state. In addition, the thermostat output from the circuit is pulled directly from the integrated circuit’s leg, so direct control something ( e. g. relay coil) with it, is not possible without damaging the circuit, but after so many circumstances, I was like “one way, or another I will do it”.

And I came up with something like that:

As I thought, that’s how I did it, I bought a computer fan (80mm 12V), which matched the heatsink I used, bought a 5V coil relay, picked the N-MOSFET 2N7000G and here I showed amazing consciousness of mind, because I bought four of them.

I drew a layout of PCB on paper, redrawed on the laminate, etched, cleaned,  drilled holes, folded, connected and…. shit happens. Normally (due to the high state at normal on the thermostat output) the relay should be switched, so the fan, which is connected in the “normally closed” position should not work, but it does, so the relay was not switched.

What the f….?

Crap. I drew everything the other way around. Means, instead of MOSFET source on the ground, it landed at “+”… redneck all the way… I throw out broken MOSFET to rubbish, and I draw PCB layout again.

The PCB was etched, time for the components.

Compounded, polished, connected…. the moment of suspense…. daaaamn…. not working. Similar situation. I measured the voltages, the potential difference between the drain-supply is +5V, what is going on? Control current +5V present.

In the first though I think this is a relay not working, Chinese for around 0.5$, it could be broken and not to work. So i started to analyze all elements, and it turned out, that another MOSFET was broken, probably due to the static electricity. It’s nothing. I have soldered it again, and this time it worked. Yay! The project can be considered closed.

Here, without a fan:

Zasilacz warsztatowy v2

And here after I completed it:

I’ve added the FINE potentiometer along with the standard one (COARSE), since I had difficulties in setting the valid supply power.

That’s it.

Own bench power supply 0-30V 0.002-3A, part 2


This is translated archive post from my polish language blog. I will be successively post translated version of some of my archives.

We ended up purchasing an AVT2857 kit to mount it as a voltmeter and ammeter for the power supply. It is really interesting circuit, indeed, a construction that shows on how difficult it is now to have a good electronic designer in Poland. I study the kit instruction briefly and starting to swear. It has a reference voltage of 2,047V from the voltage divider(!!!). It measure voltages within the measuring range from another voltage divider…. oh crap. The prepared tape transformer for the power supply, together with the bridge, came back to the drawer, and in the second drawer I beginning to search for a stabilized power supply, because of the voltage drops on the bridged transformer. I swear badly.

Fortunately, I used to have an external HDD enclosure. The enclosure has a power supply, pretty good, +5V and +12V outputs, 2A on each…. Enclosure lies down and hesitates, so after thinking a little, I grab a modeler grinder and I started cutting the casing. This is how I solved the topic of powering this voltmeter circuit. I can start to calibrate the voltmeter circuit, and since I have ALDA brand, model DT-830B multimeter from the early 90s, I did not expect any trouble ;).

And I fall back to the reference voltage. Someone came up with the “brillant” idea that 2.047V will be a good reference, where popular multimeters in our country (read cheap) have a measuring range of up to three significant numbers up to the 2V range, so I won’t be able to calibrate it precisely. So I wonder, was the creator of this kit sane? Probably that is how he ended using random selection of elements (but cheap), instead of thinking… I struggled, I was carefully turning the calibration potentiometer until the display jumped from 2.01 to 2.00, and I made a little movement down. This should do the trick, setting reference voltage in truly redneck style. The next step is to calibrate the individual range inputs from the divider. In the manual, I read:

“(…) provide supply voltage of known value, e. g. 5.00V to the measuring input. It can come from an adjustable power supply or an external voltage divider. At input 23 (PC0) You should set 1:10 of the provided voltage – in this case it will be 0.50V. At input 24 (PC1) , by using PR4 potentiometer, we should set voltage to provide 1:100 of the measuring voltage , in this case 0.05V. The calibration of the differential input is performed in a similar way. On inputs 26 (PC3) and 27 (PC4) potentiometers PR5 and PR6 set the standard voltage at 0.50V-1:10, which in this case should be set to UA input and then UB input”.

Is it that simple? I don’t think so. There was an opportunity to test the power supply, but after carrying out the calibration, folding the system, the differences between ALDA and the kit were gigantic. And then I read that although it is possible to reduce the inaccuracy of the reference voltage, by setting the reference point programatically, but:

“We must remember, however, that we will not be able to obtain ideal readings across the entire range of voltages because of the existing non-linearity of the A/C converter”.

That was killing me…

I was thinking a little on this information, finally I decided to buy a decent multimeter. My choice was Kyoritsu KEW1009, mainly because of price, and I preferred to buy it rather than popular Chinese UNI-T. Of course, Kyoritsu is also Chinese product, as the sticker on the bottom of the meter tells us, but the company is generally Japanese, and the bottom of the meter tells us its designed and qualified in Japan. I ordered it at and I can truly recommend this company as a reliable supplier.

I check the reference voltage with new meter and it revelas, that I set the voltage on the divider with an error as low as -0.004V, despite the missing third significant digit on my ALDA meter. Excellent results! And yet the kit multimeter continued to show nonsense, only this time I had confirmation from two independent sources. What an intolerant circuit that is! I have been studying the manual and again I was amused:

“Calibration can also be made during normal operation. The only voltage that we have to adjust with an additional voltmeter is the reference voltage of the A/C converter. The remaining adjustments are made on the basis of the module display. We do not need to measure the voltage of the divider with an additional voltmeter. This method is faster and may be more accurate than the one presented above”.

Oh dear. Why force people to make unnecessary effort when calibration can be taken in minutes, with a few movements of a screwdriver? What sadist wrote that manual? It’s obvious, that when it come to provide supply by the voltage divider, actual values differ from those which are calculated. So, after such adventures I gained a fairly well calibrated voltage meter. Connecting several light bulbs connected in series made it possible to calibrate the ammeter and I enjoyed a working power supply with voltage and amp measurements.

Unfortunately, these few minutes of operation at a load of 0.26A showed that without cooling it would not work well on long runs, because of heat. And since I still had a free +5V output from the stabilized supply for the multimeter and a lot of power backup at +12V, I decided to use the built-in thermostat for which I bought the whole AVT kit first. But this is a story for another episode.

Own bench power supply 0-30V 0.002-3A, part 1


This is translated archive post from my polish language blog. I will be successively post translated version of some of my archives.

It’s always nice to do something by yourself. Maybe not design, because I don’t think I can do it in the foreseeable future, looking at my adventures with a simple cooling control system.

As a project I used the popular schematic from The schema itself and  the principle of operation is specified in detail on this page, and I will not want to duplicate it, I will rather focus on certain details and stages through which I have been making this memorable work….

At the beginning it is worth noting that this system is relatively old, it was designed in the late 80s, which determines, first of all, the elements used in it and, secondly, their availability. I guess that it may be the last application using such elements, some of them are no longer present in nature in their original form and only Chinese counterfeits are available – of course, it refers to 2N3055 (RCA released it on the market in 1959!) and TL081 (year 1977!). The RCA power transistor has its own article on Wikipedia, so it was a milestone in its time. The 2N3055 is produced so far, but these are products that are different from the original, working on the border of capabilities and quite unreliable. Texas is now producing only small integration scale, it’s hard to get DIP or DIL versions of TL081. I managed to buy a double TL082, but having the PCB ready I had to give up this idea (my laziness wins). Finally, I replaced them with UA741CN, although as my colleague Grzesiek, guru of electronics, once said:

“there is no worse amplifier than UA741”,

but the circuit works, so why bothers? Here, the picture is taken after initial assembly and installation in the housing:

I plan to use this cheap alliexpress Chinese voltmeter with ammeter:

But because of the defective full bridge rectifier, which I removed from the old charger, I’ve ended with the AVT kit. This case illustrates how unlucky sometimes I am. What something like that can be damaged, and how?

After all, it is nothing else but 4 diodes and a ceramic capacitor. However, the connection of this circuit to any transformer causes such voltage jumps, as if it is only a half-rectifier, not a full one. Of course, I didn’t aware of this issue at the moment I plan to use it, so I threw whole circuit and voltmeter to broken electronic bin, read online and bought a AVT2857 kit containing apart from voltmeter and ammeter, thermostat module with temperature sensor, which is a good addition, because of the circuit astable behavior in temperature changes.  However, it turned out that the kit project was not a very good one, on which I didn’t think at the time of the purchase – so I was exposed to additional costs and difficulties. But that is the topic for the next episode.