Lushprojects Blog

Projects in music, video, art, technology and learning
RSS icon Home icon
  • Hantek6022BE USB Scope + OpenHantek6022 Fills a Useful Niche

    Posted on December 29th, 2022 Iain No comments

    I’ve been looking for a scope that can be always on my bench for making quick assessments of circuits running at low frequencies. My electronics bench is also my work desk, so space is very much at a premium. My full-size analog and digital scopes are too big to leave set up there permanently (PS, a personal annoyance with modern digital scopes is that their shape means you can’t stack other equipment on top of them). I do have a little DSO Shell kit-scope which is OK, but a bit fiddly to operate and only has a single, very low frequency, channel.

    There are of course various handheld scopes and scope-meters on the market, and maybe they would be a good option, but they need to be positioned in prime desk space to reach, and that would be awkward for me.

    So far, my Sinclair/Thandar SC110A has been the best bet, but the small screen means it needs to be carefully adjusted to get a good view of a signal, and that’s not helpful when you are probing around a circuit.

    I did look at other small analog scopes (I like analog for quick exploratory tests), but didn’t find anything that had a combination of price, size and capabilities that worked for me.

    I started to wonder if I wasn’t better off going a different route and instead of looking for a small scope, I should make use of the PC and 4K monitor that’s always part of my workstation. I’ve resisted PC scopes on the assumption that the software will be grim, and the whole experience will be klunky. I’ve not had a good experience with test equipment integration with computers since using HP-IB and HP Basic to automate test systems back in the 1980s.

    However, I was intrigued when I saw a cheap Hantek6022BE scope on eBay, and finding out that there is a well-liked, lightweight, and Open Source software platform for it. It was cheap enough that I was willing to give it a go and see whether this device could become my everyday scope.

    When the unit came I was impressed. The box that needs to sit on the desk is fairly small, and can be easily tucked-away. It can even be stood in its side for a smaller footprint. Getting the open source drivers and OpenHantek6022 application installed was easy on Windows 10 using the instructions on the GitHub ReadMe. OpenHantek6022 has a level of maturity not often seen on niche open source applications. In particular, the documentation is very comprehensive.

    In use I find the combination of hardware and software basic, but effective. OpenHantek6022 is very usable, though there are a few UI things I would tweak. Everything is visible and you don’t have the feeling of “menu diving” like you do on a lot of digital scopes. It’s also very responsive (due to a small memory depth I suppose) in a way that feels a lot like an analog scope.

    I was also interested to see that the scope was compatible with Sikrok’s Pulseview software. I had some trouble getting the driver installed to work with Pulseview. The 6022 and similar devices have a slightly odd way of managing USB firmware (explained in this video) which can easily trip you up. I found Windows 10 was picking up the wrong driver once Pulseview was run. To get the right driver for Pulseview I had to:

    • Start Pulseview with the 6022 connected
    • Find the device in the Windows Device Manager
    • Right-click and choose Update Driver
    • Click “Browser My Computer”
    • Click “Let Me Pick From A List of Available Drivers On My Computer”
    • Then I was able to choose the driver from the install package. Ignore the warning about the driver not being optimal (or some such wording)

    Pulseview ran fine, and might be a useful alternative to OpenHantek6022 if you want to do long captures, or to do protocol decoding on signals. One annoyance is that Pulseview doesn’t seem to allow you to configure x10 probes, so to get the right voltage scale you have to use the probes in the x1 setting. The wrong voltage on the display wouldn’t matter too much, except that having the wrong voltages then messes up the process of protocol decoding by stopping the conversion of analog captures to digital equivalents for further processing.

    Overall I think this is a great package at the price. With the open source software it’s no fuss, and super-usable. Great for doing quick checks on circuits, and with the advantages of a big display I can even see myself using it for more demanding measurements.

    EDIT TO ADD:

    One potentially serious disadvantage of the 6022 is that the ground terminals are connected to the ground on your PC. If you connect the probe’s ground lead to something at a different voltage then there is a risk of damage to at least the USB port and potentially the whole PC.

    For me, this is a risk I can live with, but it does depend on your use-cases, experience, and approach to risk whether this is an acceptable situation. It’s certainly something to consider.

  • My Old BBC Micro

    Posted on August 24th, 2022 Iain No comments

    After a trip “down south” I recovered by old BBC from the loft recently.

    It started life as a Model A and was then upgraded to a B, and later a disk interface was added. It also has a big “Sidewise” ROM/RAM board fitted. (My dad was an IT manager for British Gas and was a big believer in upgradability. He approached buying and owning a home computer with about the same attitude as procuring a mainframe for BG. To be totally fair, that strategy did work very well. We got a huge amount of use out of the Beeb over many years.).

    Anyway, it’s somewhat dirty but the plastics are in good condition. It’s quite an early board with plenty of factory bodges – the most exciting of which is a variable capacitor trimmer on a bit of veroboard randomly above an IC. The original OS was 0.1, but it was upgraded to 1.2 when that came out.

     

    After replacing the usual suspects in the PSU and reseating the expansion board (a problem I remember back in the day) it came straight back to life. Looking at the bodges it’s surprising it worked at all, never mind after all this time. The Cub is a recent purchase BTW, back in the day we had a Philips portable TV with RGB input on the back.

    Quite a few ROMs in it – some even legitimate (ISO Pascal, Wordwise). I don’t remember how Basic got upgraded to Basic 2. The more unusual ROMs uinclude PHX (Phoenix) which was a special terminal emulator used by Cambridge Uni and a few others in the UK. It implemented a page editing protocol. I have an odd personal connection to that as I ended up making the official port of the protocol to the Mac 68k era. SSMP is some other kind of terminal emulator (not the messaging protocol), but I don’t remember what I used that for.

    Disks and disk drive are currently MIA – possibly still at my dads.

  • Metronome from an Event Badge

    Posted on May 3rd, 2021 Iain No comments

    Did I mention that I am learning to play the piano? When I started reading music I expected the hard part will be recognising the notes, but with practice I’ve got that fairly sorted. The consistently hard part is recognising the rhythms and being able to play them right. I found having a metronome or drum track really helps with rhythm practice.

    I’ve been a bit frustrated that none of the metronome options I found were quite what I wanted. There are 1001 apps of course, offering many features, but I find them a bit painful to configure how I want, and the UIs often trade gloss for practicality. Plus, somehow having my phone in front of me when I am playing isn’t quite nice. Stand-alone metronomes on the other hand seem to be too basic with klunky controls and poor displays. I wanted something that covered 90% of my use cases in a way that was simple, visual and usable.

    I also had an unusual requirement that doesn’t seem to be supported in any off-the-shelf solution I could find. I wanted to use a pedal to play the beat myself, but have that mapped on to a drum pattern to help follow the strong and weak beats in a bar.

    I recently got a Korg Volca Beats (VB) as a way to create easy drum tracks. It’s basic, but fun. It almost passes muster as a metronome too, but again it can be a bit too much effort to configure. My initial goal was to use the sync in signal on the VB to provide a pedal input to step through its sequence. Sounds simple, but in practice it was a nightmare. The VB seems to do some kind of interpolation of the sync in signal and if its slightly irregular it can trigger weird double steps on the sequencer. After a lot of frustration I gave up on that approach.

    I went for one last try with an idea to use the MIDI in on the VB to trigger the drums from an external sequencer that could work like a normal metronome or be stepped using a pedal. Like many people I have a box full of development boards from various sources and rather than buy something new I wanted to use one of those. It came down to a ESP8622 board from a Nottingham Hackspace event or the Tilda Badge Mk 3 from EMF Camp 2016. Something had broken compatibility between the current Arduino IDE and the ESP8266 board I had, so I went with the Tilda Badge which turned out to be really well suited to the job.

    The Tilda Badge Mk 3

    The Tilda Badge is programed in Micro Python which is really productive once you get your head round how to use it. The approach I used was different from the ones suggested in the documentation. I connected the badge to my PC which allows it to mount as a mass storage device and as a serial console. Copying a file called “main.py” to the root of the mass storage device creates an application that the Tilda Badge will run on boot. I edited my main.py on the PC and just used a CMD command line to do the copy. To run without resetting the badge, I used this command in the – 115200 BAUD – serial console (courtesy of Stackoverflow):

    >>> exec(open("main.py").read())

    The advantage of this approach was I didn’t need to install anything special on the PC and I could quickly iterate versions.

    To support a MIDI output I just had to add the simple circuit below to the UART3 TX which is available on the GPIO port of the Tilda Badge. (Note – the pin positions on the DIN connectors used for MIDI are totally confusing. I think this is right, but I would rely on the pin numbers more than the positions in the event of conflict!) The pedal is just connected between the CH1 GPIO pin and ground.

    The Tilda Badge turns out to have just the right level of functionality for this application. The connectivity is more than good enough. The display is big and clear enough to show a good visualisation. There are enough buttons to provide easy access to all the services without having to do any “menu diving”.

    Software for the Tilda Badge is here (it’s very rough, but does the job).

    The finished project integrates in to an accessory system I build with V-slot on the back of my piano stand (that’s another story). I 3D printed a case that attaches the Tilda Badge to the V-slot. It keeps the front of the Tilda Badge PCB fully visible so you can still see its origin, but it protects the back and provides mounting points for the MIDI and pedal sockets.

    Overall it is a really pleasing project and it’s nice to find a long-term use for one event badge. It’s fair to say I haven’t been a fan of the trend for electronic event badges – I think a lot quickly become e-waste and they can be a distraction from other parts of the event. But in this case it has been practical as well as cool. It also shows the value of an open, and documented, project that I was still able to pick up the badge after 5 years and immediately start developing on it.

  • BBC Micro on MISTer

    Posted on January 24th, 2021 Iain No comments

    During Covid-19 lockdown one of the things I wanted to do was to revisit some of the old computers I used. I don’t really have the space or inclination so collect the original hardware, so I decided to try out what emulation options exist now.

    I have been interested in trying some ASIC based projects, so a natural choice seemed to me to use the MISTer platform. This is a retro computer, console and arcade emulation system based on the DE-10 Nano FPGA development board. This MISTer project was developed from the earlier MIST project which used an older development board.

    DE-10 Nano with MISTer expansion to support secondary SD Card

    To get started with MISTer you just need the DE-10 Nano board, but I also chose to get the MISTer add-on board, mostly for the secondary SD Card (more on that later). Most of the emulation cores, but not the BBC Micro, need a RAM add-on board too.

    Once you have the DE10 you can just flash the MISTer core on to an SD Card and boot it. You will also need a USB keyboard connected to the “USB to go” socket.

    Some useful keys:
    CTRL-F11   Break (BBC Micro)
    F12        Load MISTer menu
    BBC Micro booted using MISTer

    One limitation of the current core is that it doesn’t support split-mode games like Elite and Revs.

    Using BEEB.MMD

    The BBC Micro core uses files in “MMB” format. This was a format originally developed for a BBC Micro add-on that connects SD cards to the user port and makes it look like a virtual set of disk-drive. The MMB file is a bundle of hundreds of BBC floppy disk images. Using commands on the BBC Micro you can choose to mount the images from the file in to virtual drives.

    The BBC core offers two ways to mount the MMB file. If you have a secondary SD card then format as FAT32 or FAT16. Copy the MMB file as “BEEB.MMB” on to the card. The core will automatically pick up that card. In this mode the file can be both read and written.

    The alternative is to rename the file as “.VHD” and copy it to the “games/BBC Micro” directory on the main SD Card. If it is called “boot.vhd” then it will be automatically loaded. If not then you can manually load from the MISTer menu. In this mode the file is read only. To unmount a previously mounted VHD (e.g. to go back to the secondary card) press backspace when picking the VHD.

    There are various utilities to manipulate MMB files on PCs. I used “MMBReader” which is available on the stardot forum. On the emulated BBC Micro the MMB file is accessible using MMFS. Note that if no MMB file is available then MMFS will stall the boot of the BBC Micro by displaying the message “CARD?”.

    Some useful MMFS Commands:
     *DCAT [start #] [end #]   - List disks in the MMB file
     *DIN [Drive #] <Disk #>   - Mount disk in the specified drive (default 0)

    Most of the MMB files you will find on the web are pre-loaded with many original games. By default they boot in to a menu to pick the games. You can disable the autoboot on the first disk by using the command *OPT 4,0. If you subsequently want to run the boot use *EXEC !BOOT.

  • Grid Runner – BBC Micro Juvenilia

    Posted on January 20th, 2021 Iain No comments

    My first computer was a BBC Micro Model A (early version with the linear PSU and bodge wires on the circuit board). Later we upgraded it to a Model B. I loved it, and even took it on holiday a few times (!) My parents must have been very understanding.

    I was amazed today to discover that the BBC Micro community has saved two very obscure games I wrote in my teens and you can now play them in the browser:


    Grid Runner


    http://www.bbcmicro.co.uk/game.php?id=636

    Grid Runner II


    http://www.bbcmicro.co.uk/game.php?id=765

    IIRC selling Grid Runner was the first money I ever earned. The BBC Micro magazine Beebug (which was based close to where we live) included it in a demo disk (image via a kind user of the StarDot forums).

    In case you are wondering, I am not colour-blind. The clashing colours were inspired by the BBC classic game Frak.

    JS Beeb is fantastic BTW.

  • Networking CATWatch

    Posted on December 30th, 2020 Iain No comments

    (or an overkill solution to tracking the movements of a cat)

    I don’t mind cats, but we have one Top Cat (subsequently TC) living locally who thinks he (or she) is the boss of everything. After one too many cat shits and dead birds in our back garden I decided that TC was no longer welcome and was going to be excluded.

    Early steps were very simple – filling in the gap under the gate prevented easy access until TC found new ways over the gate and fences. I then decided a more through approach was needed. I installed a Pi Zero W with a night vision camera module (1)  running motion project software so I could see whether TC was coming in the garden and perhaps how it was getting in. It works OK with the caveat that the Motion Project software is pretty simplistic in its approach to doing movement detection and even after tuning the parameters I get a lot of false positives. It is a little painful to manually check the output, but that’s OK.

    Night Vision Camera Module (before I removed the IR LEDs)

    I also put in an ultrasonic cat deterrent on the edge of the lawn. This is a passive infra-red (PIR) motion detector linked to an ultrasonic sounder that is supposed to scare cats. There are lots for sale – I used the RSPB CATWatch. It is a battery powered device where motion detected by the PIR triggers an ultrasonic alarm that sounds at about 20kHz for a few seconds. Interestingly, the alarm doesn’t just play a single tone, it varies the tones during the alarm period, presumably to prevent cats getting habituated to the sound.

    RSPB CATWatch

    After that we didn’t see TC in the garden for quite a while. We thought the CATWatch probably was scaring it off, though we never caught it in the act. But, one day the camera caught TC strolling around the edge of the lawn, just out of range of the CATWatch PIR detector. Knowing TC was still coming in the garden I followed the example of my neighbour and put cat deterrent spikes around the fence tops, and (so far) we haven’t seen TC again.

    But, here is the problem, how do I know TC isn’t coming in any more? The camera sees a lot, but it also misses a lot. Despite its name, the CATWatch doesn’t really watch cats, it just scares them off. In fact you have no way of knowing how often it has been triggered. I wanted a CATWatch extension to log when it was triggering, and ideally to trigger the camera to record too. So, there are two problems:

    • How to cause a trigger for the CATWatch to activate an external circuit, and
    • How to connect the CATWatch to the Pi Zero without running wires everywhere?

    I started thinking about how I could get a wireless signal from the CATWatch to the Pi. My requirements were:

    • Simplicity
    • Keep the CATWatch battery powered without significant reduction in battery life
    • Fast reaction so that the camera will be activated while the cat is still in the vicinity.

    The obvious option was WiFi, but keeping that running long-term on a battery is problematic. If you disconnect from the WiFi to save power then reconnecting will add a delay which might not meet the “fast reaction” requirement.

    BLE was another option, but the thought of working out the right stack of hardware, libraries, low power modes etc. to make it work made my eye twitch. Modern systems are amazing, but, unless you already know the ecosystem and tools, understanding enough to use it effectively can be a massive PIA.

    I realised what I wanted was something very simple, almost primitive, that I could just hook up at each end to send an on/off binary signal. The technology that seemed to fit that best was 433MHz radio remote controls used for garage doors and similar things. I bought a set of 5 key fob transmitters and a 2 channel relay board receiver on ebay. The plan was to put a transistor across one button on the transmitter to send and to remove the relay to get an open collector transistor output on the receiver.

    433MHz Receiver Board and Some of the Key Fob Transmitters

    The receiver board is rated for 12V input, though it worked down to 9V. What I really wanted was for it to be powered off 5V from the Pi. Looking more closely I found, as I expected, that the only part of the circuit that used the 12V was the relay coil. The rest ran on 5V from an internal regulator. I removed the relay and bypassed the power regulation on the board to produce a 433MHz receiver that ran on 5V and could (using an open collector output that originally drove the relay) link to a 3.3V GPIO input on the Pi.

    The transmitter fob was very simple – the two buttons just connect a wire to the positive end of the 12V internal battery when pressed. So the only unexpected problem is that I would need to implement a high side switch, rather than a low side switch as I was expecting.

    Getting the CATWatch to activate an external circuit would probably be easy, but for one problem: all the electronics are potted in resin except for the power-in and the wires going to the ultrasonic transducer. So, there is no obvious binary “alarm” signal accessible to drive an external circuit. You could trigger based on the ultrasonic output, but I thought it would be easier to use the power input and detect the very marked increase in power consumption that occurs when the alarm is turned on. I put a 15 Ohm shunt in the power line driving a PNP transistor to do the high-side switching for the transmitter (as shown in this simulation). I decided to keep the two circuits on their original batteries, so, to do the high-side switching, these two batteries connected positive to positive as shown.

    Block Diagram of Connecting CATWatch to the Key Fob Transmitter

    As always, I hit a snag at the last moment. There was enough space in the CATWatch to include the transmitter fob in the unmodified case, but I found that when the case was closed the alarm wouldn’t turn-off once it had been activated. My suspicion is that the transmitter interferes with some high-Z input that is being driven by the PIR and the circuit keeps thinking it is detecting new motion. So, I 3D printed a “back-pack” that contains the fob circuit and can be attached to the back of the CATWatch away from its electronics. That worked fine and also makes it easier to change the fob battery if needed.

    Design for the Back-Pack to Hold the Key Fob

    On the camera side I also got the 3D printer working to make a case to contain the Pi, camera and 433MHz receiver. This is attached to a sheet metal bracket (made from an old baking tray) which allows the camera to be hung from our windows and the window to still close. I wrote a small Python script that monitors the GPIO connected to the 433MHz receiver and logs any events. It also uses the Motion HTTP API to trigger Motion to record video if the CATWatch is activated.

    Camera Case – Pi Zero in bottom, Receiver Board on Size, Ribbon Goes to Camera in Lid
    Camera, Pi and Reciver Mounted on Window

    I am getting about 8 meters line of sight operational range on the 433MHz signal which is good enough for this application. Since it all went live the only animal to trigger the CATWatch was a squirrel which wandered right in front of it. So, touch wood, it seems that the project to secure the garden against TC is working. Come the spring, I hope the nesting birds appreciate the effort. We wait for TC’s next move!

    Of course this project is completely and ridiculously overkill, but the new parts were pretty cheap and it was fun to build. It’s nice to do some back to basics local networking and to have a completely self-contained solution that doesn’t depend on some dubious cloud-based subscription like almost all commercial home automation services do. I can see that there are a lot of other potential applications for simple 433MHz technology which I might want to explore.

    (1) A couple of notes on the night vision camera. Firstly, the included IR LEDs for night lighting are pretty feeble. They might light about 2-3 meters, but not further than that. I ended up removing them as they weren’t lighting anything useful when the camera was on an upstairs window. They also cause false positives when it rains due to reflection from raindrops.

    The IR LED modules are self-contained (including a light sensor to turn them on) so they could possibly be repurposed as a light source to be used away from the camera. Without IR illumination the camera doesn’t really see in the dark, so I would probably have go for a normal (non-IR) camera if doing this again.

    The camera comes with a choice of lenses. Due to breaking one camera I ended up with both lens options. One thing to note is that the lens needs to match the plastic base that it screws in to if it is going to focus properly. If you want to swap lenses on a board you can’t just move the lens over, you also need to move the base.

  • The Story of Pye Wireless

    Posted on October 16th, 2018 Iain No comments

    Bit of an odd one today – while helping my dad clear our some of my old books we found this pamphlet from 1986 – “The Story of Pye Wireless” by Gordon Bussey. I can’t find any other references to it on the web, and it seems well researched with some nice photos. So, to make it more widely available I’ve scanned it and made a copy available.

  • VCV Rack for EMF Camp 2018

    Posted on August 28th, 2018 Iain No comments

    I am running a beginners workshop on the VCV Rack moduler synthesizer simulator at EMF Camp 2018. Currently scheduled for 11.20 am on Sunday in Workshop 1. If you are at EMF Camp and want to join please bring a laptop and headphones.

    Here are some resources for the event:

     

  • Everyday Electronics Magazine

    Posted on March 17th, 2018 Iain No comments

    Everyday Electronics magazine is something I have fond memories of from my childhood. Much of the practical knowledge I have of electronics originated from things I read there or stuff I tried to make (some of it DID work). For many years my parents kept-up a subscription for me until sometime in the late-80s when I outgrew it.

    There is quite a lot of info online about EE’s sister publication Practical Electronics (which it would eventually merge with to create Everyday Practical Electronics) but I can’t find a lot written about EE. Recently I saw an edition of EE that recognised as one I originally owned in a second hand shop. At 20p it was an easy decision to take home.

    EE always put a bit of effort in to the cover which is one thing that makes them memorable. This one with the dodgy looking vicar and his assistant is perhaps memorable for the wrong reasons. The projects are typical of what I remember – endless variations on simple circuits with oscillators, discreet transistors, 4000-series CMOS and op-amps. Even the cover project isn’t that exciting, though if you were in the market for an electronic wheel of fortune I guess it would do the job. They might have been basic and (whisper) not terribly useful but building them was still a great way to learn practical skills.

    The features are quite interesting and remarkably well considered in terms of content. Magazines like EE were the main source of information in the pre-Internet era and you can almost see how the different features mirror popular Internet content today. In “For Your Entertainment” Barry Fox makes some interesting comments on the current state of flat-screen displays before getting side-tracked in to a discussion of Sinclair’s doomed flat CRT project. The government didn’t half invest in some rubbish projects in those days. Some of the features do hint towards the tide of consumer electronics that would spell doom for much of the old hobbyist world. Another glimpse of the future is the side-bar on direct broadcasting by satellite in “Radio World”. The introduction of DBS as a platform for Sky TV was a huge step towards today’s media landscape.

    As a child, my favourite regular feature became “Counter Intelligence” by Paul Young. I liked his witty, caustic and grumpy musings on life in the kind of corner electronics shop that was already finding times tough. I remember that dad used to take me to a shop in Leicester staffed by blokes in beige lab-coats stocked with thousands of components in tiny draws. They hardly ever had exactly what you wanted but could usually produce something that would do the job.

    The adverts are a real blast from the past. Many of them seemed to run unmodified for years and years. The spiv zapping his light and the odd boy with his crystal set were almost permanent features. I imagine J Bull (Electrical) always doing deals on vast lots of unwanted items and then finding enticing descriptions to sell them off to the unsuspecting.

    So, for anyone who, like me, wants to wallow in nostalgia, or just see what the old days were like here is Everyday Electronics August 1981.

     

     

     

     

  • The “Electronics Kit” Common Emitter Amp

    Posted on August 20th, 2017 Iain No comments

    One project that’s been in my mind for ages is to revisit some of the circuits from my childhood Philips X40 kit. I finally got around to putting “Experiment 5 – Telephone pick-up and amplifier” in to my circuit simulator. This is the first of several audio amplifier circuits in the manual, and they all follow the same design pattern. Similar circuits are also used in other educational kits. I had tried to use this circuit design in my own electronics experiments as a kid. Mostly it didn’t work, but sometimes it did. As an adult, I was interested to understand its characteristics to help explain where it’s appropriate.

    View the about in full screen.

    Looking at the simulation you will notice the amplifier is non-linear (compare the shape of the top of the sine wave out to the bottom in the output of the first stage). This isn’t unexpected given that transistors have an exponential relationship between the base voltage and the collector current. The biasing on the second stage also looks bad, meaning that the output signal is clipped on the positive side. The simulation result raises several questions in my mind:

    • Why is this type of amplifier so popular in basic electronic kits?
    • Are they circumstances in which the amplifier is linear?
    • What are the characteristics of this type of amplifier anyway?

    To answer these questions, let’s look at the basic building block of this amp. It’s a single transistor common emitter configuration. The biasing is from a high value resistor between the collector and the base. Wikipedia informs me that this configuration is called “collector feedback bias“. The signal is coupled in and out of the stage through capacitors.

    Single Stage of Amplifier

    Looking at this circuit you can guess why it’s popular in these kits: the component count is very low. Hence, it is easy for kids to build. If you have an intuitive understanding of transistors, you might also guess that resistor between the collector and the base creates negative feedback giving the circuit the ability to find a suitable operating point across a range of conditions.

    As all the textbooks tell you, transistor amplifiers require that the transistor(s) are “biased” correctly to work. The aim of biasing is to set the DC conditions around the transistor so that it is in the “active zone” of operation. The active zone means that you are past the threshold for the base voltage required to start to turn the transistor on, but not yet at the base voltage where the transistor is fully turned on and saturated. The DC conditions that the biasing establishes are called the “operating point”.

    As I mentioned, in this circuit the base resistor provides negative feedback which tends to stabilize the operating point. When the circuit is switched on there is no current through the transistor so the collector voltage is at the power supply voltage and the base is pulled high though the two resistors. This rising base voltage turns the transistor on and this pulls the collector voltage down (because of a voltage drop through the collector resistor) which in turn reduces the base voltage – tending to turn the transistor off and reduce the collector current. In practice, these effects will almost instantaneously reach equilibrium with the transistor in a partially on state – i.e. in its active region.

    Wikipedia gives a pretty good explanation of how to calculate the operating point so I won’t repeat it. One thing to note though, for the resistor values used in this configuration, the operating point will depend on the gain (β) of the transistor so the operating point will change for different transistors. Here is a graph showing how Vc depends on the gain (β).

    Theoretical Vc (Y axis) Vs Gain (X axis) for Circuit Shown Above

    So, that just about wraps-up the situation for the DC bias. It works just about OK as long as you aren’t fussy and don’t expect a big output voltage swing I guess! What about the AC characteristics of this circuit? What is the gain? What about this non-linearity effect?

    I checked a few standard text books, and the web, and couldn’t find a theoretical treatment for this circuit configuration so I had to come up with my own. Let’s start by assuming that the impedance of the input source through the coupling resistor is low compared to the input impedance of the amplifier. In that case the input signal becomes just a change in voltage on the base of the transistor (ΔVBE). In that case we can use the Ebers-Moll equation for the transistor to work out the impact on the collector current (and hence the collector voltage). Ebers-Moll says:

    IC2/IC1 = Exp( ΔVBE / VT ) Where VT ≈ 25.3mV at room temperature

    If you write IC2 = IC1 + ΔIC, and convert the collector current to the corresponding voltage you can get the solution:

    ΔVC = ( 1 – Exp( ΔVBE / VT) ) . ( VCC – VC1 )

    Where VCC is the power supply voltage and VC1 is the voltage at the collector at the quiescent operating point

    That equation fascinates me for two reasons:

    1. Clearly, this is an exponential amplifier – which explains the non-linearity
    2. The gain depends on the collector voltage at the quiescent operating point. The graph above which shows how the operating point changes with β translates to changes in the stage gain.

    Can we imagine this amp could be approximately linear? Well, as my high-school physics teacher said “everything is linear if you look at a small enough range” (cue sound of 1,000,000 mathematicians groaning). So, we know by Taylor expansion that:

    Exp( x ) = 1 + x + x2/2! + x3/3! + …

    So, if ΔVBE << VT we can approximate the exponential using just the first two terms above.

    ΔVC ≈ – ( ΔVBE ) . ( VCC – VC1 ) / VT

    In other words, for very small input signals (<< 25mV) it is kind-of, sort-of, a linear amplifier of gain ( VCC – VC1 ) / VT . Here are some handy plots from Mathics of gain Vs β, Rc and Rb.

    Stage Gain (Y axis) Vs β (Top), Rc (Middle), Rb (Bottom)

    Actually, the stage gain in this configuration is quite high, though very dependent on the β of the transistor. I might also remark that the output impedance is poor (limited by Rc ), though, without having done the calculation, I think the input impedance is probably OK.

    So, if you want a high gain, single stage, small signal amp with very few components, and, you aren’t too worried about predictability of the gain OR linearity OR output impedance then this circuit just about does the job. This actually fits the bill for these beginner’s electronic kits pretty well. If your requirements are more stringent then better avoid this circuit and look for others. Just one thing still seems odd – why is the second stage bias set where it is on the original circuit?

    For me it’s been interesting to look at how much information you can extract about this, fairly trivial, circuit and it’s certainly refreshed my understanding of transistor fundamentals. I hope you find it interesting too.