Electronics Tutorials Archives - The Geek Pub https://www.thegeekpub.com/category/electronics-tutorials/ Arcade Parts Supplier and Manufacturer Wed, 30 Oct 2024 16:04:39 +0000 en-US hourly 1 https://wordpress.org/?v=6.9 https://www.thegeekpub.com/wp-content/uploads/2025/07/cropped-cropped-G-32x32.png Electronics Tutorials Archives - The Geek Pub https://www.thegeekpub.com/category/electronics-tutorials/ 32 32 53265595 Arcade Hard Drives https://www.thegeekpub.com/321626/arcade-hard-drives/ https://www.thegeekpub.com/321626/arcade-hard-drives/#comments Wed, 30 Oct 2024 16:04:39 +0000 https://www.thegeekpub.com/?p=321626 If you have an original arcade machine, it may have a mechanical (sometimes called spinning) hard drive inside it. If

The post Arcade Hard Drives appeared first on The Geek Pub.

]]>
If you have an original arcade machine, it may have a mechanical (sometimes called spinning) hard drive inside it. If it hasn’t happened already, these mechanical arcade hard drives will eventually fail. When this happens you will lose all of your game software and your arcade game will essential become a brick, unable to be used.

The solution is to replace your arcade hard drive with an upgraded solid-state drive. Depending on which arcade game you have, this could be a CF-Card plugged into a CF to IDE adapter, or it could be an SSD drive if your game uses a SATA style mechanical drive.

Upgrading/replacing your mechanical drive will add years of life to your arcade machine, or repair it if it has already failed.

There are two main ways to go about this replacement:

  • Buy an already imaged arcade hard disk replacement from a reputable vendor.
  • If your hard disk is still working and your a bit on the technical side, you can image it yourself and buy the parts on Amazon.

Buying a Replacement Arcade Hard Drive

Cart Furt Replacement Hard drive kit

If you’re not technical, and/or your hard disk has already failed, the best approach is to simply buy a replacement solid-state drive from a reputable vendor. We offer both arcade CF-Card kits and SSD kits.

We take all of the work out of it. We image the replacement arcade hard drives for you at no charge, ready to plug into your vintage arcade machine and bring it back to life. All of our kits are pre-tested before shipping to make sure you’ll have a hassle free installation experience.

We offer imaging for many of your favorite arcades, including San Francisco Rush, CarnEvil, Cart Fury Racing, Hydro Thunder and many more. Just select the game you need and we’ll get the kit to you promptly.

Imaging Your own Arcade Hard Drive

If you’re on the technical side and your existing arcade hard drive has not failed, you can probably image it yourself using some hardware and software tools:

  • An imaging software such as Balena Etcher
  • IDE
    • An IDE to USB adapter to plug your existing hard disk into your PC/Mac
    • A CF-card to IDE adapter for installing into the arcade cabinet
    • A CF-card to USB adapter to image the CF card
  • SATA
    • A SATA to USB adapter to plug your existing hard disk into your PC/Mac

You’ll need to remove the game’s arcade hard drive from its cabinet and plug it into your PC directly or through an adapter.

Open Balena Etcher and choose to make an image of the hard disk and save it to a file on your PC or Mac. Once the image is created, open Etcher again select the file you just created as your source, and the destination as your CF-card and write the image out.

Once the image is written you can plug the CF-card into the CF-card to IDE adapter and plug that kit into your arcade game board or PC. Be sure to plug the 5V power connect to the power connector that the original arcade hard drive was plugged into.

The game should boot up normally! If it doesn’t boot the most common reason is plugging the adapter in backwards (warning, this may damage your adapter and/or your game board!). The second most common reason is failure to plug in the 5V power cable.

The post Arcade Hard Drives appeared first on The Geek Pub.

]]>
https://www.thegeekpub.com/321626/arcade-hard-drives/feed/ 1 321626
The Best Multimeters (Updated for 2022) https://www.thegeekpub.com/16524/the-best-multimeters/ https://www.thegeekpub.com/16524/the-best-multimeters/#comments Sun, 05 Dec 2021 01:46:24 +0000 https://www.thegeekpub.com/?p=16524 In this article we’re going to cover multimeters! We’ll talk about how to use them to measure voltage, current, resistance,

The post The Best Multimeters (Updated for 2022) appeared first on The Geek Pub.

]]>
In this article we’re going to cover multimeters! We’ll talk about how to use them to measure voltage, current, resistance, and continuity.  We’ll go over what to look for in a multimeter, where to buy one, and give you our picks for the best multimeters you can buy.

Deciding Which Multimeter to Buy?

In today’s marketplace, multimeters are literally everywhere. You can get even buy one at the Dollar Store! But as you might have guessed, it will be total junk with terrible specs. Even if you can’t afford to buy one of the best multimeters, you should be able to buy a good multimeter!

Features to Look for in Multimeters

When deciding which multimeter to buy, you’re going want at least these basic features in any multimeter you buy: Voltage, Resistance, Continuity.  We will discuss what each of those do later in the article. I’d personally recommend getting a meter that supports capacitance and temperatures if you can spend a couple of extra dollars. Those features come in pretty handy and the best multimeters will have those features.

Next up, take a look at the accuracy of the meter. Most meters are somewhere around +/- 2%.  I wouldn’t get anything less than that. Again, if you can afford a meter with better accuracy I would do so, but +/- 2% is going to be good enough for most things the home hobbyist will run into.

The next thing to look for is a good display. You’d be surprised how much difference a large, easy to read, high contrast display makes when working on electronics. Many times you’ll be looking at the screen out of the corner of your eye while working on small circuit boards and a small fuzzy screen is going to frustrate you to no end.  Don’t cheap out on the screen!

Lastly, look for automatic ranging. The last thing you want to do is mess around with having to set the range of your meter before every measurement. The good news, I haven’t seen a meter in a while that doesn’t have auto-ranging that fits our previous criteria and features.

The Best Multimeters to Buy for the General Hobbyist

The Best Multimeters - The Greenlee DM-45

To make things simple, we’ve picked a multimeter for you that meets all of our criteria and features. It’s cost effect and will service you well. Of course, cost effective is different for different people.  There are many multimeters available for $10, but they will have terrible accuracy, a fuzzy tiny screen (they are even digital at all), and will cause you all kinds of grief down the road.  To get a decent multimeter you’ll need to spend between $45-$65 dollars. Of course, there are multi-hundred dollar meters for those who have special needs.  Again, we’re looking fo the best multimeter for the hobbyist and average buyer.

Our choice is the Greenlee Autoranging DM-45. It meets all of our requirements at the lowest price of our three recommendations. It will likely last you a lifetime and keep up with anything you throw its way.

Other good choices include the Klein Tools MM600 Autoranging (another staff favorite, we own two), and the Triplett 9007-A Multimeter. They’re both solid meters and meet all of our requirements, albeit at a slightly higher cost point.

Now if you want our pick the for absolute best multimeters? It would be the Fluke 117 True RMS Multimeter. This is our go to multimeter for every project we do at The Geek Pub!

Let’s break down our picks for the best multimeters! Remember, these picks are best for the normal consumer. There are of course multimeters into thousands of dollars that are beyond the scope of this article.

#1 – Greenlee Autoranging DM-45 (Best Price/Performance Ratio)

Buy it on Amazon

As we mentioned earlier, we feel like the Greenlee DM-45 autoranging multimeter is the best bang for the buck. It’s price is right. Its specs are right. In addition to all of those great things, Greenlee is an American company, with American factories and workforce if that matters to you.

#2 – Fluke 117 (Best Specifications)

Buy it on Amazon

As we mentioned earlier, we use the Fluke 117 in almost every electronics project we do at The Geek Pub. It’s True RMS multimeter and the specifications are very tight. This is one of the most accurate meters you can get your hands on without going crazy expensive. Though at around the $200 mark, the Flue 117 is definitely an expensive meter!

#3 – Klein Tools MM600 (Good Price/Performance)

Buy it on Amazon

Most of The Geek Pub staff has an Klein Tools MM600 multimeter somewhere in their electronics tools arsenal. Some keep one in their vehicle for on the road needs (or vehicle breakdowns), while others use it as their primary multimeter. It’s a really good second option to the Greenlee DM-45 and its available at all of the big box stores if you need a multimeter on short notice. It sits at a decent price point and still has a really good set of specifications.

