FriendlyWire.com


beginner-friendly electronics tutorials and projects


Discover the joy of understanding electronics!

How to use rotary encoders

May 27, 2023 tutorial

Rotary encoders everywhere: in your car's radio, on your bench power supply or oscilloscope, or in the scroll wheel of your mouse. So let's take a closer look at incremental rotary encoders with a built-in pushbutton, look at how they work, and how you can use them in your electronics projects! Keep reading.

  • rotary encoder
  • incremental rotary encoder
  • Gray code
  • PIC16F1455
  • breadboard
  • beginner-friendly
  • tutorial

Three wires to rule them all: CD4094 & CD4021 shift register tutorial

December 17, 2022 tutorial

What do you do when your microcontroller does not have enough pins? In this tutorial we will learn how to use shift registers to control LEDs and to read out pushbuttons, all with just three wires! In six steps, we will learn all about the CD4094 output-type shift register, the CD4021 input-type shift register, and how to use them with a PIC microcontroller. And in the end we will pit it all to use with an SNES game controller, which—you guessed it—also uses shift registers on the inside. Keep reading.

  • CD4094
  • CD4021
  • shift register
  • PIC16F1455
  • beginner-friendly
  • schematic
  • tutorial

MAX7219 LED multiplexing tutorial

December 4, 2021 tutorial

The MAX7219 integrated circuit uses multiplexing to drive up to 64 individual LEDs. And in this tutorial we will learn how the MAX7219 works, what multiplexing is, and how you can use popular MAX7219-based modules to drive 7-segment displays and LED dot matrix displays with a PIC microcontroller. Keep reading.

  • MAX7219
  • multiplexing
  • 7-segment display
  • dot matrix display
  • serial protocol
  • PIC16F1455
  • MPLAB X IDE
  • MPLAB X IPE
  • XC8 compiler
  • beginner-friendly
  • schematic
  • tutorial

How to get source code on a PIC microcontroller

November 6, 2021 tutorial

Say you have found a PIC microcontroller project that you really like. Because it uses a microcontroller it comes with source code that tells the microcontroller what to do. But how do you get that source code on the PIC microcontroller? This is what this tutorial is all about! Keep reading.

  • PIC microcontroller
  • How to program a PIC microcontroller
  • MPLAB X IDE
  • XC8 compiler
  • MPLAB IPE
  • PICkit3
  • .hex-file
  • tutorial

How to use WS2812 “NeoPixel” LEDs with a PIC microcontroller

July 12, 2021 tutorial

Do you want to step up your LED game? Then look no further! The WS2812 “NeoPixel” RGB LEDs are intelligent, individually addressable LED modules. And the best part: Besides two wires for power they only require one data line for as many LEDs as you could want. And today we will learn how to use the WS2812 LED with a PIC microcontroller. Keep reading.

  • WS2812
  • WS2812B
  • NeoPixel
  • RGB LED
  • SK6812
  • PIC microcontroller
  • PIC16F1455
  • beginner-friendly
  • schematic
  • tutorial

Breadboard capacitive touch sensor tutorial

May 15, 2021 tutorial

Capacitive touch sensors are everywhere, and today we will learn how to build one from scratch on a breadboard with a PIC microcontroller, a resistor, and a wire. And to keep things interesting, we will build a momentary switch, a toggle switch, a timer, and a 3-level dimmer. Keep reading.

  • touch switch
  • capacitive switch
  • breadboard stray capacity
  • PIC16F627A
  • touch lamp
  • beginner-friendly
  • schematic
  • tutorial

DS1302 real-time clock tutorial: the clock that doesn't forget the time!

November 4, 2020 tutorial

Whenever you are building a clock with a microcontroller there is a problem: when you turn off the power, the time is lost. This is where a real-time clock comes in. It's a handy little integrated circuit that uses a small battery to keep track of the time whenever the main power is disconnected. And in today's tutorial we will learn all about it: how to use it with a microcontroller and how to store custom bits and bytes on there as well. Keep reading.

  • DS1302
  • real-time clock
  • RTC
  • 32.768kHz
  • battery backup
  • real-time clock RAM
  • PIC microcontroller
  • PIC16F1455
  • buffer battery
  • TLC5916 LED driver
  • beginner-friendly
  • schematic
  • tutorial

CD4017 tutorial: the IC you can count on

October 7, 2020 tutorial

