Everything for Electronics

Tech Forum

Voltaic Cell Help 2020 Issue-1

I need help to improve my neat SALT WATER Voltaic cell. I started with copper as my positive elactrode and aluminum as the negative electrode. The result is 337.5 millivolts. Then, I temporarily used a steel plate and I got 830.0 millivolts. That was better, but its an alloy and not pure iron. So, is there a better metal that can beat both of them? I need to get to 1 volt or better. So what metal will do that in salt water?

Victor Davis
Horton, AL

Transistor Confusion Answered 2019 Issue-6

What determines which type of transistor to use in a given circuit? Are they interchangeable with those of a different type that I may already have on hand?

Donald Bodine
Middleham, UK


This is one of those $1,000,000 questions and one which is difficult for those of us who are only somewhat into electronics, like me.

I think the basic answer is yes, they can be used to do the same job but other things will determine which is best to use. By best, I mean many things, for instance, there may be no electronic reason for using one over the other, then again there could be. It might be easier to use one over the other because of what is being done, see Below. There could also be a cost reason, one way might require more parts than the other to make say a PNP work in the same job as using an NPN, or vice versa.

I looked this up because it’s a question that has always bothered me that I don’t really know, I just think I might know.

Here’s a site that helps: How to decide between PNP and NPN https://www.controldesign.com/articles/2016/how-to-decide-between-pnp-and-npn/

While you may not understand everything said in the above article, I don’t either, it does hit upon my two reasons, one is easier to use than the other, one uses more parts than the other.

For a home circuit this may not matter but in industry where extra parts means much more overhead cost to make something, it does matter.

Also, as in software, sometimes it’s easier to understand a circuit of one type rather than the other. I had this experience in software development. I had two developers who know some really interesting ways of doing things, but no one else could understand the method as it was written. My feeling was that if that person ever left the company no one else would be able to debug such a section of code, so I kept lobbying for code that was easier to understand by a majority of software developers.

Such is also the case with electronics, while it might be possible to do it that way, the other way, - NPN vs PNP - might be much easier for a majority of electronics engineers to understand, so that’s the one you should use.

I hope that helps, it did help clarify things for me.

Phil Karras KE3FL

Mostly, yes. There are not that many general types of transistors. NPN and PNP bipolar transistors are by far the most common. They are used for small signal amplification and switching.

If high frequencies are involved, you must use a type with useful gain at the frequency of interest. If high power is involved, then that must be considered. Some circuits use higher than common voltages, and high current, and that must be observed.

Darlington types are used where extremely high gain is needed, but the small differences between the thousands of types are simply not that important. I have only a very few that I use for everything.

Then there are MOSFETs which are mostly used for high power control of motors and such. One big consideration here is the maximum voltage and current and how you provide heat sinking. Specialty types such as enhancement mode FETs and Unijunction are not that common, and there are not that many different types available.

Richard Cox
Thousand Oaks, CA

Mr. Bodine raised a question about transistor choice and interchangeability for a given circuit. In short, choice depends upon purpose, circuit polarity, operating characteristics such as signal input voltage or current, power-handling, operating temperature, power supply, etc. etc. Some circuit designs are more amenable to using MosFETs rather than bipolar junction transistors, and vice-versa.

The book that launched me into transistor circuit design is by Albert Malvino, entitled Transistor Circuit Approximations. While it is currently out of print, a number of used copies are available through Amazon beginning at under twelve dollars.  See https://www.amazon.com/Transistor-circuit-approximations-Albert-Malvino/dp/007039878X.

Peter A.Goodwin
Rockport, MA

There are generally two types of bi-polar transistors. PNP and NPN. Most small signal (i.e. not hi power) transistors can sometimes be substituted for a like transistor. That is a PNP can be replaced by a PNP but NOT a NPN. Likewise a NPN can be replaced by another NPN but NOT a PNP. There are lots of cross references to look up equivalent replacements. My favorate is https://www.nteinc.com/ I may be mistaken, but I think the most popular type of transistor in use today are of the NPN type.

William B Runyon Sr

The type of transistor used depends on what your doing.(amp, buffer, volt. regulator, ECT.) Also circuit specs. PNP and NPN can be swapped if the emitter and collector connections are reversed. This is true so long as device/circuit specs are similar. Hope this helps.