#4 – Triplett 9007-A (Best Price)

Buy it on Amazon

Last on our list of the best multimeters is the Triplett 9007-A digital multimeter. This is the price winner. If your budget is tight and you still need to buy a multimeter that is not going to let you down, then this is the meter for you. It’s not going to win any spec awards, but none of the specs are terrible. It will however win you over with its price tag! It’s the least expensive meter on our list and we’ve seen it on sale as low as $55 around the holidays!

The Basics of Using a Multimeter

So before we go to much further into deciding which multimeter to buy, let’s start our exploration of multimeter basics with measuring voltages.  Next to checking continuity, measuring voltage will be the most common task you do with your multimeter.

Measuring DC Voltage

Before you can measure voltage, you need to make sure your meter is configured properly. Starting with the cables, make sure the black lead is in the jack labeled COM or COMMON.  Next, place the red probe in the jack labeled voltage.  Make certain it is not in the plug labeled AMPS or AMPERES. You run the high risk of damaging your meter, or at the least blowing a fuse in your meter if you use the wrong jack..

Next, set the dial to measure DC voltage. The DC voltage icon is usually a V, followed by a solid line over a dashed line.

The Best Multimeters - picking the right multimeter for your needs.

To get a voltage reading, set touch the black probe to the GND (or -) terminal of a battery. Touch the red probe to the positive (or +) terminal the same battery. You should get a voltage reading of the battery.  If its a 9V battery and fully charged you’ll see approximately 9 volts on the display.

Now, reverse the wires.  Instead touch the black probe against positive terminal and the red probe against the negative terminal.  You should get a negative reading on your multimeter! Reversing the meter probes is safe to do and will never cause damage to your meter or the device you’re checking. In fact, its great way to figure out polarity when you the terminals are not marked on a board!

Measuring AC Voltage

Set the dial to the AC voltage setting. The AC voltage icon on a multimeter is usually represented by a V~.  Just like in measuring DC voltage, connect the red lead to the jack labeled Voltage. Touch the probes to the AC voltage source that you want to measure. You can insert the leads into a common AC all socket in your home. As long as you don’t touch metal parts of the probe or short them out this is perfectly safe to do. In North America you should get a reading of approximately 120 volts.

Measuring Resistance

Most multimeters share the same jack for voltage and resistance. Make sure the red lead in the jack labeled ohms for resistance if your meter has a separate jack, and then set the dial to the resistance setting. The resistance setting will look the like Ohm symbol.

There is no polarity involved in resistance so you can touch either lead to either end of the circuit, component, or resistor you want to measure. The resistance value in ohms will be shown on the screen.

Checking Continuity

Continuity means that there is a good connection between any two points in the circuit. As with voltage and resistance above, most meters use the same voltage/resistance jack for continuity. Place the red lead in the jack for continuity and then select the continuity setting on your multimeter. The continuity symbol will look like a diode symbol.

The best way to test the continuity function is by touching the probes together. This will cause the multimeter to beep, indicating continuity is good. You can use the continuity function to check if for breaks in cables, or breaks in traces on circuit boards. This is a fantastic troubleshooting tool and is probably the most common use of the multimeter by most home hobbyist.

Measuring Current

Most multimeters are going to require you to move your red lead to the AMPS connection for measuring current.  Many multimeters have two. The first jack is for currents up to 10 amps and the second is for currents up to 400 milliamps. You’ll most likely start with 10 amps jack. If you find your measuring something below 400ma and need more accuracy, you can simply move the lead to the other jack.  Some meters also require you to move the setting dial to a mA setting.

Once you’ve set the dial to the amps or milliamps setting its time to measure current! Measuring current is a little trickier than the rest of things. I can’t just touch the probes to a terminal or component and get a reading. The multimeter bust be place in series in the circuit so that the circuit flows through the multimeter. This may mean cutting a wire and splicing the multimeter in-line.

Additional Thoughts on Buying your First Multimeter

So as you work through which multimeter to buy for your needs, I hope this gives you some insight and helps you make the right decision.  Just remember not to cheap out on this purchase.  A $10 meter will not serve you well and you’ll always regret it.  A good multimeter will be something that you’ll keep for a lifetime and I guarantee you’ll find many uses for, whether in your hobbyist projects, or in your day to day life as your fix things around your home or auto!

Be sure to leave a comment below with your tips on multimeters and your favorite meter!

The post The Best Multimeters (Updated for 2022) appeared first on The Geek Pub.

]]>
https://www.thegeekpub.com/16524/the-best-multimeters/feed/ 3 16524
Using a 555 Timer in Monostable Mode https://www.thegeekpub.com/18582/using-a-555-timer-in-monostable-mode/ https://www.thegeekpub.com/18582/using-a-555-timer-in-monostable-mode/#comments Thu, 18 Nov 2021 20:55:49 +0000 https://www.thegeekpub.com/?p=18582 In this tutorial we’re going to learn about using a 555 timer in monostable mode, but first a little history

The post Using a 555 Timer in Monostable Mode appeared first on The Geek Pub.

]]>
In this tutorial we’re going to learn about using a 555 timer in monostable mode, but first a little history is in order! Without a doubt the 555 timer is one of the most common, if not the most common integrated circuits used on electronics over the last 45+ years. First entering production in 1971 it has been used in an enormous amount of DIY projects and even commercial products that include computers such as the Commodore 64 (and many others).

In modern commercial products the 555 timer is mostly obsolete, replaced SoC (or System on a Chip) designs, where the functionality of the 555 timer is simply integrated into other chips. This reduces the number of components on a board and makes the overall product less expensive. However, the 55 timer finds its way into many hobby projects because of its simplicity and affordability. You can buy one-hundred 555 timers eBay or Amazon for about $5.

What is a 555 Timer?

The 555 is called a timer, or “555 timer”. This is because it can pulse electrical currents for an exact amount of time based on the the values of resistors and capacitors connected to the timer.  The timer has three modes of operation:

  • Astable – This the most commonly used mode of the 555 timer. It cycles a repeating pulse of current for a specific amount of time. If you’ve ever seen a product that has some component that operates on a repeating cycle such as a flashing LED, there is a good chance that there is a 555 timer operating in astable mode behind the scenes.
  • Monostable – In this mode, the 555 timer outputs a pulse of current for a specific amount of time and then stops. We’ll use this in our example below to  to turn on an LED for short period of time after a button has been pressed.
  • Bistable – This mode of the 555 timer is different that the other two in that it does not use a capacitor or resistor to set a timing pulse, rather inputs from the trigger and reset pins control its states.

Watch the 555 Timer Monostable Mode Video

Parts List for this Project

Here’s a quick parts list to get you going quickly on building this project:

QTYPART/LINK
1X[icon name=”microchip” prefix=”fas”]555 Timer IC[icon name=”cart-plus” prefix=”fas”]
1X[icon name=”th” prefix=”fas”]Solderless Breadboard[icon name=”cart-plus” prefix=”fas”]
1X[icon name=”grip-lines” prefix=”fas”]Jumper Wire Kit[icon name=”cart-plus” prefix=”fas”]
1X[icon name=”ellipsis-h” prefix=”fas”]Resistor Kit (330/5.1K/10K Ohm)[icon name=”cart-plus” prefix=”fas”]
1X[icon name=”lightbulb” prefix=”fas”]LED Kit[icon name=”cart-plus” prefix=”fas”]
1X[icon name=”circle” prefix=”fas”]Electrolytic Capacitor Kit (470 μF)[icon name=”cart-plus” prefix=”fas”]
[icon name=”circle” prefix=”fas”] Ceramic Capacitor Kit (10 pf)[icon name=”cart-plus” prefix=”fas”]
1X[icon name=”toggle-on” prefix=”fas”]Button Kit[icon name=”cart-plus” prefix=”fas”]
1x[icon name=”battery-full” prefix=”fas”]9V Battery[icon name=”cart-plus” prefix=”fas”]
1x[icon name=”pause-circle” prefix=”fas”]9V Battery Snap for Breadboard[icon name=”cart-plus” prefix=”fas”]

