Magnetic Alarm with Keypad – Schematic/Hardware Design

Here is the schematic and breadboard layout of our design. The Reed sensor and piezo buzzer each run off of five volts, and each has a signal going to/ coming from the A3BU. The Reed sensor provides a signal when a magnet is moved away from it, and the piezo buzzer produces an ‘annoying’ output when it receives an incoming pulse width modulation. The system will be reset with the keypad which runs off of a 4×3 matrix, for a total of 7 pins, using basic logic to match the pins to create the numbered inputs which will need to be defined in our code, or at least just mapped correctly.

Magnetic Alarm with Keypad – The big picture

Our group, Genuine Risk, have been working on creating a basic security system idea using a Reed sensor, a keypad, and a piezo buzzer. The idea is that the reed sensor could be placed in a door, on a window, or the like and be affected by a magnet in the moving portion. When the subject is opened, the reed sensor’s output goes high. The A3BU board then takes this input, and outputs a frequency to the piezo sensor, causing an alarm. A keypad can then be used to turn off the alarm, and after a delay, the security system will reset itself. Another post will be forthcoming tonight with the schematic and wiring.

Secured Music Box

The design for our project included a reed switch in the form of a magnetic sensor, three different colored LEDs, a buzzer, and a code input. We started with a cardboard box, which we added a door to, and then attached the magnetic sensor to the door so that when the door is closed, current flows to the yellow LED, and when the door is opened the current is broken, which a pin on the A3BU will detect. When that pin is triggered, two pins will go high and send current to a red LED and a buzzer. If a code is then entered, the two pins that were turned on will be sent low, and a new pin will be sent high to make a green LED  turn on instead. When the door is closed, the yellow LED should turn back on, and all other pins should be low.

Motion Sensor Alarm System – The Code


while (1) {
	if (ioport_get_pin_level(MOTION_SENSOR)) {
		pwm_start(&pwm_cfg, 50);
		while (1) {
			if (!ioport_get_pin_level(BUTTON)) {

This is the main loop running on the microcontroller. It continually checks if the level of the pin connected to the motion sensor is high. If it is high, then pulse width modulation on the pin connected to the buzzer starts.

Then we enter another while loop which polls for a button to be pressed. If the button is pressed, pulse width modulation stops (and therefore the buzzer stops buzzing) and we delay for 20 seconds. The motion sensor stays on for a few seconds after it has detected motion. If we didn’t delay here, then we would immediately break out of the inner while loop, pass the if statement, and start pulse modulation again. This would cause a strange effect while the motion sensor is still on. Therefore, we delay for some arbitrary amount of time before we poll for the motion sensor again.

Harry Potter Sorting Hat – Project Idea

We embarked on building the Harry Potter sorting hat as our final project.  In the HP universe, all new students at Hogwarts School of Wizardry & Witchcraft are sorted into one of the four ancient houses based on the personality of the student by a magical sorting hat. The four houses are: Gryffindor, Ravenclaw, Slytherin, and Hufflepuff.

Related image

An IR sensor, color sensor, and piezo buzzers were used along with the Atmel software, an A3BU board, an Arduino Uno board, and Arduino IDE software. This combination of sensors and programming will allow the sorting of houses as per the lore of Harry Potter.

Here are some of the ideas the project utilized:

1)    An IR sensor for knowing if someone is wearing the hat.

2)    A color sensor to take in data from hair color.

3)    Piezo buzzers to play a short tune from the movie’s theme song. (The original plan was for the hat to shout the different house names as seen in the books/movies, but due to the time constraint, this was unfortunately not undertaken).

4)    All three devices (above) were to be integrated into a circuit with a voltage divider.

5)    An Arduino Uno board was to be used for the integrated sensor circuit.

6)    The A3BU would take in the data read from the Arduino and display the specific house onto its LCD screen.


Motion Sensor Alarm System – Schematics and Layout

Below is our original schematic for our Motion Sensor Alarm System.  The original project would integrate a Motion sensor, LED indicator, Micro Controller, RF Receiver, and RF Transmitter.

