The purpose of our project was to create a Frequency Spectrum Analyzer that receives an analog input via a 3.5mm audio jack and shows the frequencies of the signal on a board of 60 LEDs. The fourier transform converts audio output frequencies back into the original input frequencies and was implemented via the fix_fft library for Arduino. The first step of programming was to test the LEDs with example code from Adafruit, the company that manufactures them. This strandtest program includes functions such as color flush which lights each LED in sequence to a given color with a delay between each illumination of the LEDs. Once the LEDs were proven to be functional, the LED enclosure was built (here is the strand test with the enclosure) and analog signal testing was begun. First, the 3.5mm auxiliary jack’s right channel was connected through a 3.5mm breakout adapter to the analog 0 port, then the jack’s sleeve was connected to the ground of the board. To process the signal, the 1024 analog samples were sent as an array through the fix_fft function within the fix_fft library. 10 samples were taken from the output of the fft and sent to the terminal to verify functionality. Here an issue was discovered. If the analog reference value is not set, the output will show signal noise due to floating values. This problem was fixed by adding analogReference(DEFAULT) to the setup function. To display the fft output values, a setBar function was created. This function receives the value for which frequency column to modify and the data for that frequency set. If the input data value is above the threshold for a given column, the LEDs will light up vertically indicating how strong the frequency is at that position. For instance, if the threshold is 15 and the column is 1, the third LED will light up with a value of data greater than 45 (15*3). To set the color of the LEDs, the setPixelColor(n,color) function was used. The bottom row’s color is set to green with a gradient reaching red at the top row. After each iteration through all received analog data, all LEDs are cleared until new data is received. This completes the cycle for spectrum conversion and displaying the data.
The goal of this project was to construct a simple two lock mechanism using the ATmega328P microcontroller, a servo, a solenoid, and a 12 key keypad. The project wasn’t a complete success. The solenoid does retract into an unlocked position upon correct key presses and the servo does rotate into a lock state and unlock state, but the both systems cannot happen at the same time. The problem is caused by both systems using the same timer, and could be fixed by using both timer 0 and timer 1.
This project served as a chance to use topics learned in previous labs, to create a fun video game, playable by all ages. Using serial communication, a pong game was constructed. The software to build it used a combination of Python, C, and Assembler languages, and was and programmed in Windows and run on Windows and the ATMega boards, with an intent to port to a Raspberry Pi 3 model B. The hardware for the controllers was implemented using two XplainedMini boards, each with a sliding potentiometer mounted on a breadboard. These components were all set in a wooden casing. At runtime, the game displayed on a PC and players could maneuver their paddles using the potentiometer to pass a “ball” back and forth.
Since this game was meant to be played by anyone, it was imperative to create user friendly graphics and controllers. For the software, this goal was a bit of a challenge. The frame and data transfer rates had to be adjusted to make the sliding motion of the potentiometer match the movement of the paddle. For the hardware, this meant making a handheld, sturdy controller that was easy to assemble and disassemble.
The final project that our group, DayStar, decided to work on is a LED sign that reads, “Welcome to U of L”. The implementation of a light sensor gives us the ability to change the frequency of the LED lights. With all the LEDs wired together, we are using the Atmel software with an A3BU board to control the abilities.
For our final project, we wanted to incorporate some of the skills we’ve learned in previous labs to create a unique and interactive device. Using pulse width modulation from Lab 4, we incorporated our AVR XMEGA-A3BU XPLAINED with a 4-input number pad, four 10K ohm resistors, a piezo buzzer and jumper wires to create a musical touch pad that plays different songs based on which button is pressed. After getting a general understanding of the keypad schematic, we connected the common connection to VCC on the J2 header of the A3BU. The other 4 buttons were connected to 4 of the ADC pins on the J2 header. We connected the piezo buzzer to the SDA and GND pins on the J1 header. After researching the frequency limits of our piezo buzzer, we were able to assign certain frequency values to specific pitches and program the A3BU to play 4 different songs: Twinkle Twinkle Little Star (button 1), Mary Had a Little Lab (button 2), Jingle Bells (button 3), and Ode to Joy (button 4).
General A3BU Setup
Protect the Brew. After a bad experience with collecting money for a Beer Olympics I came up with the idea for our project, a smart beverage dispenser. One that would limit access to the delicious golden ale inside. Despite my original intentions this project can also be implemented to prevent underage drinking and to keep track of how much people drink. So don’t tell me you had 6 beers when you only drank 4.
The key aspect to this project is the fingerprint scanner. It provides the security we wanted for the project at an affordable price. With two microcontrollers, a Homebrew Draft System, the fingerprint scanner and a solenoid valve the project began. The system is designed so the beverage will only dispense after your fingerprint is verified. We used an Arduino to communicate between the scanner and the A3BU which controlled the other functions. The system will identify who accessed the system and display it on the A3BU LCD. It will also activate one of the LED’s that indicate the status of the fingerprint, red if denied and green if approved. Assuming the approval signal is received by the A3BU it will send a signal that activates a solenoid motor through a transistor circuit. The System will then dispense the beverage for 20 seconds which at 15 psi will fill up a cup.
For our project, we decided to use a powerful electromagnet controlled by a microcontroller. We have a keypad on which user is able to input a code. If the inputted code is correct, then the magnet turns off and allows the user to turn off the magnet. The inspiration for this project came from a similar project, which created a Thor’s Hammer using an electromagnet that turned on and off based on a fingerprint sensor reader. We wanted to do something similar, but put our own spin on it.
Instead of creating an electromagnet from scratch, we decided to take apart an old microwave to convert the transformer into an electromagnet. A transformer has both a primary and secondary coil winding, and so the secondary coil needed to be cut out of the iron core’s housing. Then an angle grinder was used to cut the the weld to cut the top off. Then the primary coil was removed, and placed at the bottom of the iron housing. Masking tape was placed on the inside of the iron housing so that the primary coil was not making contact with the housing.
In order to turn the electromagnet on and off we needed to use an electronic relay with a simple circuit. We used a Grove Relay, which was purchased from FirstBuild. The circuit was simply a battery pack configuration connected to the electromagnet, and the relay was used to open and close the circuit. We also decided to play a simple tone with a speaker when the electromagnet was successfully turned off (i.e. the relay opened). Pictured here is the A3BU, a battery pack with four AA’s, a small speaker, and our electromagnet.
Here is a short video demonstrating the operation of the electromagnet. It shows the user initially entering an incorrect password, and the magnet staying on. Then the user entering the correct password and the magnet turns off. Then after pushing a button on the keypad, the magnet turns back on.
The intent of our final project was to create a keypad lock using a 12-key membrane keyboard and the XMEGA-A3BU board that would trigger a stepper motor to open a mechanical lock. We ran into a problem early on that forced us to change course slightly. The EasyDriver for the stepper motor we were planning on using for our lock did not arrive in time so we decided to go with an alternate driver. This ended poorly for us as the alternate driver caught fire during initial testing, much like our hopes and dreams.
As an alternative, we printed messages to the LCD while also flashing the onboard LEDs to signal that the provided password was correct or incorrect. We also implemented a menu system through which the user can either set or try a password. Passwords can be 10 digits or less, and are hashed upon entry for added security. If the user attempts to try a password before one has been set, an error message is displayed and the user is returned to the main menu.
For our final project our goal was to do something fun that would be entertaining to anyone who used our project. Thus we came up with the idea of the U-box. Our slightly more useful box does everything your typical useless box would do except it also has a cool LCD user interface thanks to the A3BU micro controller.
For those unfamiliar with what a useless box does we can explain. Basically you flip a switch, and then an arm comes out of the box and flips the switch back. This continues until either you give up or the box runs out of power. To this our group added a user interface that shows the attitude of the U-box. The first few times you flip the switch the box is disturbed. Keep flipping and the box will become angry. Finally the box will become so angry he gives up and you win. After this the “game” starts over again.
To accomplish the task of the U-box we needed to use PWM to control the servo motor and LED, input pins to determine if the switch was flipped, and additional software to tell the LCD display what to display to the user. Below is a link to download the video!