Some of these links may be affiliate links. If you use them, they cost you nothing, but we may get a small commission that helps us keep making great content like this.

555 Timer in Monostable Mode Example

So let’s build an example of using a 555 Timer in monostable mode.  You’ll only need a few components for this and it is very simple to wire up.  In this example we will have a push button activate the timer. The timer will keep the LED on for short period of time (~5 seconds) and then turn it back off.

Wiring the 555 Timer for Monostable Mode

Use the following diagram to wire the 555 timer for monostable mode.   If you don’t have the exact values for the resistor and electrolytic capacitor connected to PIN 1 and PIN 3 of the 555 timer, that’s OK.  You can experiment with different values and it will change how long the LED stays lit after pressing the button.  In fact, if you have a potentiometer, you could use it in place of the resistor to make your timing adjustable!

555 Timer in Monostable Mode Wiring Diagram

555 Timer Monostable Pinout

The following reference should help you understand the wiring concepts of a 555 timer.

  • PIN 1 – Connected to ground (GND / Vcc-)
  • PIN 2 – When voltage drops below 1/3 of Vcc+ the trigger is activated.
  • PIN 3Outputs up to 200 mA of current at ~1.5 volts.
  • PIN 4 – When connected to ground resets the timing operation of the output.
  • PIN 5 – Connected to ground via a 10 pF capacitor to prevent fluctuations in timing of the RC circuit. (Normally, control, but not used in Monostable mode).
  • PIN 6 – Turns off the output when the voltage supplied to it reaches above 2/3 Vcc.  Referred to as the threshold.
  • PIN 7 – When output voltage is low, it discharges the capacitor.
  • PIN 8Vcc+ Vonnected to the + side of the 9V battery (You can actually use any voltage between 4.5V and 15V to power the 555 in case you’re using a benchtop power supply).

While everything is at idle, the voltage at the trigger pin will be HIGH. In this configuration, the discharge pin allows current to flow to ground (GND) and prevents the capacitor from from building a charge.

Pressing the button causes the voltage at the trigger pin to go LOW, causing the output pin to become active.  The discharge pin will stop the flow of current from the capacitor to ground (GND).  This will cause the capacitor to begin accumulating a charge.

When the capacitor reaches levels become two-thirds of the input voltage, the output pin is switched off and the discharge pin returns flow to ground (GND). This effectively resets the entire circuit, now waiting for the next button press. The time it takes to charge the electrolytic capacitor is what determines how long the LED will stay lit.  This is why changing the resistor value or capacitor value will change the circuit timing.

Using a 555 Timer in Monostable Mode: The Results

Once you get everything wired up correctly, your results should look like the following GIF image.  Press the button, and the blue LED will light for approximately 5 seconds and turn off.  You can repeat this cycle over and over!

555 Timer Monostable Mode Animation

RELATED: 555 Timers in Astable Mode – Blink an LED Automatically

That wraps up this tutorial on using a 555 Timer in monostable mode.  If you have any questions or need some help, leave a comment below and our community will do our best to help you out!

The post Using a 555 Timer in Monostable Mode appeared first on The Geek Pub.

]]>
https://www.thegeekpub.com/18582/using-a-555-timer-in-monostable-mode/feed/ 1 18582
Using a 555 Timer in Astable Mode https://www.thegeekpub.com/18632/using-a-555-timer-in-astable-mode/ https://www.thegeekpub.com/18632/using-a-555-timer-in-astable-mode/#comments Wed, 10 Nov 2021 18:51:00 +0000 https://www.thegeekpub.com/?p=18632 In this tutorial we’re going to learn about using a 555 timer in astable mode.  We’ve talked about the longevity

The post Using a 555 Timer in Astable Mode appeared first on The Geek Pub.

]]>
In this tutorial we’re going to learn about using a 555 timer in astable mode.  We’ve talked about the longevity of the venerable 555 timer and how its been around for almost 50 years at the time of this writing. It’s an incredibly versatile little integrated circuit with many fantastic uses. In this tutorial we’ll cover how to use the 555 timer to blink our blue LED. This will likely find its way into our R2-D2 build at some point in the future, so keep an eye out for that too!

Astable mode is by far the most common use a 555 timer and the one most people associate with it.  The bistable and monostable modes should not be discounted, but the astable mode is where the magic is at.

What is a 555 Timer?

The 555 is called a timer, or “555 timer”. This is because it can pulse electrical currents for an exact amount of time based on the the values of resistors and capacitors connected to the timer.  The timer has three modes of operation:

  • Astable – This the most commonly used mode of the 555 timer. It cycles a repeating pulse of current for a specific amount of time. If you’ve ever seen a product that has some component that operates on a repeating cycle such as a flashing LED, there is a good chance that there is a 555 timer operating in astable mode behind the scenes. We’ll go over astable mode in our example below.
  • Monostable – In this mode, the 555 timer outputs a pulse of current for a specific amount of time and then stops.
  • BistableThis mode of the 555 timer is different than the other two in that it does not use a capacitor or resistor to set a timing pulse, rather inputs from the trigger and reset pins control its states.

Watch the 555 Timer (Astable Mode) Video

Parts List for this Project

Here’s a quick parts list to get you going quickly on building this project:

QTYPART/LINK
1X[icon name=”microchip” prefix=”fas”]555 Timer IC[icon name=”cart-plus” prefix=”fas”]
1X[icon name=”th” prefix=”fas”]Solderless Breadboard[icon name=”cart-plus” prefix=”fas”]
1X[icon name=”grip-lines” prefix=”fas”]Jumper Wire Kit[icon name=”cart-plus” prefix=”fas”]
1X[icon name=”ellipsis-h” prefix=”fas”]Resistor Kit (10K Ohm)[icon name=”cart-plus” prefix=”fas”]
1X[icon name=”lightbulb” prefix=”fas”]LED Kit[icon name=”cart-plus” prefix=”fas”]
1X[icon name=”circle” prefix=”fas”]Capacitor Kit[icon name=”cart-plus” prefix=”fas”]
1x[icon name=”battery-full” prefix=”fas”]9V Battery[icon name=”cart-plus” prefix=”fas”]
1x[icon name=”pause-circle” prefix=”fas”]9V Battery Snap for Breadboard[icon name=”cart-plus” prefix=”fas”]

Some of these may be affiliate links. If you use them, it costs you nothing, but we may get a small commission that helps us keep making great content like this.

555 Timer in Astable Mode Example

Let’s go over Astable mode. In Astable the 555 timer uses a resistor and capacitor to create a cycling function. In this mode we can create a circuit with a repeatable action. Astable mode is the most common mode that you’ll find 555 timers used in. The values of the resistor and capacitor will determine the timing of this repeatable circuit. In our case we’re going to cause an LED to flash on a repeating interval using astable mode.

Wiring the 555 Timer for Astable Mode

To wire up the 555 timer for bistable operation, follow this wiring diagram.

555 Timer wiring diagram Astable Mode

555 Timer Astable Pinout

  • PIN 1 – Connected to ground (GND / Vcc-)
  • PIN 2 – The trigger brings the the output HIGH when the voltage supplied to it drops below one-third of Vcc+
  • PIN 3 – Outputs up to 200 mA of current at ~1.5 volts.
  • PIN 4 – Connects to Vcc+. Bringing reset LOW will reset the 555.
  • PIN 6 – The threshold brings the output LOW when its voltage is above two-thirds of Vcc+
  • PIN 7 – When the output voltage is brought LOW, will discharge the capacitor to ground (GND)
  • PIN 8 – Vcc+ Vonnected to the + side of the 9V battery (You can actually use any voltage between 4.5V and 15V to power the 555 in case you’re using a benchtop power supply).

Understanding Astable Mode on the 555 Timer

In astable mode, the output PIN cycles form HIGH to LOW continuously. As you can see in the wiring diagram, both the threshold pin and the trigger pin are connected to the 100uF capacitor. Therefore the the voltage levels will be identical on the trigger pin, threshold pin, and the 100uF capacitor.