However, the RF Transmitter was not going to arrive in time of the projects deadline.  Therefore, we decided to remove the RF Receiver and RF Transmitter from our project entirely and built the interrupt of the buzzer into the Micro Controller.  This is reflected in the updated schematic and layout below.


The new Motion Sensor Alarm System works as follows.  The Motion Sensor will detect motion, sending a signal to the LED and Micro Controller.  The LED will alight, indicating that the motion sensor is working.  The Micro Controller receives the signal that the Motion Sensor is active and uses that signal to begin playing the Buzzer.  The Buzzer will continue to sound until the interrupt button SW1 is pushed, this means the Buzzer will continue to sound even if the Motion Sensor does not detect motion anymore.  The interrupt button SW1 will keep the Buzzer from sounding for a 20 second time frame.  During this time frame, the Motion Sensor can continue to turn on or off which will activate and deactivate the LED, but the Buzzer still will not sound until the time frame concludes.  This time frame can be edited in our code to be any amount of time.

Lucky Debonair – Temperature Controller – Big Picture

Every day, millions of people around the world use indoor temperature controls in the form of air conditioners and heaters. Additionally, some computing machinery and medical supplies must be stored at specific temperatures to remain optimal. To get an idea of how these systems function, we decided to build a small environment and attempt to keep it at a certain temperature.

Our temperature-controlled environment is a box roughly 200 cubic inches in size, and is made of poplar wood. On each side of the box is an opening, one for a hair dryer and one for a small fan. The fan draws air into the enclosure from a separate wooden box of similar size that contains a series of ice packs. Inside of the enclosure is an A3BU micro controller, which has a built-in temperature sensor, as well as a breadboard with an exposed LED and other necessary wiring. The hair dryer is plugged in to an “off” outlet of a controllable power relay that can be manipulated by the code on our A3BU. The fan receives its power directly from VCC of the A3BU.

The code that is loaded onto the A3BU controls which outlet on the power relay is activated. If the temperature in the enclosure is warmer than desired, the fan is activated and cold air blows in. If the temperature is cooler than desired, the off outlet relay is switched on, and the hair dryer is activated. Otherwise, if the temperature is as desired, both outlets are turned off. This keeps the control room at a relatively consistent temperature. By doing this project, we gained a basic understanding of the temperature-controlled systems found around the world.


Music Keypad- Big Picture

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”



Balancing Bot with Gyroscope

Finally got our project moving. We are working to create a self balancing robot. This project is a perfect fit for the class as it lets us use code from previous labs and use technology we understand.

Self balancing features have become more and more necessary as robots begin to become commonplace. We hope that our design will be a good example to the class for what could find its way into robotics in the future.

Motion Sensor Alarm System – The Big Idea

Team Super Saver began work on laying out the hardware that would be required to build the Motion Sensor Alarm System. We experimented with the individual components to learn exactly how they worked. Our plan was to create a system that used a motion sensor to detect if a person was passing by, which then set off an alarm. If that person had the correct key fob, they could disable the alarm when they walked by.


Starting with the PIR Motion Sensor, we wired it up directly to an LED and resistor in order to test its timing and sensitivity settings. We learned that by keeping the timing dial and sensitivity dial at their minimum values, we could light up the LED most accurately with when we activated the motion sensor. Next, we test the buzzer.  We learned that the buzzer would not receive DC voltage, only taking AC.  This somewhat complicated our project, as now we must send a Pulse Width Modulation from the A3BU to the buzzer in order to trigger it, as opposed to just a DC signal, like the rest of our equipment runs on. Finally, we attempted to test our RF Receiver.  We were able to set it up but found that we never ordered a remote transmitter… So, we quickly placed an order and continued to set up the rest of our circuit. After that, we decided to break for lunch, and Gabe, who was in charge of coding the A3BU, had to leave. We the rest of us returned from lunch, we decided all that we could do for the day was clean up our board and draw schematics for the circuitry, in case something happened.

UPDATE: 12/9/17:

After realizing the RF Transmitter would not arrive in time for the projects deadline, we decided to remove the RF Receiver and RF Transmitter from our plans entirely.  Instead, we decided to build the interrupt to our buzzer directly into one of the A3BU’s Buttons.