IR2110 High Voltage H-Bridge Driver
Fig. 1 IR2110 High Voltage H-Bridge Driver
Click image for larger view.


Student-Hobbyist Electronics Projects Tutorials

by Lewis Loflin


Introduction - The purpose of these pages is to introduce the student and hobbyist to electronics projects.

I've been a part-time adjunct professor at a local community college teaching electricity and electronics.

Today I do this for the shear love of electronics.

I have 45 years experience in electronics, from vacuum tubes to modern solid state and industrial controls. I tend to teach from a general science viewpoint.

This site has been up for about 18 years and covers a number of subjects broadly how to use the Arduino microcontroller and semiconductor components such as transistors, MOSFETs Zener diodes, op-amps, etc.

These are presented as information only - you assume all risk. Most voltages are under 24-volts. Read this safety warning.

New January 2024.


Related YouTube videos.


See my You Tube Videos page lists the over 206 videos on My YouTube Channel.

Here are quick navigation to the many parts I cover. These build on each other.

Quick Page Navigation of Topics


My You-Tube Electronics Videos I have a YouTube channel with ~280 videos on electronics. The link are a list of the videos.

Here I demonstrate the use of four microcontrollers. Note the following links:

Arduino Microcontroller is the most popular hobby device programmed in C/C++. This is open source with a large community base. That is most of what I use. There are several variations.

Raspberry Pi is a small computer more powerful than a mere microcontroller. It is often operated with Linux running C or Python. It operates as a low-end PC. It has no connections for a hard drive or onboard clock. A solid state drive can be connected with separate hardware through a USB port. This also has programmable GPIO pins for connecting external hardware. I present many hardware and programming examples.

PICAXE Microcontroller is based on a Microchip PIC controller with a built-in basic interpreter. It is used for teaching beginning programming to students. I think it is the best for operating simple controls and easy to use. It have a much smaller community than Arduino. I present a number of circuit examples.

Using PC Printer Ports is section on how to connect electronics to a PC printer port. This can be programmed under Linux using a special type of Python or in C. The Linux desktops with this and Raspberry Pi are identical. Only the hardware interface differs.

PIC18F2550 is a powerful and complex controller produced by Microchip. This is programmed in C with Microchips MPLAB.

PIC16F628A and PIC16F84A are lower end Microchip controllers. They are easy to use but take more practical electronics skills. I program them in assembly with MPLAB and present a number of examples.

Basic MOSFET h-bridge circuit


H-Bridge Motor Controls

An H-Bridge, in general, is a 4-switch (often a type of transistor) circuit used to control the direction of a permanent magnet DC motor. Through the use of a microcontroller, speed and direction can be controlled.

In the illustration above, I used 4 MOSFETs (metal–oxide–semiconductor field-effect transistors) wired in an "H" configuration. These diagrams include bipolar transistors, IGBTs (insulated gate bipolar transistors), or combined devices.

With both SW1 and SW2 open, the two n-channel MOSFETs (U2, U4) are turned on, switching both sides of the motor to ground. The motor is off.

Press SW1 and U2 turns off, U1 turns on. This combination creates a current path from U1 through the motor to U4 to the ground. The motor rotates, say, clockwise.

Release SW1 and press SW2 U4 turns off, U3 turns on creating a current path from U3 to the motor to U2 to ground. The motor direction of rotation is reversed.

The circuit above has limited uses. Things get interesting when combined with a microcontroller or PLC (programmable logic controller)

I present many circuit examples using several devices. These are working circuits built and tested. These are tutorials, not commercial circuits.



Return to main Menu

Switching circuit example.


Transistors used in these Projects

I present many transistor tutorials, including testing and comparing devices.

There are broadly two transistor types: MOSFET and bipolar. There is a third type known as an IGBT, a hybrid of MOSFET and bipolar. Another subtype of the bipolar transistor is the Darlington, used for high power gain.

There are important differences besides varying voltage and current ratings. Their operation differs: a MOSFET is voltage controlled; a bipolar transistor is current controlled.

An IGBT is voltage-controlled but acts as a bipolar transistor. We explore these circuits in detail.


Return to main Menu

TC4420 based h-bridge circuit.


Transistor Driver Circuits

