Tuesday, October 30, 2012

[Open 7400 Logic Competition Entry] Using two CD4007 IC as an op amp to generate sine waves

The CD4007 dual complementary pair and inverter is primarily intended for digital logic circuits. It contains an inverter, and two pair of PMOS and NMOS transistors that can be configured to implement any CMOS logic gates. Since we now have access to pairs of transistors, it should be okay to use these transistors for other purposes than digital, in other words: analog. This idea is not new, in fact this article has already mentioned this possibilty, and now I would like to take the challenge to build something somewhat useful out of it, as simple as possible.

First, a bit of demo. Here is the CD4007 op amp working as a sine wave oscillator. It can even drive a small loudspeaker through a capacitor (try to listen to it):


Now comes the explanations. I have actually started a bit on this late last year, and posted its explanations and results there (in Indonesian language). I will repeat some of my earlier post here, in a different language that is.

The circuit for the op amp is shown here:


It needs two CD4007s: one for the differential input stage, and one for the gain stage. Since simplicity is what we are after (not necessarily high performance), I did not use active loads (current mirrors) on the differential input stage, and use a pair of 100k resistors instead. The good thing about this CD4007 though is that the differential input pair transistors are on the same chip, so it would definitely help the matching. If you are after even better matching, using a 1% resistor (not a 5% like I did) would be a good idea.

There are two potentiometers in the circuit. One is the bias voltage for the current source (pin 6-7-8) through a simple voltage divider. The reason to use potentiometers in that voltage divider and in the gain stage is because we are not too certain about the behaviour of the transistors. These transistors need correct operation mode (saturation), and tuning the potentiometers is a simple way to ensure that.

A bit of tuning was necessary to make the op amp work. First we need to adjust the current in the differential pair such that the DC voltage level on its output is 'reasonable' (mid-rail). Then we adjust the other potentiometer to adjust the gain, enough to make it work. The way I did the tuning was by putting the op amp in a simple inverting amplifier and tune the potentiometers until I get the correct output.

The op amp in breadboard looks like this:


The inverting amplifier test circuit I used looked like this:


A terrible video showing that the circuit works can be seen below. I wanted to emphasize that the amplifier works with different DC offset of the input signal as an op amp should do.


Here is a picture of the circuit configured differently, now as an integrator (replace feedback R with C). It generates a triangle from a square wave input.


And finally, the oscillator circuit. The schematic looks like this:


On breadboard, it looks really messy:


But it works. It generates a sine wave!


Trying to tidy it up a little, I made a PCB version of the op amp, which looks like this:



Unfortunately due to lack of time (deadline is coming), I haven't got it to work correctly yet.