Whether you are a beginner who wants to take some first steps in electronics or you already have some experience, the CD4017 is an integrated circuit everybody should know. It works as a simple digital counter from 0 to 9, but it can also be used in much bigger projects, and today we will learn all about it! Keep reading.

  • CD4017
  • decimal counter
  • debouncing
  • power-on reset
  • cascading
  • custom resets
  • CD4081 AND gate
  • reliable reset circuit
  • external clock
  • NE555
  • beginner-friendly
  • schematic
  • tutorial

TLC5916 tutorial: best breadboard 7-segment LED driver!

July 24, 2020 tutorial

Whenever you have a project that needs to show some information to the user, 7-segment displays are a great way to do that. In this tutorial I will show you how to use the TLC5916 driver IC to control as many 7-segment displays that you like. And second, I will show you a method to mount 7-segment displays right on top of their TLC5916 driver ICs which allows for a super clean and space-saving breadboard layout! Keep reading.

  • TLC5916
  • 7-segment displays
  • breadboard electronics
  • constant current
  • LED driver
  • shift register
  • PIC16F1455
  • MPLAB X IDE
  • MPLAB X IPE
  • XC8 compiler
  • beginner-friendly
  • schematic
  • tutorial

NE555 tutorial: three useful circuits

June 20, 2020 tutorial

The NE555 is an extremely versatile integrated circuit that can be used for a wide variety of situations and projects. Today we will learn about what is inside an NE555, and how we can use it to build an oscillator, a timer, and a flip flop switch with a few capacitors, resistors, and of course the NE555. Keep reading.

  • NE555
  • oscillator
  • timer
  • flip flop
  • astable mode
  • monostable mode
  • bistable mode
  • beginner-friendly
  • schematic
  • tutorial

Control LEDs with your computer using RS232

September 20, 2019 tutorial updated April 26, 2020

RS232? That sounds so 1990! Maybe so, but in this tutorial I want to show you how easy it is to control a bunch of LEDs from your computer using RS232. But instead of LEDs you can also control all kinds of other electronics with it! Like the scrolling text display from last time, hooked up to a laptop and working as a typewriter! Keep reading.

  • RS232
  • serial port
  • USART
  • RS422
  • MAX232
  • level shifter
  • data transmission
  • BAUD rate
  • tutorial

Understanding digital to analog converters

January 19, 2019 tutorial

In this tutorial we will learn how to use digital to analog converters (DACs) to create an analog voltage from a digital number. DACs are the opposite of analog to digital converters (ADCs) that we already talked about previously. At the end, we will control the brightness of an LED via the DAC module of the PIC16F1455. Keep reading.

  • tutorial
  • analog signals
  • digital to analog converter
  • DAC
  • string resistor ladder network
  • R-2R network
  • reference voltage
  • resolution
  • PIC16F1455
  • beginner-friendly
  • breadboard
  • schematics
  • microcontroller

How to use light-dependent resistors (LDRs) with microcontrollers

January 13, 2020 tutorial

Microcontrollers show their true potential when we connect them with sensors providing the microcontroller with information about the real world. In this tutorial we will learn how to connect a simple light-dependent resistor (LDR) to a PIC microcontroller that allows us to have the controller react to the ambient brightness. Keep reading.

  • LDR
  • light-dependent resistor
  • photoresistor
  • photodiode
  • phototransistor
  • brightness control
  • lux
  • ADC
  • analog to digital converter
  • voltage divider
  • microcontroller
  • tutorial

Drivers 101 - learning how to control large loads with a small microcontroller

December 28, 2019 tutorial

For most of our projects we have relied on switching LEDs ON or OFF. But what if we want to control something bigger than an LED, say, a lightbulb? Or many many LEDs that draw a substantial amount of current? In this tutorial we will learn how to use drivers such as transistors and relays to accomplish exactly that! Keep reading.

  • driver
  • NPN
  • PNP
  • transistor
  • transistor array
  • relay
  • solid state relay
  • thyristor
  • TRIAC
  • tutorial

Understanding analog to digital converters

December 8, 2019 tutorial

When working with microcontrollers we sometimes forget that the real world does not just consist of 1's and 0's. It is what we call analog, and in this article we will learn on how to convert analog values from the real world (like the position of a potentiometer) into a digital number consisting of 1's and 0's. Keep reading.

  • tutorial
  • analog signals
  • analog to digital converter
  • ADC
  • conversion time
  • reference
  • resolution
  • beginner-friendly
  • breadboard
  • schematics
  • microcontroller

CD4026 decimal counter tutorial

November 17, 2019 tutorial