Broadly using low-voltage digital controls often can't directly operate high voltage and high power transistor circuits. So we use various forms of driver circuits.

Small transistors can drive larger transistors. Opto-couplers can provide voltage isolation and can drive other transistors. We have circuits such as the TC4420 integrated circuits that can do both.

There is a separate section on optocoupler circuits below.


Return to main Menu

ATX power supplies.
Test Reuse Surplus Personal PC Power Supplies

Power Supplies

Power supplies come in three types for the hobbyist: build, buy, or salvage. I address all of this.



Safety issues:


Return to main Menu

Arduino Buck Switching Voltage Regulator
Click for larger image.


Switching Power Supplies



Return to main Menu

Single MOC3011 optocoupler triggers two SCRs.
Single MOC3011 optocoupler triggers two SCRs.


Opto-Coupler, SCR, and Triac Circuits

SCRs and Triacs control AC and DC power systems from lamp dimmers to solid-state relays. A microcontroller such as Arduino using a zero-crossing detector can control AC power to control light levels, AC motor speed, and resistive heating elements.

More on power control below.



Return to main Menu

Zero-crossing pulse as related to a AC sine wave.
Zero crossing pulse from 4N25 optocoupler in relation to AC sine wave.


A zero-crossing detector produces a pulse at the beginning of every half-cycle in an AC sine wave. For 60Hz, this is 120 pulses per second. Then we use a microcontroller to phase control the power.


Return to main Menu

Flashtube circuit triggered by Sidac

DIACs, SIDACs, and unijunction transistors are in the SCR-TRIAC family but are used for triggering and as oscillators.

DIACs, SIDACs, unijunction transistors, xenon gas-discharge tubes, and NE-2 neon lamps display a property known as "negative resistance." They all can generate switching electrical pulses.


Return to main Menu

Flashtube test setup with HV power supply.
My experimental flashtube test setup.

Xenon photoflash tubes create a bright flash in cameras, strobe lights, etc., in conjunction with SCR, SIDAC, and DIAC circuits.

Caution: xenon flash tubes are high-voltage devices, often 300V DC.


Return to main Menu

Experimental ratiometric Hall-sensor comparator circuit on prototyping board B.

Experimental ratiometric Hall-sensor comparator circuit on prototyping board

Hall Sensors

A Hall sensor is an analog integrated circuit in its most basic form. It consists of a Hall plate that outputs a "transverse" voltage based on the intensity of a magnetic field - polarity is dependent on magnetic polarity.

It also consists of a high gain differential amplifier because the generated voltage is small. The output voltage is analog, usually centered around half the power supply voltage.

The addition of a Schmitt trigger with a properly set hysteresis will create a Hall switch or Hall latch. They often have an open collector output transistor.

New video 6/8/2022 Basics of Hall Effect Analog Sensors & Switches



Return to main Menu

LM358 comparator circuit.

Comparator Circuits

The Schmitt triggers used here are based on an analog comparator. These can use operational amplifiers (op-amps) such as the LM358 or LM741.

Or one can use the LM311 comparator or LM339 quad comparator. They have open collector outputs unlike the LM358 or LM741 op-amps.

A comparator "compares" two analog voltages and turns on-off based on their voltage levels.

Often considered "digital" at this point, we have, in reality, a one-bit analog-to-digital converter.


Return to main Menu

LM317 power constant current control.
LM317 power constant current control.


Constant Current or Current Limiter Circuits

The TL431A, The LM317, and LM334 are power and inexpensive current regulators used for lighting LEDs, controlling battery charger current, etc.

The LM317 and related parts are used in low-voltage DC power supplies.



Return to main Menu

Basic Photodiode Operation.


Return to main Menu

SN74HC14 based square wave generator with differentiator circuit.
SN74HC14 based square wave generator with differentiator circuit.



Return to main Menu

Arduino with unipolar stepper driver control board.
Fig. 1 Arduino with unipolar stepper driver control board.
Click for larger image.

Stepper Motor Circuits



Return to main Menu


Actual constructed radio on wooden board.

Radio Circuits, Misc.



Return to main Menu

Arduino connected to several I2C circuits.
Fig. 1

Arduino Micro-controller Projects

Arduino Microcontroller Projects presents many tested projects and examples for Arduino. The emphasis is hardware control which suggests one has an electronics background. Having a background in digital logic and binary code is also helpful. The projects will explain this as needed.