When the circuit first receives power, the voltage is LOW at the capacitor, the threshold pin, and the trigger pin. Remember, if the trigger pin voltage is LOW, the output is HIGH. With the discharge pin its off state, current is able to flow through the 5.1K ohm resistors which in turn charges our 100uF electrolytic capacitor.

When the capacitor’s charge reaches two thirds of Vcc+, the output pin is deactivated. When the output pin is LOW, the discharge pin switches on causing the capacitor to drain to ground. Once the capacitor voltage  drops to one-third of Vcc+, the trigger pin disables the discharge pin and the capacitor starts charging again.

The cycle repeats endlessly.

The 555 Timer Astable Mode in Action

Here’s a quick GIF of using a 555 timer in astable mode.  It’s a great circuit that can be used in lots of projects.

The two 5.1K resistors and the 100uF capacitor can be changed to different values to speed up or slow down the rate at which the blue LED will blink.  Additionally, you could use a potentiometer between pins 6 and 7 to make the circuit variable. Turning the knob on the potentiometer would control the blink rate of the blue LED.

555 Timer Animated (astable)

RELATED: 555 Timer in Monostable Mode

We hope this tutorial has been easy to understand. If you have any questions or trouble making it work, give us a shout in the comments below and we’ll try to help!

The post Using a 555 Timer in Astable Mode appeared first on The Geek Pub.

]]>
https://www.thegeekpub.com/18632/using-a-555-timer-in-astable-mode/feed/ 2 18632
WLED: How to setup and configure WLED https://www.thegeekpub.com/274631/wled-how-to-setup-and-configure-wled/ https://www.thegeekpub.com/274631/wled-how-to-setup-and-configure-wled/#comments Mon, 16 Aug 2021 22:04:12 +0000 https://www.thegeekpub.com/?p=274631 WLED is an awesome open source application created to control addressable LEDs (WS2811, WS2812b, WS2813, etc) from your iOS or

The post WLED: How to setup and configure WLED appeared first on The Geek Pub.

]]>
WLED is an awesome open source application created to control addressable LEDs (WS2811, WS2812b, WS2813, etc) from your iOS or Android smartphone, or literally any device which can send a command via http/https over a network! It runs on the ESP32 platform of microcontrollers, which although similar to the Arduino is different but mostly compatible if you understand those differences.

Installing and Configuring WLED

Before you get started installing and configuring WLED, you’re going to need a ESP32 based microcontroller to install it on, along with some addressable LEDs.  You’ll also need to obtain the iOS or Android app if you want to control the LEDs from your phone.

Parts List for this Project

If you don’t already have everything you need for this project, here’s a handy parts list for getting started:

QTYPART / LINK
1X[icon name=”microchip” prefix=”fas”]ESP8266 microcontrollers (no Bluetooth, but cheaper) [icon name=”cart-plus” prefix=”fas”]
1X [icon name=”microchip” prefix=”fas”] ESP32 microcontroller (adds Bluetooth and doubles GPIO, more expensive) [icon name=”cart-plus” prefix=”fas”]
1X[icon name=”usb” prefix=”fab”] Micro-USB cable (for programming) [icon name=”cart-plus” prefix=”fas”]
1X[icon name=”plug” prefix=”fas”] Micro-USB power supply (for stand alone operation) [icon name=”cart-plus” prefix=”fas”]
1X[icon name=”lightbulb” prefix=”fas”] WS2812b Addressable LED Strips 3.3V-5V [icon name=”cart-plus” prefix=”fas”]

Some of these links are affiliates. If you use them it costs you nothing, but we get a small commissions and that helps us keep making content for you!

Downloads for this Project

In addition, you’ll need a few pieces of software for this project.

What is an ESP32 Microcontroller?

Put simply, think of the ESP32 as an Arduino that has additional GPIO pins along with Bluetooth & Wi-Fi integrated onto the board. It’s a little more complicated than that, but that’s the simple way to look at it.  In fact, you can even use the Arduino IDE to program for the ESP32 with an add-on called ESP32-Arduino Core. But that’s outside the scope of this article.

Getting Started with WLED

After getting your ESP32 out of its box (or bag), its time to get WLED up and running on it. Let’s walk through all of the necessary steps!

Installing the USB UART Serial Drivers

If you’ve never connected a device like this to your PC or Mac before it is very possible you won’t have the USB UART serial drivers installed. There two common driver for almost all microcontrollers.  The very common CP2102 and the less common CH340G.  You can find those drivers at these links:

If you used our links above to acquire your ESP32, then you will need the CP2102 drivers.

Connecting the ESP32 to your PC or Mac

Now that you have the drivers installed, you’ll need to connect your ESP microcontroller to a PC or Mac via USB. This requires a Micro-USB cable for most controllers.  Connect one end to the ESP32 and the other end to your PC or Mac.

WLED connecting USB

Installing WLED on your ESP32 Microcontroller

On the same PC or Mac you connected your ESP32 to, it is time use the WLED download tool to install WLED onto the ESP32.  In your browser (preferably Chrome), go to http://install.wled.me.

Installing WLED

Next up click the install button.  You’ll be asked which serial port you want to connect to. You’ll want to connect to one that has a name that represents your ESP32.  It should say something along the lines of CP2102 or CH340G UART Bridge. Click that serial device/port and then click connect.

WLED will then say its initializing for a second and then begin the process of writing the image to the ESP32.

WLED installation progress

Once the installation has completed, you can leave the ESP32 connected to serial, or disconnect it and plug it into a dedicated power supply.  Either way it is recommended to reboot the ESP32 microcontroller by unplugging it and plugging it back in.

Connected to the WLED Wi-Fi Controller

With WLED now installed, we need to get it connected to our own Wi-Fi network.  To do this we must first connect to its private network and reconfigure it.  On your iOS or Android device, open your Wi-Fi settings and look for a network called WLED-AP.  WLED is operating as its own access point until we configure it.  Tap the network and connect to it.  The default password is wled1234.

Connect to WLED-AP

Once connected, wait just a second and a welcome screen will automatically pop-up. From here you will want to click on WIFI SETTINGS.

WLED Welcome Screen

You’ll land on the Wi-Fi configuration screen for WLED.  From here most people will only want to make changes to the SSID and to the Network Password. A word of caution here. Both of these are case sensitive. If you have any capital letters in your Wi-Fi’s SSID, you’ll need to enter them capitalized here. This is a ridiculous bug that many users run into. In our case MurrayNET has four capital letters and refused to connect until I made them capital on this screen.

WLED Wifi Settings

Once you enter your configuration click Save & Connect and your ESP32 will reboot and connect to your Wi-Fi network rather than running its own access point.

WLED Configuration Successful

Installing the WLED App

If you haven’t already, install the WLED iOS or Android application onto your smartphone.  The links are listed above in the software download section, or you can just search for WLED in the App or Play store. Click the download button.  Once the installation is completed, open WLED on your smartphone.

WLED iOS App Download

Open WLED on your iOS or Android device.  You’ll be presented with an welcome screen.  Press the + button to add your controller.

iOS Welcome Screen

On the add device page, you’ll be prompted to enter the IP address of your ESP32 microcontroller running WLED – or – you can click the Discover Lights button. For some reason, discover lights only works for us about 1 out 20 tries. I am not sure why this is the case.  If auto-discovery doesn’t work for you, you can just enter the IP address (usually found on your router or firewall’s status or DHCP lease page).

WLED Add or Discover Device

Once your controller is found, you’ll be presented with the device selection screen. This is a really handy screen once you start using WLED more. You might have a controller in your bedroom, one in your kitchen, one on your patio, etc.  This give you once place to control them all.  Since you will only have one WLED controller go ahead and tap it to open the controller screen.

WLED Device List screen

On this screen, you can configure your LED strips, change their colors, run neat animations and all kinds of other fun things.

WLED strip control

But wait! We have a problem.  We haven’t connected any WS2811, WS2812b, or WS2813 LED strips to our controller yet!  Let’s do that!

Connecting WS28xx LED Strips to WLED

To get meaningful use out of our ESP32 microcontroller running WLED, we need something for it to control  For demonstration purposes, I am just going to plug in a short section of WS2812b LEDs from a strip I had laying around.