The CD4026 is an integrated circuit (IC) that works as a counter from 0-9 with an integrated decoder for a 7-segment display. I think it is an ideal beginner circuit for anybody who wants to learn electronics. In this tutorial we will go through the very basics of this IC and learn, step by step, how to connect it to pushbuttons, a 7-segment display, and a battery, to build our own counter! Keep reading.

  • CD4026
  • decimal counter
  • 7-segment display
  • common cathode
  • debouncing
  • beginner-friendly
  • schematic
  • tutorial

How do old school analog panel meters work?

October 27, 2019 tutorial

Panel meters are simple electromechanic devices that can be used to measure currents, voltages, and resistances. Even though they seem to fade away in today's ever more digital electronics world, I think it is worthwhile to learn a little bit about them. How do they work? And how can we use them in electronics to measure stuff? Keep reading.

  • panel meter
  • ammeter
  • voltmeter
  • ohmmeter
  • moving coil instrument
  • magnetic field
  • spring
  • tutorial

Learn binary!

October 18, 2019 tutorial

We all know decimal numbers, but computers work with binary numbers which are formed from 0's and 1's. When working with microcontrollers it is extremely helpful to know a little bit more about binary numbers as well as operations that can be performed on them (called Boolean operations). In this tutorial we will go through the basics so that we can face any binary number that crosses our path! Keep reading.

  • decimal
  • binary
  • hexadecimal
  • Boolean operations
  • NOT
  • AND
  • OR
  • NAND
  • NOR
  • XOR
  • SHL
  • SHR
  • tutorial

CMOS 101 - Understanding integrated circuits of the CMOS family

October 4, 2019 tutorial

Microcontrollers are great, but sometimes it doesn't hurt to think outside the box a little bit. In this tutorial we will go through the basics of integrated circuits (ICs) of the CMOS family, including counters, logic gates, encoders & decoders, shift registers, flip flops, and others. Knowing when you can use a CMOS IC to solve a simple problem can and will make your life easier! Keep reading.

  • CMOS
  • 5V logic
  • decimal counter
  • binary counter
  • logic gates
  • encoder
  • decoder
  • shift registers
  • tutorial

More microcontroller outputs with shift registers

September 29, 2019 tutorial

What do you do when your circuit has a lot of LEDs that need to be individually turned on and off? Do you always need a bigger controller with more I/O ports? The answer is no! Using a so-called shift register you can extend the number of outputs almost arbitrarily. In this tutorial we will learn how :) Keep reading.

  • shift registers
  • I/O ports
  • data
  • clock
  • strobe
  • cascading
  • CMOS
  • CD4094
  • tutorial

Use RS232 to connect your microcontroller to a computer or another controller

September 20, 2019 tutorial

RS232? That sounds so 1990! Maybe so, but in this tutorial I want to show you why I still think RS232 is a good protocol to connect your PIC circuit to a computer, and, perhaps more importantly, to another PIC controller. Many PIC controllers have a built-in USART module that allows you to utilize the full power of the asynchronous data transmission and reception offered by protocols such as RS232. Let's do it! Keep reading.

  • RS232
  • serial port
  • USART
  • RS422
  • MAX232
  • level shifter
  • data transmission
  • BAUD rate
  • tutorial

How to configure your PIC microcontroller

August 17, 2019 tutorial

In every single PIC microcontroller project we do it: set the configuration bits. But what does that accomplish? In this tutorial we will go through the basic options for these “configuration bits” and we will focus on the PIC16F627A microcontroller so that we have a concrete example. Keep reading.

  • configuration bit
  • PIC microcontroller
  • FOSC
  • WDTE
  • PWRTE
  • MCLRE
  • BOREN
  • LVP
  • CPD
  • CP
  • oscillator selection
  • watchdog timer
  • power-up timer
  • brown-out detection
  • low-voltage programming
  • EEPROM memory code protection
  • code protection
  • tutorial

How to adjust LED brightness with a PIC microcontroller

August 2, 2019 tutorial

In our first real microcontroller project we made an LED blink: it could be either ON or OFF. But what if you want to control the brightness of the LED and dim it? With a microcontroller this is usually accomplished by pulse width modulation, or PWM for short, and in this tutorial we will learn how to dim an LED using the PWM module inside a PIC16F627A microcontroller! Keep reading.

  • tutorial
  • PWM
  • LED
  • pulse width modulation
  • dimming
  • RC filter
  • analog-to-digital converter
  • DAC
  • beginner-friendly
  • breadboard
  • schematics
  • microcontroller

Programming a 1Hz clock signal

July 5, 2019 tutorial