Robbie J
Green River, WY

LED Fader Answered 2019 Issue-6

I need a simple method to slowly fade an LED from bright to dim, then to bright again in about two seconds, then keep repeating. Does anyone have a circuit that does not require an IC?

Cindi Carrillo
Lexington, KY


This circuit consists of two main parts. The first part is the oscillator which is a standard circuit consisting of everything on the left hand side up to and including R4 and Q2. On the right hand side Q3 and R6 form a current source that drives the LED. It is controlled by the voltage on the base of Q3. R5 controls how fast C3 charges and discharges, controlling the voltage on the base of Q3. If the oscillator is to slow, decreasing C1, C2 and/or R2, R3 will speed it up. If the fading effect is to slow, decreasing C3 will speed that up.

Christopher Rhames
via email

Ah, this is a difficult thing to do simply. First an LED is not like an old tech incandescent bulb which gets dimmer when the voltage goes down and then brighter as the voltage goes back up to its correct operating voltage.

An LED turns on at a specific voltage and turns off at a lower voltage, it will continue to give light for some voltage range as long as the current is constrained to not exceed too high a current when the LED will burn out.


  1. An LED turns on or off depending on its driving voltage
  2. We can not exceed its operating current or we burn out the LED
  3. LEDs do not have different brightness depending on voltage.

The only way I know of making this happen is with a circuit that is called a pulse width modulator that changes the pulse width that drives the LED ON vs. OFF time. I have used an Arduino and a program sketch to do this, but I’m sure there’s someone out there who may have done this with something like a 555 timer IC which might be a “simpler” circuit. In fact I found this: Generate Pulse Width Modulation (PWM) Signal using 555 Timer IC https://circuitdigest.com/electronic-circuits/555-timer-pwmgenerator-circuit/

Notice here that the author uses a pot, variable resistor, to drive the 555 Timer IC to change it’s pulse width. This means you’ll have to hire someone to continually adjust the resistor up and down and up and down, etc, for two minute cycles to get what you want, definitely NOT realistic.

OK, so what does that resistor do? It probably changes the voltage going into the 555 timer that causes the 555 to increase or decrease the pulse width. This sounds like a sine wave of varying voltage wich could be made with another transistor circuit.

You might want to also watch: https://www.youtube.com/watch?v=QmB1Ev-h3y4 If anyone knows of a simple circuit that does this I’d like to know as well. BUT, I think the best you will be able  to do is to find a Pulse Width Modulating IC to do the job and then a driving circuit to produce whatever is needed to tell the PWM IC what pulse width is needed now.This might be the IC needed, I know you said you didn’t want an IC, but even the simplest circuit used a 555 Timer IC: How to use TL494 pulse width modulation control IC 94 https://microcontrollerslab.com/tl494-pulse-width-modulationcontrol- ic/ Good-luck and I hope this helps at least a little.

Phil Karras KE3FL

Ms. Carrillo raised a question about a means of driving an LED from bright to dim, then reverse, and repeat.  She further stipulated that it must be a non-IC-based circuit.

Since LED brightness is a nearly-linear function of its forward current, this suggests a triangle-waveform driver circuit. An examination of the information available on the internet for a transistor-based circuit uncovered a suitable circuit1 for which I have modified timing component values and added an output buffer, all of which is shown as Figure 1 below.  

Figure 1:  Schematic diagram

The circuit operates from a 12-volt source. It is comprised of two current-mirror elements Q1-Q2 and Q3-Q4, and a three-way differential comparator circuit Q5, Q6, and Q7. Current mirror Q3-Q4 functions such that the current drawn by the collector of output transistor Q4 will always be identical to the current supplied to the collector of input transistor Q3; a similar explanation can be made for the operation of current mirror Q1-Q2. 

Figure 2:  Charge C1

In the initial state, capacitor C1 is fully discharged. Upon application of power, R1 provides about 3.5 mA into current mirror Q3-Q4. Since the voltage at the upper end of C1 [V(C1)] is zero, Q6 is off. Q5, however, is forward-biased by the voltage divider R3-R4, thereby completing the circuit Q1-Q5-Q4, such that 3.5 mA is drawn by Q4 out of Q1. Because Q1-Q2 is also a current mirror, a current of 3.5 mA will be applied to C1 by Q2, whence V(C1) increases from zero. C1’s voltage increase is linear because the charging current is a constant value. See interval t1 in Figure 2 above.