Disconnect the ESP32 microcontroller from power and make the connection as follows:

  • LED Strip Gnd (-) to Gnd on the ESP32
  • LED Strip Vin (+) to 3.3v on the ESP32
  • LED Strip Din to Pin D4 on the ESP32

Pro Tip: It should be noted that most all ESP32 microcontrollers only have a 3.3v output.  This may not be enough for some LED strips. If yours needs 5V or 12V inputs, you may need to use a separate power supply. If you use a separate power supply, be sure to connect the ground (Gnd) to both the ESP32 and the power supply, but only connect the +5V or +12V cable to the LED strip.  Only connect the Din to the ESP32 and not to the power supply.

It is possible that a 5V LED strip will work with only 3.3V, albeit its maximum brightness will be reduced.

Wiring connections

With the LEDs connected, plug the ESP32 back into USB power.  Back inside the iOS or Android app, tap the segments tab across the bottom of the screen, and configure your LEDs according to what you have connected. In my case, start LED is 0 and stop LED is 9, since I have a strip of LEDs that are 10 pixels long.  Click the check box when done.

Setting up the LED Strip

Go back to the colors tab and select a color, or go to the effects tab and select an effect.

WLED strip control

In my case, I chose the effect called Colorful, and it was beautiful! That’s all there is to it!  You now have a fully function WLED setup!

Additional Ways to Control WLED

In addition to controlling your LEDs via the smartphone app, you can also control WLED from a webpage just by going to its IP address in your web browser.  But that’s not all.  WLED has a complete API you can use to control LEDs from other applications, scripts, etc. This makes it very powerful. For example, any home automation system that can send an HTTP request can control WLED!

It’s also possible to leave WLED running as its own access point (remember the WLED-AP) and never connect it to your own Wi-Fi network.  This is handy for locations that you don’t have access to the Wi-Fi network’s credentials, but still want to use WLED. In these cases you’d just click the second button GO TO THE CONTROLS rather than WI-FI SETTINGS.

We hope you enjoyed this tutorial. Let us know if you have any questions in the comments.  We love helping!

The post WLED: How to setup and configure WLED appeared first on The Geek Pub.

]]>
https://www.thegeekpub.com/274631/wled-how-to-setup-and-configure-wled/feed/ 1 274631
Types of Grounds: Earth Ground, Chassis Ground, Signal Ground https://www.thegeekpub.com/274501/types-of-grounds-earth-ground-chassis-ground-signal-ground/ https://www.thegeekpub.com/274501/types-of-grounds-earth-ground-chassis-ground-signal-ground/#respond Thu, 12 Aug 2021 22:00:55 +0000 https://www.thegeekpub.com/?p=274501 There are several types of grounds used in electronics projects. And sometimes these types of grounds and the words used

The post Types of Grounds: Earth Ground, Chassis Ground, Signal Ground appeared first on The Geek Pub.

]]>
There are several types of grounds used in electronics projects. And sometimes these types of grounds and the words used to describe them (earth, ground, etc.) are thrown around interchangeably.  But these different types of grounds are very different and it is good idea to know difference between them when building your projects.

In most common circles of electrical engineering, ground (or earth) is the reference point in an electrical circuit from which voltages are measured. In most projects that’s going to mean zero volts at ground.  But don’t be surprised when you learn that this is not always true, or even possible!  Many engineers prefer to thing of ground as a common return path for electrical current. In other areas of practice ground literally means a direct physical connection the Earth below our feet.

Types of Grounds Explained

Let’s go through the types of grounds and learn more about them.  The three most common you will find are Earth Ground, Chassis Ground, and Signal Ground.  But we will also talk about a few others.

Earth Ground

This is the most common type of ground that ordinary people think of outside the electronics or automotive worlds.  Earth ground means exactly what it sounds like.  We’re connecting our system to the planet below us (aka. Earth). Most all structures, buildings, and homes have an earth ground. In fact, the ground pin on your electrical plugs and outlets eventually lead to this ground.  A large metal rod or pipe is generally driven into the ground near the electrical panel on the outside of the structure and then connected to the ground bus on the same panel.

In addition to electrical systems, most radio towers and tall structures have a lighting rod which is also connected to earth ground and must be capable of carrying significant voltage and amperage loads to the ground and away from the sensitive electronic systems on the tower.  Some of these systems even resort to the burring of large copper plates under the structure to distribute the lightning strike more effectively.

Chassis Ground

Connecting to earth ground is not always practical, or even possible. In applications such as automobiles, portable computers, and electronic devices there is no practical method of keeping the device connected to earth ground. I mean you don’t want to drag 200 mile long cord behind our car after all! In these applications In these applications, a ground plane is usually selected to be the common reference point for 0 volts.  In cars, this usually the frame or largest metal structure of the vehicle in the case of a unibody. In electronic devices such as laptop computers, a rail on the mainboard usually becomes the ground location.

Signal Ground

In other applications, you may have many different voltages in a single application. An example of this is in a audio amplifier where there may be many different circuit boards, some may be running at 12v and 1 amp, while another board may have very high current at 5v for driving a speaker.  Signal ground provides a way to ground these systems independently but allow them to still work together. This also prevents serious interference and buzzing sounds in the types of applications.

Floating Ground

In some systems, there is a power supply transformer in place. By its nature this transformer will isolate the ground of the electronics circuit from the mains circuit. Simply put, the power supply will have an earth ground, while the circuit on other side will have a chassis ground. This is very common electronic devices that plug in to charge, and then run off of battery when unplugged.

Virtual Ground

A virtual ground is when a node of a circuit is maintained at a steady reference potential, without actually being connected directly to the reference potential. This a very commonly found in operational amplifiers (Op Amps). Although a virtual ground always has a steady reference, it cannot and should never be used as an actual ground.

Types of Grounds

More About Different Types of Grounds

Now that you know about the different types of grounds, let’s talk about some other grounding fundamentals you might need to know as you do your electronics projects!

Ground Loops

Have you ever been in a large auditorium and someone plugs in a microphone and all you hear is a hum.  A hum that sounds like it cycles at 50hz or 60hz? You probably were experiencing that hum from a ground loop!

A ground loop happens when two different electronic systems that have their own mains voltage and grounds are connected together over a section of wire. In these cases the reference point of 0 volts is not the same in both systems! They have different potentials, and therefore form a potential over the loop. This is the very reason that ground loop isolators exist!

Chassis Ground Isn’t Always Perfect

You may be inclined to think that with something like a chassis ground on your vehicle that your good to go and will never have an issue. Well, remember earlier when we said that it’s not always true? Some types of grounds are more likely to experience potential issues than others. Pun intended.

On large vehicles, such as cruise ships or airplanes, it is quite common to find that the potential varies slightly from deck to deck.  As an airplane flies through the atmosphere it is not uncommon for the Earth’s magnetic field at 480+ mph for a small electric current to be introduced to the airframe! It will also be likely to vary depending on windspeed, altitude, and other variables that act on the plane.

Also remember, that a transformer is nothing but a winding of wires at the end of the day.  Parallel traces on circuit boards, or excess looped wiring in your projects can become transformers under the right circumstances, creating a potential where none should exist!

The post Types of Grounds: Earth Ground, Chassis Ground, Signal Ground appeared first on The Geek Pub.

]]>
https://www.thegeekpub.com/274501/types-of-grounds-earth-ground-chassis-ground-signal-ground/feed/ 0 274501
How Stepper Motors Work https://www.thegeekpub.com/269888/how-stepper-motors-work/ https://www.thegeekpub.com/269888/how-stepper-motors-work/#comments Sun, 14 Feb 2021 18:54:21 +0000 https://www.thegeekpub.com/?p=269888 Stepper motors are used in so many things you buy today and most people don’t even know it! They truly

The post How Stepper Motors Work appeared first on The Geek Pub.

]]>
Stepper motors are used in so many things you buy today and most people don’t even know it! They truly are amazing little pieces of electronics and mechanics combined into one.  Even the vibrator built into your phone is likely based on stepper motor technology! In this tutorial we’re going to cover the basics of how stepper motors work. We think you’ll find it super interesting.

How Stepper Motors Work

how stepper motors work - cross sectionLet’s start with the very basics of how a stepper motor actually works. The fundamental basics behind them are all about magnets! Who doesn’t love magnets?