Electronic clocks are everywhere, so it is probably a good idea to learn how they work. And the most important part of a clock is, of course, the clock signal. In this tutorial we will learn how to generate a reliable 1Hz signal using a PIC microcontroller. In the end, we will write a small program that makes an LED blink precisely once a second. And soon enough, we will be able to build our first digital clock using this technique! Keep reading.

  • clock
  • 1 Hertz
  • quartz crystal
  • 4.194304MHz
  • microcontroller
  • timer
  • prescaler
  • interrupts
  • C code
  • .hex file

Schematics 101 – how to read them and not get overwhelmed

May 31, 2019 tutorial

Whenever you build an electronics project that surpasses a certain complexity, a schematic is needed. Schematics show all the components in an electric or electronic circuit, and how these components are connected to each other. At the same time, they can be quite hard to understand and it is easy to get overwhelmed. In this tutorial we will go through the basics of schematics, and I will list a few helpful strategies to understand even complicated schematics. Keep reading.

  • schematics
  • circuit
  • beginner
  • power supply
  • ICs
  • labels
  • junctions
  • conventions

How to read out a pushbutton with a PIC microcontroller

May 24, 2019 tutorial

In this week's post we will discuss the simple question of how to read-out the state of a pushbutton using a microcontroller. How can we check if a button is pushed down or not? What are common pitfalls? I am convinced that breaking down a more complicated project in little digestible pieces is a great idea to develop a deep understanding of a topic. So here we go! Keep reading.

  • pushbutton
  • tristate register
  • pullup resistor
  • pulldown resistor
  • debouncing
  • tutorial
  • beginner-friendly
  • microcontroller

Buttons and switches 101

May 18, 2019 tutorial

Whenever a circuit relies on an external mechanical input we use switches or buttons. I thought it would be interesting to collect the most common variants of switches and buttons that are typically found in electronics. Please let me know if I missed your favorite one! Keep reading.

  • pushbutton
  • switch
  • tactile switch
  • toggle switch
  • DIP switch
  • slide switch
  • limit switch
  • rotary switch
  • rotary BCD DIP switch
  • rotary hex DIP switch
  • reed switch
  • relay

Breadboards 101 – What do you need to know?

May 3, 2019 tutorial

Breadboards are incredibly useful for beginners in electronics. They are affordable, versatile, and re-usable. Nevertheless, there are a few key points to keep in mind when using them. In this tutorial we will go through the basic properties of breadboards. Keep reading.

  • tutorial
  • breadboard
  • beginner-friendly
  • power supply
  • jumper wires
  • Dupont wires

Make an LED blink: your first simple PIC microcontroller project!

April 26, 2019 tutorial

In the last two weeks I described how to write your first PIC microcontroller program and how to flash it on to the controller. In this week's post, we will describe the accompanying electronics. Don't worry, it is not very complicated, we will get there! Keep reading.

  • tutorial
  • LED
  • beginner-friendly
  • breadboard
  • schematics
  • troubleshooting
  • microcontroller

Your first microcontroller program!

April 19, 2019 tutorial

So last week I showed you how you can transfer a hex file onto a PIC microcontroller using the PICkit3 and the MPLAB IPE X software. For this week's post I think it will be nice to go through a very simple program that makes an LED blink. Keep reading.

  • tutorial
  • beginner-friendly
  • microcontroller
  • MPLAB X IDE
  • XC8 compiler
  • .hex-file

How to “flash” a PIC microcontroller?

April 12, 2019 tutorial

Many interesting online electronics projects make use of microcontrollers, and for the beginner this tends to be a pretty intimidating word. At least it was for me when I started with hobby electronics many years ago. But there is really no reason you should be afraid of this topic. It is a bit involved, sure, but you will be amazed how fast you can make progress when you shake off that initial fear. Keep reading.

  • tutorial
  • beginner-friendly
  • microcontroller
  • PICkit3
  • MPLAB X IPE
  • .hex-file

LEDs 101 – what do you need to know?

March 29, 2019 tutorial

LEDs, or Light Emitting Diodes, are everywhere. Your smartphone? Check. Your microwave? Check. Your electric toothbrush? Check. In this article I want to present the basic ideas of how LEDs work and how you can use them in simple projects without having to rely on expensive after market solutions (such as wired LEDs with battery drivers that are expensive and often of questionable quality). Here we go! Keep reading.

  • LED basics
  • beginner-friendly
  • led resistor
  • current limiting
  • LM317 constant current source

About FriendlyWire

Beginner-friendly electronics tutorials and projects. Discover the joy of electronics! Keep reading.

Let's build a community

How did you get interested in electronics? What do you want to learn? Connect and share your story!

Tag Cloud

  • tutorial
  • beginner-friendly
  • microcontroller
  • MPLAB X IDE
  • XC8 compiler
  • .hex-file