In this lesson you will learn how push buttons work.
Relax, this one is going to be very easy!
The job of the push button is to either close or open 2 separate metal contacts in order to allow electricity to flow or to prevent that flow. You have many options.
Here is the concept for complete dummies:
Push the button down, metal lever move down and connect 2 metal pieces, electricity go through
Push the button down, metal lever move down and disconnect 2 metal pieces, electricity no go through
Here is the schematic symbol for a simple push button. Remember a button can either connect 2 contacts or cause a separation, it depends on which you need for your electronic or robot project.
Here are some examples of buttons. some even have LED lights inside.
There are also soft push buttons as you have seen in video game controllers and tv remotes.
Now take my hand and let me show you something incredible that I only came across after falling asleep on my desk with a can of beer in hand one night because good things happen to good people.
This is my keyboard. When I woke up it was full of beer, like a swimming pool. I dumped it all out and opened it up. I was amazed at what was inside.
While millenials and Gen Z are busy buying overpriced mechanical clickity-clackity keyboards that they can smash to bits while streaming on Twitch there is an incredible, simple mechanism at play.
Mine is not mechanical, it's $9 and I love it. It is a membrane type keyboard, very cheap and very common. Under the keys is a membrane sheet with bubbles for each key. Underneath that are 3 layers of plastic sheeting.
When you press the keys they come in contact with the 1st of 3 layers of plastic sheeting.
The top and bottom sheets have a slightly different circuit board looking pattern.
The middle sheet has nothing and acts as an insulator.
Think of the analogy you learned with diodes.
The lines are roads that connect to the keyboard's own computer, a microcontroller, which you will soon learn how to use and program.
The dots are like helicopter landing pads waiting for you to push the key down which pushes a rubber dome down.
When the rubber dome pushes down on the top layer it helps to complete the circuit with the bottom layer so the electricity can flow from one pin of the microcontroller through that top road and continue through to the bottom road back to the microcontroller on another pin.
The microcontroller has been programmed to assign that electricity coming into that pin a specific value.
That value is then sent through your usb cable to the computer which interprets that value and prints the letter on your screen.
I was amazed at how simple this complex looking thing is.
Its basically a map of soft push buttons!
I unscrewed the plastic sheets from the microcontroller and washed them all with dish detergent and warm water.
I then used a towel and a hairdryer on LOW HEAT to dry them.
It must be COMPLETELY dry or it will short out and not work.
Also, make sure to scrub the contacts that connect to the microcontroller with a soft sponge and then completely dry them.
If anything is wet you will need to keep separating the layers and drying them. It might take some time and a few attempts.
Just be patient.
If you have 3 dry layers feel free to screw them back into the microcontroller but you can unscrew the microcontroller board to be able to move it all around. Put it on your desk, a window, your arm, anywhere dry.
Try typing and watch your screen. When you push each circular contact you are helping complete the circuit. You are bridging the connection with your own skin!
YOU are the push button now!
Some common uses for push buttons are:
Turning LEDs on/off
Increasing or decreasing a counter with each button press
Setting up a clock or alarm
Triggering an event, a function, a routine
Acting as a gatekeeper for electricity (Noone in or out unless I push this button!)
1. What are two types of push buttons?
2. What is the schematic symbol for these two types?
3. Draw a schematic for an led, battery, resistor, and push button.
4. How are pushbuttons used with microcontrollers?
Get my favorite books on programming AVR chips I use.
Equip yourself with the most dependable, no hassle, quality usb programmer I use daily.
Make sure you have a basic kit. Arduino is fine, it contains the removable AVR 328p chip we will use.
I started with something very similar.
You now know the simple concept of push buttons.
You can now imagine what is happening each time you press a button even on a touchscreen. You are allowing electricity to flow through or you are causing electricity to stop flowing or go to ground.
You can now connect a push button to a power source on one side and a resistor and led conneceted to ground on the other side.
Play with this concept and review, review, review
Keep it up!
See you in the next lesson!