Looking at the picture on the right you’ll see our cross section of a stepper motor. In the center is a round shaft connected to a permanent magnet, seen here as N/S (north and south poles). We call this the rotor. It’s the part that spins when the stepper motor is in action.

Surrounding the rotor is a set of windings containing coils. These coils of the stator become magnetized or demagnetized when we add to or remove current from them. The stator here is represented as A+, B+, A-, and B-.

The magnetic fields created around the stator interact with the North and South poles of the rotor’s permanent magnet. As you can see in the diagram below, these interactions cause the rotor to turn and align to the section of the stator it is attracted to.  In a nutshell, that’s how stepper motors work. But let’s dive deeper!

how stepper motors work rotation

Types of Stepper Motor Designs

how stepper motors work types of stepper motorsThere are three basic types of stepper motor designs in use today, although there are some very complex variants of these three.  We refer to these three types as: permanent magnet, variable reluctance, and hybrid synchronous designs.

Permanent Magnet Stepper Motors

A permanent magnet stepper motors work pretty much how they sound. They have a permanent magnet rotor in the center that is driven by the electromagnets of the stator windings. The stator delivers a polarity that is opposite of one of the rotor’s poles and therefore attracts that pole and it rotates towards it.  Permanent magnet stepper motors work well in low speed applications where relatively high torque is required.

Variable Reluctance Stepper Motors

A variable reluctant stepper motor works unlike the other types, and rather uses a non-magnetized rotor. This type of stepper motor is the simplest design. The rotor is generally made from iron and has teeth that are offset from the stator. When the windings are magnetized the rotor will align itself where there is a minimum gap between itself and the stator. Variable reluctance stepper motors often used for high speed applications, where accuracy is not as important. This design is also considered to be the noisiest type of stepper motor.

Hybrid Synchronous Stepper Motors

Hybrid synchronous stepper motors work exactly as you’d suspect. They are a hybrid design that includes concepts from both permanent magnet design and variable reluctance design!  In this design, the stepper motor has two cups on the rotor. Each cup is lined with many permanent magnet “teeth”. The stator itself is also toothed.  This gives hybrid designs a best of both worlds performance. It has high torque, can operate at higher speeds, and is very accurate.  In addition, the toothed design gives the hybrid synchronous stepper a high resolution with models having 500 or more steps per revolution!

Now let’s learn about how motors are actually driven.

Types of Stepper Motor Driving Modes

As we continue to learn how stepper motors work, let’s dive into the four different drive modes:  wave drive, full step, half step, and microstepping. Since the entire principle of stepper motors is based on the energizing and de-energizing of electromagnets, a circuit must know how to pulse or hold these magnets in order for the stator to cause the rotor to move in the right direction, and to the right position.

Wave Drive/Single-Coil Excitation Drive Mode

The first type of drive mode is called Wave Drive (or sometimes engineers like to say “single coil excitation”). In this drive mode only a single coil on the stator is ever active at once. In our example below, there are four coils.  With wave drive this results in four total positions.

how stepper motors work wave drive single coil excitation

Full Step Drive Mode

Full step drive is similar to wave drive, except that at any time two coils are magnetized. This type of drive is common when more torque is needed for the same number of positions. It’s the same basic operating principle behind wave drive, but with roughly double the torque and double the power requirements.

how stepper motors work full step drive

Half Step Drive Mode

With half step drive, it takes wave and full step and combines them together! Step one activates a single coils, step 2 is half step and actives two coils. Step 3 would then active only the third coil.  We lose the increased torque of full step on half of the positions, but we double the number of positions! In this case, we have four coils on the stator, but 8 total positions.

how stepper motors work half step drive

Microstepping Drive Mode

Microstepping is the most complicated form of stepper motor drive and is what most modern devices use (of course!). Microstepping uses pulse width modulation (PWM) to provide a variable current with microstepping a four coil stepper motor could have 20 positions! We have a tutorial on it if you’re interested in learning more about PWM.

Let us know in the comments if you have any questions or how we can improve this tutorial!

The post How Stepper Motors Work appeared first on The Geek Pub.

]]>
https://www.thegeekpub.com/269888/how-stepper-motors-work/feed/ 2 269888
Debouncing a Switch in Hardware or Software https://www.thegeekpub.com/246471/debouncing-a-switch-in-hardware-or-software/ https://www.thegeekpub.com/246471/debouncing-a-switch-in-hardware-or-software/#comments Wed, 11 Sep 2019 20:06:21 +0000 https://www.thegeekpub.com/?p=246471 When you flip a switch or press a button two metal contacts come together. It might seem like they make

The post Debouncing a Switch in Hardware or Software appeared first on The Geek Pub.

]]>
When you flip a switch or press a button two metal contacts come together. It might seem like they make immediate contact and complete a circuit.  However, in reality as they make contact they mechanically bounce, making brief contact several times before making a solid connection. In some cases this bounce can also be electrical in nature if arcing occurs due to bad or corroded contacts on the switch.  This bounce can cause problems with some circuits, which will result in the hardware incorrectly reading multiple switch presses, when in fact only one occurred.  We deal with this by debouncing the circuit!

Debouncing can be accomplished in hardware or in software and there are pros and cons to each method.  We’re going to walk through both ways of doing it and talk about the differences.

Switch Bounce Characteristics

We need to first understand switch bounce and its characteristics. And this isn’t as simple of a task as it might at first seem! That’s because different switches have different bounce characteristics. Even two identical switches can bounce differently!

Many also think that bounce is only a problem with momentary switches, but the truth is that bounce affects all types of momentary and maintained switches, including toggles, latching, and rocker switches.

If we pop out the trusty oscilloscope we can actually watch bounce happening on the screen!

switch bounce oscilloscope

In this case, I was using a simple momentary switch from my Arduino Starter Kit. You can see the switch bounced twice before holding steady contact.  Many circuits could interpret this as multiple presses, even though you only physically pressed the switch once.  Not good!

In this second example I used one of the momentary switches I bought for the remove LCD panel buttons on the tabletop arcade build.  This switch bounces all over the place before holding steady!

switch bounce on oscilloscope

So you can see why debouncing a switch can be so important!

A lot of beginners to electronics usually start searching the web for a problem with their circuits not realizing that switch bounce is even the problem that they are having, because they didn’t even know it could be a problem.  Hint: It’s quite common!

Here’s the circuit schematic for our bouncing switches, with no debouncing hardware in place:

switch bounce schematic

Debouncing in Hardware

The most common way to debounce a switch is to do it in hardware.  This involves adding a capacitor to the circuit to even out the bounce into a more gradual curve.

Depending on the circuit, its operating voltage, current, etc. you may need a larger or smaller capacitor, and you might need to experiment a little to find what works best.  In our case, we’re just using a 9V battery with a 10K Ohm current limiting resistor.  We should be able to easily get by with a .1 µF capacitor. I’ll use a ceramic capacitor since that’s what I have handy in that value, but just about any type will work fine.

Our new schematic with debouncing capacitor added will look like this:

debouncing capacitor

When we try this out on the oscilloscope, things look mighty different!

debouncing capacitor on the oscilloscope

Rather than a bunch of bounces, we can see a rather smooth curve!  Exactly what we’d expect! The capacitor stores and charge, and releases it with each bounce smoothing out the connection process (at least from the perspective of any connected devices, ICs, or micro-controllers).

RELATED: How Capacitors Work

Debouncing a switch with hardware comes at a price though. Literally! For our little one off project, its only the cost of a single capacitor. But for a large project producing millions of boards, this would mean millions of capacitors and that cost adds up quickly!  Also, a capacitor takes up space, something that is also a concern when making smaller devices.

Debouncing in Software

Another way to debounce a switch is to do it in software. If you’re connecting the switch to an intelligent device such as a micro-controller or single board computer (i.e. Arduino or Raspberry Pi) then you have the option to debounce in software and save the cost of the extra capacitor.

The simplest way to debounce a switch in software is to simply tell the micro-controller to wait 50ms after it detects the first pulse before checking again. This would look something like this:

reading = digitalRead(12);
delay(50);
reading = digitalRead(12);
delay(50);

