The following information is a single lesson in a larger project. Find more great projects here.
In this project, you will create something similar to a magic 8 ball! Ask it a yes or no question, press a button, and a liquid crystal display will tell you if your future is bright. You can even write your own responses to display.
Step 1: Project Description
Crystal balls can help “predict” the future. In this project, you ask a question to a digital crystal ball, and turn it over to reveal an answer on a small LCD screen. The answers will be predetermined (from a list you generate), but you can write in anything you like. You’ll use your Arduino to choose from a total of 8 responses. The tilt switch in your kit will help replicate the motion of shaking the ball for answers.
Check out the circuit diagram for the project, below.
The tilt switch will act as a simple digital input on Arduino pin 6.
There is a potentiometer attached to the LCD that will control its screen brightness.
All other connections are used to control the LCD with the Arduino - and there are a lot of connections!
Continue to the next step to learn how to build the circuit.
Step 2: Bill of Materials
You will need the following electrical components for this project:
1 tilt switch
1 220 ohm resistor
1 10 k-ohm resistor
1 LCD panel ...and of course your Arduino Uno and a breadboard!
If you are using the physical Arduino kit, you might want to use a 9V battery and snap to power the Arduino, so it doesn't need be tethered to you computer with the USB cable.
- Continue to the next step.
Step 3: Liquid Crystal Display
The LCD (liquid crystal display) can be used to display alphanumeric characters. The one in your kit has 16 columns and 2 rows, for a total of 32 characters.
There are a large number of terminals on the board, labeled 1 to 16 from the right. These pins are used for power and communication, so it knows what to write on screen, but you won’t need to connect all of them.
To make the LCD easier to program, you will be using a code library called LiquidCrystal. You should already be familiar with libraries if you have done a stepper motor project.
Let's get started with the Crystal Ball project!
- Continue to the next step to learn how to build the circuit.
Next Lesson:Setting Up the Circuit