Light Show using I2C protocol

The basis of the project was to utilize Inter-Integrated Circuit  (I2C) protocol to send lighting animation commands from a central control board to other boards. Here is our schematic of the lighting display.

In a broad description, I2C protocol allows for a master board to communicate to other boards in the form of read and write requests. Each of these boards can be assigned a unique address, allowing for the master to specify destinations for its commands. This protocol requires the use of inbuilt hardware, specifically the Twin Wire Interface (TWI) module on the atmel328p, to operate.

The above figure and following paragraph describes an ideal master to slave write transmission. First the master would send a start command onto the data bus. Each board on the bus then automatically acknowledges the master with an acknowledge bit. Then the master loads one of the boards’ address into the TWI data register and then sends that onto the data line. If a board has an address that matches, that board sends an acknowledge bit. Then the master would load a data byte into the TWI data register, followed by sending that byte onto the data bus. This data is then loaded by the target board into its own TWI data register. The master then can repeatedly send data bytes to same address, send another start command to specify a new board address, or send a stop command to relinquish control of the data bus.

Being able to utilize I2C protocol can be extremely powerful in the right circumstances. Certain sensors rely on I2C protocol. And given that a single bus can support up to 127 boards, you could connect that many chips or sensors, greatly expanding the capabilities of the central board with only two pins. It also is able to support multiple masters on a single data bus. Finally, the communication requires little resources from the sensor boards especially during a master write demonstrated above.

I2C does have its drawbacks. It is meant for communication between chips on the same board. Trying to communicate on a data bus longer than 2-3 feet results in misreads. The protocol does have an in-depth description within the data sheet, but when trying to implement we faced a lot of issues with the sensor board not sending acknowledgement bits.

If you want to learn more about how to implement I2C in your project, first check out a tutorial to wrap your head around the protocol. Then consult the documentation for your board to gain a specific understanding of I2C protocol for your board. It should be located under Twin Wire Interface (TWI). Your micro controller may even have multiple TWI modules, like the atmel328pb. Then I would recommend checking out this library to help with implementing your own I2C functions.

Bike Odometer & Speedometer- Big Picture

The chosen task by Team 14 was to create a bicycle odometer & speedometer for use in everyday life. This would allow the hard working men and women of America to stop getting into accidents while calculating the velocity they are traveling with rate and distance. This could potentially save many lives and it is the honor of Team 14 to do this great work. Team 14 hoped that by creating this project, they would learn more about real world applications for the material learnt in the class. The project was performed by first creating the code for the odometer and speedometer, and next was the task of creating a stable mount for attaching the components to the bicycle itself. Lastly was field testing to guarantee it works. The equipment used by Team 14 for the project includes: A bicycle, an ATMEGA328P Xplained Mini, a Hall effect sensor, an LCD display, as well as a few miscellaneous electrical components such as resistors.

Image

 

Image

Optical Theremin – BIG PICTURE

The proposed idea was to create a Theremin, an electronic musical instrument which is used with only gestures and no physical contact. The goal of the project was to successfully implement the idea while only using the knowledge from the previous lab work and creating a successful product. Therefore, the equipment necessary to complete the project was Atmel Studio and certain hardware components such as wiring, resistors, and amplifiers. As for the software aspect, the concepts of a previous lab were used to implement the proposed idea due to the similarities of the two. As a result of the effort into the project, the goal was accomplished as the Theremin was fully implemented. It was successful because of the way each gesture creates specific musical notes.

Carnival Arm: Overview

We performed the project with the intent of applying some of what was learned throughout the semester. It was originally conceived with the idea of using a servo motor and sensors, at which point it was only a question of how to use them in a practical way. We decided on a carnival game (of sorts) that involves placing a ball on a rotating slide and aiming it toward an opening to a buzzer sensor/shock sensor combination. If the player hits the buzzer, a random number generator determines whether the buzzer goes off (win) or does nothing (loss). In other words, the game relies on a combination of skill and chance. In true carnival game fashion, the player gets three chances to to make the buzzer go off. We used two computers, two microcontrollers, two breadboards, a shock sensor, a passive buzzer, a servo motor, foam golf balls, and a variety of household items

Catapult – Project Ideas

The goal of performing this project was to encompass learning objectives acquired throughout the duration of this course. We wanted to use a motor to pull back the arm of a catapult and have a solenoid be the release mechanism. The project was successful. When we pressed the appropriate key, the motor would pull back the arm and the solenoid would retract.

LED Maze, The Big Picture

the initial LED layout
LED layout in casing

 

The goal of this project is to create an 8×8 LED maze. The user should be able to use buttons to navigate up, down, left, and right through the maze. Instead of simply showing the entire maze at once, the only parts of the maze that should be visible would be the parts of the maze a person inside would be able to see, assuming the walls are taller than the person. I.E. the only maze walls visible would be the walls in the line of site of the user, and no walls behind another wall would be visible. A “Fog of War” type of effect. The goal is to accomplish this using transistors, shift registers, ray tracing, resistors, buttons, and of course LEDs. A jewelry holder is used as the physical “casing” for the Maze. Images above are the initial LED layout, and the casing used.

Sign-Interfaced Machine Operating Network (SIMON)

The purpose of Sign-Interfaced Machine Operating Network, or SIMON, is to translate sign language into numbers. We used a machine learning classifier to classify images of hands into the corresponding symbols or actions. SIMON interprets American Sign Language and displays the translation on the LCD screen through the following steps. The given image of the ASL sign was extracted to produce a single numerical digit using a machine learning model. That value was then serialized to ASCII and sent to the microcontroller. The microcontroller would deserialize the value and post the result to the LCD screen. Hardware used to complete this project included the ATMega328P Xplained Mini Board, a laptop with Windows, a webcam, and an LCD screen. The goal of final project was achieved as we were successfully able to read the American Sign Language images and display the desired result on the LCD screen.

8-Button Piano – The Big Picture

The principal goal of our project was to design and build an 8-button piano & music player – two different implementations of the same circuit. As a piano, our circuit utilizes the attached buzzer to generate tones C6 through C7; this was achieved through the use and development of an interrupt driven system. Once the button is pressed, the corresponding LED illuminates and its given tone plays through the buzzer. As a music player we utilized the same buttons, instead once the button is pressed and the LED is lit, the buzzer begins to play a pre-programmed song. These tunes utilize the same tone generation in the piano. We were able to accomplish both programs for our circuit by writing and debugging in the C programming language within Atmel Studio 7.0.

 

 

Furthermore, we continued to use the Xplained Mini ATMega328P microcontroller from the previous labs in our final project implementation. We faced several setbacks when implementing our planned design including, but not limited to, configuring the GPIO pins to accept an input from the buttons, eliminating the rotary switch, and generating a tone from the connected buzzer. Nevertheless, we were able to overcome these hurdles and implement our design as intended with only small modifications to the circuit and code.

Temperature Controlled Fan – Overview

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

 

Plant Watering System – Overview

Hello Embedded Systems Fans!

It’s that time of the year – finals! Which means it’s time for our final project. The Unknowns were working night and day trying to decide what project we wanted to do, when it dawned on us…. we’d forgotten to water out plants!

Luckily, they were able to be saved, but it sparked the idea; “what if there were a system which would figure out when our plants needed watering, and would do it for us?” And so came about the big idea for our final project – an automatic plant waterer! All we would need is our handy-dandy Atmega328P Xplained Mini, a motor driver, a water pump, and a soil moisture sensor (shown below). 

Follow The Unknowns though our plant watering journey!