This works pretty reliably, but its not without its drawbacks. A lot can happen in your project when the Arduino is stuck waiting for 50ms, and you might miss some other input.  If there are a lot of button presses, that 50ms could add up making your project slow and laggy.  If none of that is important to you, or your project, then just wait 50ms before reading the button a second time.

The better way to debounce in software is a little more complicated and looks like this:

//initialize and declare variables
const int ledPin = 13; //led attached to this pin
const int buttonPin = 2; //push button attached to this pin

int buttonState = LOW; //this variable tracks the button state, low if not pressed, high if pressed
int ledState = -1; //this variable tracks the state of the LED, negative if off, positive if on

long lastDebounceTime = 0; // the last time the output pin was toggled
long debounceDelay = 50; // the debounce time; increase if the output flickers

void setup() {
  //set the mode of the pins...
  pinMode(ledPin, OUTPUT);
  pinMode(buttonPin, INPUT);
}

void loop() {
  //sample the state of the button - is it pressed or not?
  buttonState = digitalRead(buttonPin);

  //filter out any noise by setting a time buffer
  if ((millis() - lastDebounceTime) > debounceDelay) {

  //if the button has been pressed, lets toggle the LED from "off to on" or "on to off"
    if ( (buttonState == HIGH) & (ledState < 0) ) {

  digitalWrite(ledPin, HIGH); //turn LED on
  ledState = -ledState; //now the LED is on, we need to change the state
  lastDebounceTime = millis(); //set the current time
  }
    else if ( (buttonState == HIGH) & (ledState > 0) ) {

    digitalWrite(ledPin, LOW); //turn LED off
    ledState = -ledState; //now the LED is off, we need to change the state
    lastDebounceTime = millis(); //set the current time
    }
  }  
}

The basic premise of this code is that we are tracking the state of a button in a variable.  We check how long it has been since the button was last pressed.  If it was less than 50ms, we ignore the “press” as it would be an erroneous bounce.

Here’s a Fritzing diagram if you want to build this circuit and try the Arduino software debounce code:

Debouncing a Switch Software Wiring Diagram

Well that wraps our debouncing tutorial. If you have any questions, leave a comment below and we will try to help you out!

Next Steps

Now let’s move on or go back to the index!

The post Debouncing a Switch in Hardware or Software appeared first on The Geek Pub.

]]>
https://www.thegeekpub.com/246471/debouncing-a-switch-in-hardware-or-software/feed/ 8 246471
Types of Switches – Electronics Basics https://www.thegeekpub.com/245859/types-of-switches-electronics-basics/ https://www.thegeekpub.com/245859/types-of-switches-electronics-basics/#comments Fri, 06 Sep 2019 23:12:40 +0000 https://www.thegeekpub.com/?p=245859 Switches are literally everywhere! They are in many of the devices we use on a daily basis and a most

The post Types of Switches – Electronics Basics appeared first on The Geek Pub.

]]>
Switches are literally everywhere! They are in many of the devices we use on a daily basis and a most basic part of just about every electronics project! So in this electronics basics tutorial we’re going to cover the different types of switches and what the applications that they are used for.

At its most basic, a switch turns something on or off.  There’s a light switch for example in almost every room in your home. There is a switch to turn on or off your TV. There is even a switch to turn on and off your car or motorcycle!  But switches are even more fundamental that turning your device on or off. What they actually do is close (allowing current to flow) or open a circuit (stopping the flow of current).  This has many applications beyond the basic on/off function!

The buttons on your TV remote control that change the volume, channel, and inputs don’t turn on or off the remote or TV, but they do start or stop the flow of current, which tells the remote to do something by signalling an integrated circuit to transmit an IR code. In fact, we have a tutorial on building infrared circuits and a TV B-Gone remote!

Different Types of Switches

Different types of switches have different categories. There are two main categories of switches you’ll run into.  They are mechanical switches and electrical switches.  Mechanical switches require physical operation by a human, animal, or even a mechanical device.  Electrical switches are switches that are controlled as part of a circuit, such as a relay or transistor.  Electrical switches may or may not be solid state (i.e. semiconductor based).

Types of Mechanical Switches

Let’s cover the basic types of mechanical switches. While there are hundreds of types of mechanical switches in operation and production throughout the world, for brevity we’re going to focus in on the main types you are likely to encounter.

Poles vs Throws

Mechanical switches are usually described by a combination of two of their main characteristics: poles and throws.

  • Poles: A pole refers to the number of circuits a switch can operate. A single-pole switch can only control a single circuit, while a double-pole switch can control two circuits. The limit to the number of poles is basically unlimited based on the construction methods of the switch. If you break it down to their very basics, a double-pole switch is nothing more than two separate single pole switches that are mechanically tied together.
  • Throws: A throw refers to the number of output connections a switch can connect its input to. A simple single-throw switch is simply an on/off switch. When the switch is off current cannot flow. A double-throw switch connects the input to one of two output terminals. This might be used to switch between a red and green light for example. One or the other receives current, but not both at the same time.

Due to this, you’ll commonly see switches called by the number of poles and throws.  Here are some common examples:

  • SP-ST: Single-pole, single-throw
  • DP-ST: Double-pole, single-throw
  • DP-DT: Double-pole, double-throw

This illustration shows the difference between single-throw and double-throw (both single pole):

Examples of Switch Throws, SPST vs SPDT

This illustration shows the difference between single-pole and double-pole (both single throw):

Example of switch poles - SPST vs DPST

Pole and Throw Common Examples

Let’s take a look at some very common examples of these combinations of poles and throws as they apply to different types of switches. The most common are single and double. However, there are switches with many more poles and/or many more throws.

A single-pole single-throw (SPST) is the most common type of switch you will encounter. It simply controls current flow of a single input. On or off. Nothing more.

A double-pole single-throw (DPST) type of switch is much like an SPST switch, but it controls two inputs separately. This is very handy when you have two separate devices that need to be controlled by a single switch. In an arcade cabinet you might need to turn off the 5 volt powered Raspberry Pi and a 120 volt marquee backlight.  A DPST switch allows you to control two devices with different voltages and current specifications.

A single-pole double-throw (SPDT) switch only controls a single input, but switches it between two outputs. This might allow you to switch between a red LED and and a green LED by flipping a switch. Neither receive power at the same time.  A SPDT switch can replace a SPST switch by only connecting one of the two outputs.

There are of course many more combinations of the poles and throws.  Here’s a handy illustration of some of the most common types:

SPST vs SPDT vs DPDT vs TPST vs TPDT switches

Momentary vs. Latching Switches

As we continue to explore the different types of switches, another important distinction in switches you’ll encounter is the bias. Some switches maintain the state you set them in, until you physically change the state, this is called a latching switch (sometimes referred to as a maintained switch). A momentary switch on the other hand will only maintain its state while you are pressing it and return to its normal state when you release it.  Momentary switches are generally activated by pressure (i.e. pushing the button on your arcade game), however, they could be activated by other means such as temperature, or light.

Types of Electrical Switches

Now let’s go over the types of electrical switches. As we mentioned earlier, electrical switches are controlled by an electric change.  They can be either electro-mechanical in design, or semiconductor based.

Relays

Relays are electro-mechanical types of switches. They usually consist of a coil that generates a magnetic charge when current travels through it.  This magnetic charge either attracts or repels  fixed type magnet that is connected to a mechanical switch.  Relays are perfect for allowing low voltage devices to control high voltage circuits. For example, a 5 volt GPIO pin from an Arduino or Raspberry Pi can control a 120 volt lamp using a relay.

Of course, depending on the type of relay, it could be any combination of high-low/voltage-current! It could be 240 volts AC activating an LED!

RELATED: Arduino Relay Tutorial

relays are switches!

Bi-polar Transistors

transistors as switchesSome people spend years tinkering with electronics before it dawns on them that a transistor is (or can be) an electrical switch! Transistors have three leads that are known as the base, collector, and emitter. We’ll skip the complexity of transistors for the purposes of this tutorial, but suffice it to say that the saturation level of the transistor is reached, it will act as a simple electrical switch.

Other Electrical Switches