What differs here is I avoid the use of Arduino-only code and code libraries to port the basic code algorithm to Python, PICAXE basic, or Microchip PIC C.

See Arduino Projects Hobby Projects Tutorials.




Return to main Menu

PIC18F2550 Bolt prototyping board.


Microchip PIC Projects PIC18F2550, PIC16F628A, PIC12F683

Microchip PIC18F2550 projects are based on the BOLT system board but can be used without it. Centered on the PIC18F2550 is programmed in C like Arduino and the programs are often interchangeable. I present a lot of code examples.

Also included in that section is assembly language projects for the PIC PIC16F628A and PIC12F683. While cheap and versatile controllers there's a steep learning curve in using assembly.

Introduction to PIC12F683 Programming


Return to main Menu

PIC16F628A prototyping board.
Home built PIC16F628A and PIC16F84A prototyping board.


Start here: Introduction PIC12F683 Programming Circuits Tutorial

I own and have used the K150 programmer and the Velleman K8048 PIC Development Board.

The Velleman K8048 PIC Development Board is available from Amazon. It requires assembly (soldering) and uses a standard PC serial port (or USB adaptor), plus a 15-volt power supply is not included. It will program 8, 16, 18, and 28-pin PIC controllers.

Need help or have questions email me at lewis@bvu.net.


Return to main Menu

Home built PICAXE prototyping board.
Home built PICAXE prototyping board.


PICAXE Microcontroller Projects

The PICAXE Microcontroller I use is the medium-range PICAXE-18M2. While built hardware-wise on a Microchip PIC controller, it has an easy-to-learn built-in proprietary basic. PICAXE is for students rather than serious, commercial applications.

The PICAXE series of micro-controllers rank as the easiest and most cost-effective way to use Microchip processors. I wanted an easier and less expensive way to introduce my students to the "PIC" microcontroller. I plan to get those starting past poorly written literature and lack of simple working code examples.


Return to main Menu

Raspberry Pi to Arduino interface.
Raspberry Pi to Arduino interface.


Raspberry Pi and Linux

Raspberry Pi is an ARM processor-based mini Linux computer clone. It has addressable hardware IO for connecting external circuitry. These projects are in Python, a high-level interpreted language finding many modern applications.

Currently, there are four models, with the Model 4 being the most powerful.

I have interfaced a Raspberry Pi 1 to an Arduino microcontroller, DS1307 RTC, and LCD in the above image. The pages below cover all of this.

The Linux desktops I use is Openbox-LXDE or Openbox.

Note Openbox is not a complete desktop but a window manager. Additional programs are required. They must be set up individually.

I design these for speed and function. I remove slow and bloated programs.


These are mostly sensors connected through the I2C protocol. While digital themselves, they can measure analog sensors. I programmed the above Arduino controller to operate as an I2C slave device.


More software for Raspberry Pi:



Return to main Menu

Connecting an LCD display to a PC printer port.


Connecting PC Printer Port to External Electronics


Below are listed projects using pyparallel and electronics. We will use a common PC printer port to learn basic Python and electronics interfacing. Starting with routines I wrote to aid students; I'd advise walking through this in sequence. Have fun, and send comments or corrections to lewis@bvu.net.

Connecting a PC Printer Port to Electronics with Python is closely related to Raspberry Pi. It, too, is a nearly identical Linux system but differs in being designed to use a hardware printer port as I-O to connect electronics projects. The projects here, too, are in Python and, with modifications, will work on Raspberry Pi and vise-versa.

It differs in I never bothered to set up the I2C interface found in Raspberry Pi; instead interfaced an Arduino to better handle low-level electronics.

Now available for download is a custom live Linux distribution to use a PC printer port for electronics control - without installing or altering the PC.

See Live Linux Distro for Using Printer Port with Electronics



Printer Port Projects Main Page


Return to main Menu

Weston Model 614 light level meter has highly radioactive glass lens.
Weston Model 614 light level meter
has radioactive thorium glass lens.
Click for larger picture.



Return to main Menu

Popular Webpages & Corresponding Videos


Return to main Menu


Web site Copyright Lewis Loflin, All rights reserved.
If using this material on another site, please provide a link back to my site.