Figure 3: Switch

Transistor Q6 turns on at the point where C1 has risen to be equal to Q5’s base voltage. In its conducting state, Q6 steals current from R3, removing base drive to Q5, turning it off, thereby turning off current mirror Q1-Q2 whence charging current is removed from C1. See interval t2 in  Figure 3; “V(n004)” is the base voltage at Q5.

Figure 4:  Discharge C1...

C1 discharges into current mirror Q3-Q4 via the base-emitter junction of Q6. This action provides base current to Q6, keeping it turned on until such time as the terminal voltage of C1 [V(C1)] falls below the base voltage at Q7 (set by voltage divider R1, D1 and Q3). At this point, Q7 begins to turn on, rapidly shutting off Q6. See interval t3 in  Figure 4 above.

Figure 5: ... and repeat

Once Q6 is turned off, R3 can once again provide base current to Q5, turning it on; the cycle repeats. See interval t4 in  Figure 5 above, being the same as interval t1 in Figure 2.

Figure 6: ... and repeat

Figures 2 through 5 show V(C1), the terminal voltage of C1, having a triangular waveform with a period of two seconds. This voltage is impressed upon the gate of MOSFET M1; diode D3 provides a DC voltage shift to better match the MOSFET’s characteristics. M1 drives LED D2 through current-limiting resistors R5 and R6, whose values have been chosen to enhance current linearity. 

Figure 6 above shows the excellent match between drive voltage V(C1) and LED current I(D2). A linear drive current will produce a very nearly linear variation in light output; see Figure 7.

Figure 7:  LED Luminosity vs Forward Current

Some words about the components used: M1 is shown as a 2N7002, which is a surface-mounted device, for which leaded part 2N7000 is a functional substitute. BS170 is another leaded version of this part.  LED QTLP690C was a random choice from the LTSpice component library; choose your own with particular emphasis on current-vs-luminosity linearity. All resistors are 5% tolerance except R1, which is a 1% value. Given that the tolerance of C1 is probably not better than 10%, it would be wise to replace R1 with a 5K-ohm variable resistance to allow for adjustment if the timing is at all critical.

Current mirrors: Proper operation of a current mirror circuit requires that the silicon bodies of both transistors of the pair be at the same temperature. This is nearly impossible to achieve with discrete components, especially as in the present case when the power dissipated by the two transistors differs significantly, one from the other. Quad-transistor through-hole and surface-mount package equivalents of the 2N3904 and 2N3904 are available from Mouser and others; look for MPQ3904 and MPQ3906, respectively.

Ms. Carrillo did not specify the power of the LED to be driven. I assumed a small indicator, so that the maximum drive current provided by this circuit is just shy of 20 milliamperes. For larger, more-powerful devices, a larger MOSFET would be needed (with attendant modifications of the values of R5 and R6). A preferred approach in this case would be to use the drive current available at the drain of M1 as a means of modulating a multivibrator circuit, driving the large LED with a pulsed current whose pulse width varies according to the linear triangle-wave modulation. While such a circuit is beyond the scope of the present discussion, several, 2.3 have been found in the literature.