Of course there many other types of electrical components that can be an electrical switch.  Such as thyristors, silicon controlled rectifiers, and MOSFETs.  Even a diode is a type of electrical switch when you think about it. When it is restricting current in its reverse direction it is acting as a switch!

If you have any questions, leave a comment below and we’ll do our best to help you out!

 

 

 

The post Types of Switches – Electronics Basics appeared first on The Geek Pub.

]]>
https://www.thegeekpub.com/245859/types-of-switches-electronics-basics/feed/ 7 245859
Types of Batteries – Electronics Basics https://www.thegeekpub.com/245576/types-of-batteries-electronics-basics/ https://www.thegeekpub.com/245576/types-of-batteries-electronics-basics/#comments Tue, 03 Sep 2019 22:10:05 +0000 https://www.thegeekpub.com/?p=245576 Batteries are everywhere in our lives. Not only in the products we buy, but in our electronics projects! It’s not

The post Types of Batteries – Electronics Basics appeared first on The Geek Pub.

]]>
Batteries are everywhere in our lives. Not only in the products we buy, but in our electronics projects! It’s not always clear when we should use which time, or what even makes one type of battery different from another.  In this tutorial we’re going to cover the different types of batteries and talk about some of the applications we might choose them for.

Batteries serve really one main purpose: They store potential energy for use at a later time. The process is usually chemical in nature but not always. If you wind up a rubber band it too will store potential energy.  Some data centers and large industrial plants have begun relying on super large flywheels for storing potential energy!

It’s important to understand that batteries only store DC or direct current energy. They cannot store AC or alternating current.  Devices such as a UPS (uninterruptible power supplies) contain complex transformers and switching circuits to convert DC stored in batteries to AC.

Battery Construction

Batteries have three basic components in the their construction: Anodes, cathodes, and electrolytes. Let’s briefly discuss what these components are and their general functions.

The anode of a battery (commonly referred to as the negative electrode) is the the portion of the battery that stores up electrons. We discussed this concept in our tutorial on capacitors.

The cathode of a battery (commonly referred to as the positive electrode) reacts with the anode to create a potential difference in energy. These two forces naturally want to equalize.  However, the electrolyte resides between the anode and the cathode and prevents this from happening.

When the battery is connected to a circuit, it provides a path (generally through your project!) for the electrons to flow from the anode back to the cathode!

Battery Charging Discharging

RELATED: How Capacitors Work

Two Major Types of Batteries

There are many types of batteries and battery construction.  All of these batteries can be grouped into two major categories: Primary and Secondary. So let’s start with those!

Primary Batteries – One Time Use

Primary batteries are considered one time use batteries. These batteries are not rechargeable! Their construction uses materials that do allow for reversing their electrochemical reactions. Primary batteries were at one time the most common type of battery before technology reached a tipping point for rechargeable battery technology.

Primary batteries still have many applications today. There are times where a device will never need to be recharged and will be disposed (maybe even before the battery is fully discharged).  You might find a primary battery in a missile or bomb used in military applications.  No need to recharge something that will be destroyed!

Alkaline battery construction

Secondary Batteries – Rechargeable

Secondary batteries are considered rechargeable batteries. These batteries are constructed with materials that allow for reversing their electrochemical reaction by applying a current to them from a charging device.

Secondary batteries are used in all kinds of gadgets and gizmos, including your smartphone, portable gaming devices, and remote controls.

Rechargeable battery construction

Types of Batteries

From the two major types of batteries, we can break down into all of the most common types.  Let’s list them off and go over some of their features and drawbacks.

Alkaline Batteries

Alkaline batteries are primary cell batteries. They are the most popular type of non-rechargeable battery. You’ll find alkaline batteries in all types of shapes and sizes, including AAA, AA, C, D, coin cells, and many others.

Alkaline batteries are have some great characteristics including having a long shelf life. Alkaline batteries can be store for years without losing charge. They are considered very safe, somewhat environmentally friendly in composition (though they still often wind up in landfills), and they’re voltage levels are very stable.

The main drawback of alkaline batteries is that due to their chemical makeup, they are only suitable for low current applications. This is why you generally see alkaline batteries used for remote controls and small devices such as flashlights, but never used in applications such as car batteries.

alkaline battery construction

Lead-Acid Batteries

Lead-acid batteries are a secondary cell battery (rechargeable) and are generally used in heavy-duty applications such as automotive car batteries. Due to their construction materials (lead and liquid acid) they are most often extremely heavy and not viable for most portable applications.

Most often used in high-current applications, such as power storage for solar farms, automotive starters, uninterruptible power supplies, and marine.  Lead-acid batteries are also very affordable to manufacture, are highly recyclable, and a low energy to weight ratio. However, since they are filled with liquid or gel acid, they can be dangerous if they leak and produce toxic fumes in enclosed environments.  Non-sealed batteries used indoors must generally have an exhaust gas fan installed.

lead acid battery construction

Fun fact: Lead acid batteries were one of the first rechargeable batteries ever developed!

Nickel-Cadmium Batteries

Nickel–cadmium battery (commonly referred to as a Ni-Cad battery) rechargeable secondary cell battery which is manufactured using nickel-oxide-hydroxide and metallic-cadmium. Ni-Cad batteries when first introduced were applauded for their ability to keep up with the steady voltage levels output by alkaline batteries and were seen as the obvious choice for their replacement.

However, Ni-Cad batteries have one major drawback. They suffer from memory loss. Not memory loss like Alzheimer’s but loss of storage capacity over time. This happens commonly when a partially discharged battery is recharged. After a time the battery forms a memory and will not discharge past this memory point.  For this reason a Ni-Cad battery typically performs best if it is fully discharged before recharging it.

Ni-Cad batteries, though falling in popularity are still found in may rechargeable devices such as walkie-talkies, portable FM radios, and flashlights.

Nickel-Metal Hydride Batteries

Next up as we continue to explore types of batteries, its time to talk about the nickel-metal hydride battery (commonly referred to as an Ni-MH battery). These are also a secondary cell rechargeable battery. Construction and composition are very similar to Ni-Cad batteries, with one major difference.  The negative electrode is made of nickel-metal hydride instead of cadmium.

This composition gives the Ni-MH battery some serious advantages over its Ni-Cad brethren. First, Ni-MH does not suffer from the memory loss issues associate with Ni-Cad batteries. This makes them last longer, and lowers maintenance and discharge cycle problems. Second, Ni-MH has about three times the storage capacity of Ni-Cad in the same form factor, resulting in more powerful batteries in smaller sizes.

Lithium-Ion Batteries

Lithium-Ion batteries (commonly called Li-On batteries) are also a secondary cell rechargeable battery.  Li-On batteries are one of, if not the most popular types of batteries in use today.  They are packed with fantastic features that make them suitable for many types of electronics devices. They tend to hold a charge when sitting with little to no discharge over time, unlike Ni-Cad or Ni-MH which need to be continually refreshed.

You’ll find Li-On batteries in smartphones, laptops, and many other portable devices where high power in a small size is important. Li-On batteries used in these devices is generally lithium-cobalt oxide (LiCoO2) and is considered very safe.

Lithium-Ion battery construction

Selecting the Right Battery for your Application

With all of these different types of batters (some we didn’t even mention), how do you decide which battery to use in your application? That’s generally going to come down to making three decisions:

  1. Cost – Let’s face it. Many times we’re limited by what we can afford. You’ll need to select a battery that won’t break your bank. This is why many R2-D2 builders select Lead-acid batteries over Li-On and just deal with the massive weight problems and dangers of leaking acid.
  2. Safety – Which brings us to safety! You’re not likely going to want to store a bank of lead-acid batteries in your kid’s room. And if you do, you’ll probably wind up in lots of hot water. Select a battery that can safely be used in the intended application.  A lead-acid battery in an outdoor buggy would be perfectly safe.
  3. Life – You’ll want to select a battery that will last long enough for your project. A drone that can only fly for 3 minutes wouldn’t be very useful.

If you have any questions, leave a comment below and we’ll do our best to help you out!


The post Types of Batteries – Electronics Basics appeared first on The Geek Pub.

]]>
https://www.thegeekpub.com/245576/types-of-batteries-electronics-basics/feed/ 7 245576