Next step:
While the op amp is indeed simple, but tuning may not be a pleasant thing to do. So it would be really nice to get fixed resistor values, and possibly use active loads and final output stage (this one doesn't use a final  --push-pull amplifier-- output stage but surprisingly its theoretically not-too-low output impedance is sufficient for all our purposes!?)

Another idea is to be more extreme, use dedicated inverter ICs such as the 4069, and work that one out as an op amp if possible.

Sunday, October 28, 2012

Pengubah digital ke analog yang presisi

Penerapan rangkaian analog pada teknologi IC masa depan akan semakin sulit, karena sebetulnya kinerja rangkaian analog akan makin memburuk dengan teknologi IC yang lebih baru [1]. Dalam rangka 'merasakan' makin sulitnya hal tersebut, hal yang saya kerjakan pada awal PhD saya adalah membantu membuat rangkaian pengubah digital ke analog (digital to analog converter, DAC) dengan akurasi 16-bit tapi hanya memiliki 8 tingkat kuantisasi (3 bit). Umumnya, benda ini dibuat dengan teknik current-steering, yaitu memanfaatkan current mirror banyak dengan ukuran sama yang bisa dinyalakan dan dimatikan, nanti dampaknya adalah arus yang dialirkan ke Rbeban bisa ditambah atau dikurangi tergantung kode input digital. Kurang lebih ini bisa digambarkan sebagai berikut (Gambar 1):

Gambar 1  Model small-signal current steering DAC

Friday, December 2, 2011

Membuat op amp dengan transistor 9012 dan 9013

Posting-an sebelum ini membahas tentang op amp CMOS buatan sendiri dengan IC digital CD4007. Nah kali ini akan dibahas percobaan serupa yang sebetulnya sudah saya posting di FB tahun lalu, tapi menggunakan transistor bipolar murah meriah 9012 dan 9013.

Rangkaian op amp, umumnya tersusun atas beberapa stage, yang saya pahami antara lain:
1. stage input: berupa differential pair
2. stage penguatan tambahan: bebas, barangkali yang simpel adalah penguat common emitter?
3. stage ahir: impedansi rendah, misalnya push-pull amplifier.

Ketiga stage ini saya buatkan versi sederhananya dalam PCB seperti di foto ini:
Rangkaian Op Amp dengan PNP 9012 dan NPN 9013

Saturday, November 26, 2011

Mencoba membuat op amp CMOS dengan transistor pada CD4007

Salah satu rangkaian elektronika yang cukup penting di bidang elektronika analog adalah penguat, dan juga penguat operasional (operational amplifier, atau op amp). Penguat operasional adalah "benda" yang pemakaiannya tidak sekedar "menguatkan" saja, tapi juga banyak aplikasinya yang lain seperti buffer, pembalik tegangan, penjumlah tegangan, filter, comparator dan schmitt trigger, dan masih banyak lagi.

Sifat utama dari sebuah Op Amp antara lain:
1. Menguatkan selisih dari tegangan kedua input, dengan penguatan amat sangat besar.
2. Hambatan input besar sekali, atau tak terhingga (kalau bisa), dampaknya tidak ada arus masuk input.
3. Hambatan output sangat kecil, supaya tegangan outputnya tidak bergantung beban.

Simbol Op Amp sendiri adalah seperti ini:

Simbol Op Amp

Pada gambar simbol di atas, tampak ada dua input, yaitu V+ dan V-, dan ada sebuah output Vout. Tegangan Vout seharusnya = A dikalikan selisih V+ dan V-, dengan kata lain:
Vout = A[(V+) - (V-)]
di mana A adalah nilai penguatan op amp yang idealnya tak terhingga besar sekali. Dalam prakteknya, nilai Vout dibatasi oleh catu daya.

Kali ini, kita akan mencoba membuat dan menguji Op Amp "buatan sendiri". Sebetulnya, op amp umumnya dijual di pasaran sudah dalam bentuk IC, namun tidak ada salahnya kita coba terapkan teori di textbook menjadi sesuatu yang nyata supaya teorinya lebih dapat kita apresiasi, dan kita tidak perlu takut salah dalam mengerjakan hal-hal semacam ini. Dengan banyak berbuat salah justru kita bisa belajar dan lebih paham elektronika (biasanya). Dalam hal ini, kita coba buat Op Amp dari transistor-transistor MOS dari IC CD4007, di mana CD4007 adalah IC yang berisi sebuah inverter CMOS dan dua set PMOS-NMOS pair.

Sunday, November 6, 2011

Eksperimen dengan Tembaga (I) Oksida sebagai Semikonduktor

Terinspirasi bu Jeri Ellsworth yang berhasil membuat transistor sendiri di rumahnya, dan dalam rangka mempersiapkan materi kuliah Devais Semikonduktor besok, hari ini iseng searching lagi di Internet tentang alternatif lain pembuatan piranti semikonduktor yang home-made. Ada website milik pak Friedrichs, yang menunjukkan beberapa percobaan beliau dengan Cu2O, dan ada juga video di youtube ini yang mendemokan cara pembuatan panel surya di rumah, juga dengan Cu2O. Akhirnya, malam ini tadi (baru saja) kulakukan eksperimen terkait Cu2O ini, sebagai semikonduktor.
Menurut dua sumber itu, tembaga (I) oksida (Cu2O) bisa dibuat dengan memanaskan lempengan tembaga. Karena kelihatannya cukup sederhana, ketertarikanku terhadap senyawa ini makin membesar. Dari browsing sekilas dan baca2 referensi, info yang kudapat adalah Cu2O merupakan semikonduktor yang umumnya berupa tipe-P (muatan pembawanya berupa hole), meskipun memang ada cara untuk membuatnya menjadi tipe-N. Pembuatan Cu2O ada banyak cara, dan salah satunya memang dengan pemanasan (thermal oxidation). Warnanya adalah kemerahan.


Ya sudah, mungkin langsung saja kita bahas eksperimen tadi.

Pertama kita siapkan PCB yang ada lapisan tembaga. Sengaja saya bentuk seperti gambar di bawah (ada bagian menonjol) supaya tepinya banyak. (saya tidak mampu menjelaskan secara ilmiah kenapa lebih baik begini, bahkan mungkin ini tidak baik sebetulnya?) Oya supaya lebih meyakinkan, permukaan yang akan dibakar saya haluskan dulu dengan cutter (bisa juga dengan amplas).


Monday, September 26, 2011

Manaya: Augmented Reality Place Search

Manaya is an augmented reality places search application for the Nokia N9 or N950 Meego phones. It takes location data of common places directly from Wikimapia.org and Wikipedia.org. Current version is in Bahasa Indonesia only. This application was developed for the Nokia Devstart Competition in Indonesia, 2011, and held first place in the best local App category.

Video demonstration:

Search based on category

Search based on keyword "Library"

Screen shots:
Showing places with label "Teknik Mesin"

Wednesday, March 9, 2011

More about 555-logic for the 555 contest entry

Last week I wrote my 555 contest entry on 555-logic (and its 2-bit grey-code counter implementation as proof of concept) on this blog in a huge rush. As my wife was waiting for me to accompany her for some business, I had to finish up the 555 contest entry report which was due only a few hours before deadline (due to geographical location advantage, I get to sleep at midnight and rush afterwards, in the morning instead :D)

I started the idea to make 555-based digital logic circuits quite early when time was plenty before the 555 contest submission deadline. Another crazy idea in my mind was actually to make an Op Amp out of a 555. Last semester I taught analog electronics, and one of the lab experiment in the class was to actually build a self-made op amp with those very popular 9012s and 9013 BJTs in Indonesia. But it didn’t take long before I scrapped this idea, thinking it was kind of almost impossible, since not all comparator pins (it has this similar symbol with an op amp right?) inside the 555 could be accessed. I once read a PhD thesis that had this VCO-based op amp though, and I spent some time contemplating this concept. I even thought to make a 555-based filter.

This semester I get to teach digital designs with FPGA, and during early weeks of the class the idea of building basic logic gates with 555 came into my head. The solution on how to make it though, came real real late.

My early concept of 555 logic was a hope that a single 555 can be made into either a NAND gate or a NOR gate. The 555 as an inverter was already obvious. Only if I could make a NAND gate or a NOR gate, ANY logic gates can then be implementable (see articles on NAND logic or NOR logic in Wikipedia). I googled 555 nor gate but nothing relevant showed up that time (perhaps now there are three different styles of 555 nor gate out there, thanks to 555 contest ;D). I started by writing simple truth tables of a 555:

555 Truth Table
Reset(4)
Threshold (6)
Trigger(2)
Discharge(7)
Out(3)
0
0
0
Disconnected
0
0
0
1
Disconnected
0
0
1
0
Disconnected
0
0
1
1
Disconnected
0
1
0
0
Disconnected
1
1
0
1
No change
No change
1
1
0
Not allowed
Not allowed
1
1
1
0
0

Looking at the above truth table makes it real hard for me to find any useful logic functions other than the already-obvious inverter. Not to mention, there is this “not allowed” state and “no change” state that forces me to tie the threshold pin and trigger pin together to avoid the not allowed state. So, oh well, okay it felt hard to solve, so I might as well not think too much about it and think more about my work at the uni and my family instead.

Around 3 days before submission deadline I looked at the problem once more to find potential solutions. Had I been a better digital designer, I might have thought about the AND gate with the trigger-threshold pair pin as an inverting input (as pointed out by the Paleotechnologist). But apparently this did not seem apparent to me that time. Instead, as I dealt with transistors more than I deal with gate level designs, I saw a transistor with a free collector pin inside the 555 and thought that why not use this transistor as itself instead? (thereby wasting and throwing away the significance of some other parts of the 555) Transistors can be used as switches, and from the way the transistor is connected inside the 555, it became apparent to me that the transistor inside the 555 can indeed be used as a switch: we can give either a logical high voltage level or a low one to the gate of the transistor indirectly. Giving the correct threshold and trigger inputs will control the transistor’s gate as if we are controlling the transistor directly. The sketch below shows how this can be done:


Using the discharge transistor of a 555 as a general purpose pull-down switch