The idea for this project was to build an enclosed device that would actively attempt to cool itself as temperatures inside increased. The main components for the project were the ATmega328P Xplained Mini microcontroller, a temperature sensor, and a 5 volt DC fan. The device was placed into a small plastic enclosure. A circular hole was cut into the top to mount the fan, a rectangle was cut to fit an LCD screen for displaying the temperature, and two rectangles were cut on the side for ventilation and USB power. This project utilized variations of analog to digital conversion (ADC) from Lab 3 and pulse width modulation (PWM) from Lab 4.
The ADC on the microcontroller was used to convert readings from the temperature sensor into a temperature value. A separate temperature value was set as a target temperature. As the temperature inside the case increased beyond the target temperature, the fan would switch on to ventilate the hot air out of the case to cool it down. Additionally, a transistor was used along with PWM via the board’s Timer Counter 1 and Compare Match Interrupt to limit the voltage to the fan and control its speed. The fan would start at a 40 percent duty cycle and increase by 10 percent for every degree above the target temperature, maxing out at a 100 percent duty cycle. Conversely, the fan would decrease its duty cycle as the temperature decreased, turning back off after reaching below the target temperature.
Top View of the Case
Inside View of the Case
This project dealt with timing, frequency, and the phenomenon of persistence of vision. The project required a platform for spinning the display, the display, and the code to run the display.
The base platform is made from sections of 2×4 which provide a sturdy mounting point for the rest of the apparatus. The motor used to spin the LED’s platform is mounted on the wood base. Two ATMega328P boards are used, one for the motor and one for the LEDs. The LEDs are mounted in a breadboard on a separate section of light wood. The light wood and attached components all spin with an external battery allowing for two separate sections of the project.
Successfully getting the persistence of vision words displaying correctly required significant tuning to get the right timing. Another challenge was balancing the spinning section which was solved with weights on the opposite end. The complete product works and demonstrates the fascinating nature of persistence of vision.
An application was also made in the Unity Engine to help generate the necessary characters in a reasonable amount of time.
We are making a piggy bank that will keep track of how much money is inside the bank. The general idea is to make a cardboard coin sorter and set up some lights with photo sensors to track how far the coins have gone. If a coin makes it to the end, we are assuming it is a quarter but half dollars and dollar coins will be able to fit as well, to not clog the ramp.
For our project, we decided upon a MIDI controller because it sounded (ha, get it?) cool.
We wanted to be able to build something that would take MIDI files, convert them into 8 bit music, and play them out loud. We took inspiration from the music which we heard in older video game consoles and arcade cabinets. The songs we would choose would be from different games, TV shows, and movies that we all enjoy. On that note (more puns), this allowed for each member of the team to have some input in the direction we took with the project and get something personally enjoyable with the finished product.
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
“Ode to Joy”
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.