1 https://www.electronicspoint.com/forums/threads/7-transistors-triangle-wave-generator-650khz.264497/
2 See US Patent 3445788A, Camenzind, Pulse-Width Modulation Circuits (https://patents.google.com/patent/US3445788A/en)
3 See US Patent 3587002, Brown, Voltage-Controlled Transistor Multivibrator  (https://patents.google.com/patent/US3587002)

Peter A. Goodwin
Rockport, MA

There are several simple circuits around that will do it, just google "breathing LED circuit," but there are also LEDs with the circuit built in. The only supplier I know of is Lighthouse LEDs in the US (I forget where, I buy online).

Lance Turner
East Ridgley, Australia

Ripple Voltage Monitor Answered 2019 Issue-6

I need a circuit to monitor the AC ripple voltage on a 12 volt linear power supply? A digital display would be ideal.

Brian Lambdin
Plano, TX


Mr. Lambdin inquired about a circuit to monitor the AC ripple on the output of a linear power supply.  The inference is that the frequency response of the circuit need not be excessive. He also wanted a digital display.

I found what ought to be a suitable device, in kit form, from Amazon, for $29.95. See https://www.amazon.com/Oscilloscope-Handheld-Pocket-size-Electronic-Learning/dp/B01LWK49W3/ref=asc_df_B01LWK49W3/?tag=hyprod-20&linkCode=df0&hvadid=309778489815&hvpos=&hvnetw=g&hvrand=18068906155916055584&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=1018200&hvtargid=pla-465542683176&psc=1

Peter A. Goodwin
Rockport, MA

In a linear supply the vast majority of the ripple will be at the input frequency which will normally be the power line frequency (50 or 60 hz) or two times that frequency (100 or 120 hz.) A digital multimeter on the AC volt ranges is intended primarily for that frequency range. By blocking out the DC from reaching the meter any DMM set to the AC volt ranges should measure it fairly well. A "True RMS" type meter is best since the ripple probably will not be a sine wave.

To block out the DC part simply put a capacitor in series between the positive side of the supply and the positive input of the DMM. A value of 1 microFarad or more should work. If you use any type of polarized capacitor such as an electrolytic make sure to connect the positive end to the positive output of the supply. Of course, make sure the voltage rating of the cap is higher (16 or 25 Volts should be fine) than the supply. You may need to put a fairly high value resistor (say 10 K Ohms) across the meter leads (from the negative end of the capacitor to the negative side of the power supply.

William Cooke
Adams, TN

SPDIF Input 2020 Issue-1

I have some legacy recordings on DAT I’d like to re-edit as my skills have improved, but my DAT recorder has only a SPDIF digital output. My old XP box had this on the mother board, and all I needed was the back plate with the RCA jack and the cable to the pins on the board. Adobe Audition recognized it immediately.

Newer computers do not have SPDIF inputs. I would think converting the SPDIF serial stream to serial USB would be simple enough as far as circuitry goes, a lot simpler than an analog composite video (and S-video) plus audio to a USB device I can get for $30 with software. Perhaps a Windows 10 driver is is needed and is a challenge?

Every search only returns a flood of USB to SPDIF dongles, which is the wrong direction, and a few very expensive sound cards with many other unneeded functions. Is there a simple/inexpensive solution?

Dennis L Green
Farmington Hills, MI


Searching for "spdif input" under "Computers, Tablets, and Networking" seems to show a number of things like what you want. Here's the list: https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2047675.m570.l1313&_nkw=spdif+input&_sacat=0 And here's one that looks useful: https://www.ebay.com/itm/184216799887?hash=item2ae42d4a8f:g:6jMAAOSwJ81gZjs1 They're in the $20-$40 range, which doesn't seem too bad.

Mitch Golden
via internet

I did a quick Google and found this in my second hit: www.amazon.com/Ebetter-External-Surround-Recording-Compatible/dp/B07BT6CM6Q Says it does SPDIF to USB when set for digital input. And it's under $20. I'm lucky, I still have a few SPDIF compatible sound cards from the late 90's/early 2000's that are PCI based, and PCs with PCI cards.

Ralph Phillips
Bossier City, LA

Electromagnetics: Transformers, Generators, Motors, and Other AC Machinery Answered September 2017

I’m trying to make sense of everything coiled, but the only thing getting wound up is me! I thought I knew a bit about electromagnetics, but recently I’ve been trying to make sense of all these fields and flows.

What is the difference between the magnetic field and the flux? How does flux work in a transformer or a generator? Does anyone really understand Maxwell’s Equations?

So many textbooks dealing with electromagnetism speak in equations instead of English. I want to know HOW it all works, not just how to compute these things. Am I just reading the wrong books? Can you help me figure out what the flux is going on?

Taylor Street
Felton, CA


I have spent a lot of my life wondering about magnetics. Welcome to the club! Hopefully the information that I have is correct

Here are a few basics:

  1. When an electron moves, it generates a magnetic field in addition to the electric field that's always there.  — Why?: Because
  2.The field exists if the electron/electrons move in a wire, a stream (e.g. in a tube), or anything else.
  3. Magnets 'work' because (if I have this right), the arrangement of their molecules is such that the electron orbits of the individual atoms are oriented such that the fields generated add together. The relative strength of a magnetic material is based on how well they are aligned. Magnet discussion usually describes magnetic domains within the material. (Magnetizing a material means that you apply a magnetic field to align the domains.)
  4. Non magnetic materials don't feature this alignment. Electron orbits are in random orientation and the fields cancel.
  5. Magnetic fields are constant for DC current and non moving magnets.
  6. Time varying fields are generated from AC current and moving magnets.
  7. Time varying fields do the following: A. If they pass through a wire they will cause the electrons to move — thus a transformer. B. If they encounter another magnetic field they will cause either an attractive or repulsive force — thus a motor. (This force is also present in static field interactions, but that won't make a motor.)
  8. Coils of wire are used in transformers and motors because the fields add and compact devices can be made.
  9. The field descriptions are always confusing. What I got out of it was that the B field is the description for the field you would find due to the current or magnetic material. The resultant field that you can measure depends on the material that the field is in.

Exmple: If you have a long solenoid, the field inside will be fairly constant if you're not too close to the ends. If you put a piece of ferrous material inside, there will be an increased field through the metal because it's easier for the 'flux' to go through this material. (This also affects the input current to some extent, in the same way that a a lower resistance load affects an electric circuit.)

  10. There seems to be no end of magnetic units — just like farenheit, centigrade, and Kelvin for temperature.
  11. Maxwell hopefully understood his equations, along with some other smart people.

The math that you see everywhere generally shows what fields you can expect due to different circumstances. It is very difficult, and I certainly don't understand it. Happily, computers are now available that are powerful enough to avoid a lot of it. They use a method called finite element analysis. Basically they calculate fields based on the sum of tiny elements at each point of interest in a field.

Harold Johnson
via email

Diesel Computer Mods Answered 2019 Issue-5

There are several entities that will modify the settings on the engine control computer for a diesel Chevy pickup to increase power. I assume they are adjusting the timing curves and other parameters. Is there an adapter and software available for me to experiment with this myself?

Karel Dostál
Covina, CA


I really hate to be a wet towel, but this is really not a good idea. Arbitrarily adjusting things like fuel and timing is most likely to result in a smoking, noisy engine. If run to long the engine is more likely to self-destruct than increase power. Not to mention tailpipe pollution. Even "professionally" reprogrammed engines emit excess pollution, and shorter lifespan.

Bill van Dijk

Car Detection Answered 2019 Issue-5

I’m looking for help designing a circuit to detect cars driving up my private road. I have in mind something like the wire loop embedded in roads to sense cars at a traffic light. Can you explain the principle behind this method and how a basic DIY version might be implemented?

Ulrike Krüger
Laconia, NH


A Passive Infrared (PIR) detector is much less expensive and easier to use. There are many available for outdoor use, with battery operation and remote monitoring by Wifi or other means. I don’t know of any DIY road loop circuits, and they are being phased out due to high installation and maintenance costs in favor of cameras, which are another choice.

I once bought a little board from a guy in Australia which monitored standard NTSC video and detected movement. Worked pretty well.

Richard Cox
Thousand Oaks, CA

Guitar Tuner Answered 2019 Issue-5

I’m trying to build an electronic guitar tuner. Is there an IC available to generate the proper tones?

Hamish Morisset
Norcross, GA


I would suggest an ebay search for guitar tune”. There are several listed in the ten dollar range with free shipping. The tuners don’t generate a tone but receive a tone and show the note on the lcd. I think parts cost for self build would be higher than purchase.

Steve Benson
New Castle, IN

Dish Projects Wanted Answered 2019 Issue-5

I have a couple of small satellite dishes (Direct TV I think) with receivers that have been sitting in the garage for a while. I hate to throw out technology that could be repurposed. Anyone have an idea for a cool DIY project I could reuse them for?

Devin Martel
Durham, NC


Make a long distance microphone like they use at football games. Mount a microphone at the focal point and connect to an audio amp and headphones.

Richard Cox
Thousand Oaks, CA

Page 2 of 34 pages  < 1 2 3 4 >  Last ›