In general we learned a lot in this class. The overall ability to use the AT Mega 328PB allowed us to understand another embedded system of an Arduino. This ability to focus on what is needed, as we already learned how to effectively program one board, helped us quickly and effectively solve the other board. Not only did we do one board, but we did two Arduino board integration with the AT Mega to solve the problem we had at hand. A more powerful micro-controlled was needed as we ran out of IO pins on the Arduino, but the foundation would be the same if we switched to a PI or used a more detailed AT mega board with larger IO Pins. The foundation of Assembly in this source built the code awareness to understand libraries and even begin able to make our own on our computer to effectively create a unique system or objects.
The code used in the Arduino outlet was not overly complicated as the foundations were similar except with a different IDE and the C programming was easier to use. The ATmega was used as a motor controlled allowing for a simple call then react(slave action) operation for us to effectively use a motor to cool an area that was above the ambient conditions in the surrounding area per the DHT temperature sensor.
Lastly, the project gave us the ability to start from scratch of an embedded system. We created the functions of needing a temperature sensor/motor to cool, LCD to play a game with buttons, and a ultrasonic sensor to say if something was nearby. We used our resources to determine we needed a micro-controller as all of the sensors were able to have built or easily updated libraries in Arduino. The functionality was built like the rest of our projects as we integrated with the AT mega as a motor controller to help finalize our last task and communicate through a simple slave operation. More detailed communication of serial or I2C may have been optimal, but for our functionality and timing requirements, it was not needed.
In deciding to use the Arduino we had to do some research on the functionality. We knew how to use the AT Mega, but wanted to use Arduino because the sensor kit we bought had Arduinos and had better example. The sensor kit bought was:
The overall architecture of the project started with the three different sides of the “box”. The sides were a temperature sensor, game side, and ultrasonic sensor. The temperature sensor had the sensor being read by the Arduino with the fan to cool down an area was controlled by the AT Mega. This was done through simple digital IO pins that would be High on Arduino to the ATMEGA and low from the Arduino to AT mega if the temperature is less than 75 degrees Fahrenheit.
The other two components were controlled by an individual independent Arduino. The Arduino used a similar methodology controlling a QAPASS LCD display to ask questions. We used a random number functions in Arduino to create random math operations with a random number form 0 to ten with a math operations to 0 to ten random number. The program would call those two random numbers and create a random value leading to ask the user to click a button yes or no if it is correct. If it is correct, it will keep a continuous toll of what is correct and what is incorrect until the user resets the Arduino.
The last function of the Arduino is controlling a ultrasonic sensor and lighting a LED if the sensor in less than 6 inches. Simple Arduino function reading allowed for a conversion from time to distance allowing for a quick analog reading for the value. This allows for a major foundation and great control of a simple sensor. Using a 100k ohm resistor, a blue LED was powered to indicate that the distance detected was less than 6 inches saying something is nearby.
In starting this project we wanted to achieve a higher learning of smart controls for the business and home. The Fun Box we developed had 3 separate stations of controls. The first station consisted of a temperature sensor that would activate a fan once a desired temperature was sensed. The second controls consisted of a LCD screen and two push buttons. The screen was a gaming console with preprogrammed trivia questions and answers. The last station of controls consisted of an optic sensor and a light. It was to represent the auto light controls that many commercial applications and some residential home incorporate today for energy efficiency.
The controls and micro controllers we used were interesting to learn about. The mentioned optic sensor was an HC-SR04 ultrasonic Sensor. It used sonar technology to determine distance to an object similar to how bats perceive distance. It’s ranges were from 1” to 13 feet depending on how we programmed it. To better explain though the sensor sends out sound waves from the transmitter and when these sound waves bounce back after making contact with an object; the distance is easily calculated by the amount of time that process happens. The next control we used was the DHT11 Temperature and Humidity Sensor. This sensor ranges from -32 to 122 degrees Fahrenheit. It can be used for a variety of reasons depending on the programming application. The other controls used were a fan(DC motor acting as a fan), an LCD screen, 2 Arduino Uno microcontrollers, and the AT mega 328PB microcontroller.
The two arduinos were used to control the overall projects of game sensor and ultrasonic sensor. The AT Mega was used to control the fan and LED’s while the Ardunos were used for the brain of the temperature sensor. The Arduinos were originally used to communicate using Serial, but to simplify the process we used a simple IO port that would be high if the LED and motor needed to be turned on and low if they needed to be low.