To create our spinning LED display we needed to create a way for the board to communicate with each LED individually. It was important to use an odd number of LEDs so that we could create letters and numbers with a center arm, like E, H, and A. We decided to use 7 LEDs because this number creates a nice height for each letter, and makes the display readable at a distance. The LED display was constructed by creating a ground bus on one side of the breadboard and connecting the cathode of each LED to it. The anode of each LED was then connected to a 100Ω resistor, which in turn connected to a wire which led to the input pin that would control the LED. (refer to schematic below) In this way we were able to send information to each individual LED.
We also needed a simple way to turn the motor on and off, we decided on a slide switch to meet that need. This was created by connecting the positive wire from the motor to ground and the negative end to the center pin of the slide switch. The leftmost pin of this switch was connected to ground while the rightmost pin was connected to 5V. For a bit of fun we created an on/off LED, which was accomplished by running a resistor from the center pin of the switch to the anode of the LED and the cathode was connect to ground. We would advise caution not supply the ground and 5V required to run this circuit from your microcontroller as this practice permanently disabled one of our boards. Rather use some other source of power and ground, like the large breadboards supplied in the lab.
The circuitry and hardware for our project was rather simple. We had five total buttons, one for on/off toggle and four for the passcode entry. One pin on each button was connected to Vcc on the A3BU and another pin was connected to separate digital pins on the A3BU, then went through a pull down resistor to ground. The passive buzzer has two pins, one connected to the A3BU and one connected to ground. The two LED status lights were connected to ground on one pin, and the other pins were connected to separate pins on the A3BU after going through a resistor. Finally, the photo interrupter had one pin to Vcc, one pin to ground, and the final pin to a digital pin on the A3BU. After the project was functional, we trimmed down the circuit and made it a lot neater. You can see this in the image below. The final image is the circuit schematic for the project.
This part of the “Xplained Mini First Look” project was to compare and contrast the Xplained Mini board with the Arduino Uno, a popular microcontroller board with similar schematics. All I had to go off of for comparing the boards was the schematics and information online about them.
While reading the Arduino Uno webpage, I found that the Arduino Uno is based on the Atmega328 which is also on the Xplained Mini. Below is a screenshot from the Arduino website.
This is one of the block diagrams for the Arduino. The diagram shows in general how things are wired which is why it was useful in finding the ADC.
This is one of the schematics for the Atmega328P showing where on the chip which pins are related to what. It shows which pins are on the chip for the ADC; on this board it is pins 6 and 7.
First, we had to find a way to implement the keypad properly. After searching for the schematic on the internet, we realized that one pin was connected to all four buttons. The schematic is below. To understand the functionality of the keypad, we began the code by only using the first button. We connected one of the pins attached to all buttons to VCC on the J2 header. The other pin connected to button one is connected to ADC2 pin of the J2 header as well. We decided on using the J2 header because they are ADC/DAC pins on the microcontroller. Also, the J2 header pins were defined in the code as COL1, COL2, COL3, and COL4 for the column of each button. The code stated that the light on the microcontroller, LED0, will turn on when button one is pushed via an if statement. We also added a string of code to display on the LCD screen to show what button was pressed. At first, the LCD screen seemed to act a bit intermittent, and after speaking with the professor, a 10k resistor was added to eliminate floating values. By adding the resistor, we were able to have button one work successfully. We started to implement button two. After a bit of troubleshooting we were able to get button two working successfully, and from there it was just a matter of duplicating the code.
The schematic above is basic circuitry used in the implementation on the sign. It is powered by the A3BU, goes through a 110 ohm resistor before continuing to the LEDs where it daisy chains to each LED in that particular circuit. As mentioned above, there are 7 different circuits on the sign. One circuit for each of the LED colors(5) and two for the red and white LEDs on the letters “U” and “L”. This was done because we wanted to display U L without the rest of the sign being lighted. Although this is very basic circuitry, there were 114 LEDs on the sign, therefor soldering all the connections was very time consuming. But, it went together very well and we had no bad LEDs or bad connections to redo. The 5V power was coming from the J1 header on the A3BU. We used 7 J1 header pins, one for each circuit, and then grounded all LEDs to the A3BU via one ground.
The IR sensor’s function in our project was to detect when the hat is worn. Initially, it was implemented alone on a breadboard for testing. This particular sensor had a supply voltage of 4.5V-5.5V, so it could take power directly from the Arduino board. The sensor test program and serial monitor in the Arduino IDE showed the output values ranging from 0-1023, which indicated the detected distance.
Initially, we had the color sensor connected directly to the 5V port of the Arduino board. Once we realized that the color sensor has a max voltage setting of 3.8V, a voltage divider was implemented within the circuit to step down the 5V from the Arduino. The two resistors in voltage divider in series were a 220 Ohm resistor and a 330 Ohm resistor.
The 5V from the Arduino was inputted into the power line of the breadboard. From there, the voltage divider stepped it down for the devices that required it. The last item we needed to implement was a piezo buzzer, which was very simple in nature (when pin is high, buzz; when pin is low, stop buzzing). Delays and duty cycles are cleverly used to trick the piezo buzzer in playing decipherable simple music. A short tune of the Harry Potter theme music was found and implemented into our code.
Below are some of the pictures of to give a overview of how everything was wired up:
Here you can see the servo motor to the left that was connected to our A3BU which is being controlled by PWM. The duty cycles ranged from 15 (middle), 10 (left), and 20 (right)
In order to connect the servo motor and pressure sensor to the A3BU, first we had to look up what colors were used for the power, ground, and signal for the servo and then pins that were used for the pressure sensor. The servo motor is wired up to an external 5V DC power supply with an orange cable connected to the PWM pin on the A3BU. The pressure sensor was connected to a 3.3V power supply from the board and was connected to the ADC pin of the A3BU. The A3BU received power from a laptop.
The squirrel fans used to levitate the ping pong balls inside each tube were rated at 12V; therefore, the 3.3V output of the A3BU was not enough to drive the fans. Examination of Figure 4 (see Schematics section) reveals that we used a transistor and a 12V DC power supply to amplify the driving voltage of the fans. Each fan motor was connected in parallel with a capacitor and a protective diode. The 12V DC power was connected in series with each motor, capacitor, diode set, making the motor fans in parallel with each other so that each draws an equal 12V as needed. The input to each transistor was preceded by a 220Ω resistor in series with the transistor. The signal of the transistor was connected to ground of the motor, capacitor, diode set to control how often the 12V DC was to be pulsed across the motor. Consequently, the use of an npn transistor allowed us to scale our pulse width modulation signal from the A3BU (0-3.3V) to a 0-12V signal that drives the fans.
Step 1: To make one of these sensors start by taking a piece of duct tape the length of the finger it will be used for.
Step 2: Then cut a piece of conductive thread that is long enough to make in a U-shape that hangs off the end of the duct tape. The thread should be long enough to be attached to a wire and then connected to a breadboard, and placed on one side of the duct tape. Then do the same thing with a second piece of conductive thread, but have the thread hang off the other end of the duct tape.
Step 3: Cut out 2 pieces of Velostat (one for each conductive thread) and cover thread with the Velostat. Then get a 3rd piece of Velostat which will be placed between the 2 pieces covering the thread. Folding the duct tape is the final step in making the flex sensor.It’s important to make sure the threads don’t touch in any way, this will cause a short circuit.
Step 4: After making the sensor a multi-meter can be used to measure the resistance of our sensor. By attaching the two terminals of the multi-meter to the two threads on the sensor a resistance shows up on the multi-meter display. This resistance changes as the sensor bends. As one would bend their finger, the distance between the fingertip gets closer to your palm. When the distance between the ends of the sensor get closer, the pressure changes.
Our final project was the Anagram Solver we have many interesting aspects to our project. Some of these high level aspects include:
Controlling the LCD on the A3BU
Asking the USER for Input
Flashing LED’s for correct/incorrect answers
Flashing LED for inputs
Generating results based on C programming
Although we have so many interesting features, one of our best features is the crazy light show! After exiting the program, the program flashes both the blue and red LED’s and the LCD backlight in a spectacular fashion. It is truly an amazing aspect of our project!