Team 8 Utilized the help of an external library as well as created functions in their own. The external library we utilized was known as FAST LED, and allowed us to easily push colors out to the LED strip quickly. Team 8 focused on building functions that mapped an input from a microphone then addressed and lit up the WS2182B LED strip.
This diagram features a general overview of the code team 8 used to create this project. After the baud rate was set the code would evaluate where a counter variable D was. This counter variable was used in place of a frequency dependence due to a lack of our current microphone to reliably produce a distinct clear difference in frequency.
The following code is an example of one of the functions Team 8 wrote and placed into a custom library. We used an Led matrix to assign individual values to each pixel of the WS2182B LED Strip. As can be shown from this function, the input from the Sparkfun soundboard is read by the Arduino through analog port 0. That value is then mapped onto a value from 0 to 9, because our led matrix had 4 rows and 9 columns per side. Once that mapping was complete the program would assign values to the LEDs through a for loop, starting with the first row and column of each matrix. Finally, once that process was complete the LEDs would be cleared and the remapped values would be calculated again. This is one example of the 5 functions team 8 derived over the course of this final project.
Traffic controls are a part of everyone’s daily life. To understand the application of the traffic control system, this laboratory is dedicated to a simulation of a three-way intersection traffic system that consists of three subsystems: traffic lights function, crosswalk function, and railroad gate function. The system is powered by two ATMega328P microcontrollers using Atmel Studio 7 software application and C programming language. The hardware for the project includes 6 traffic light LEDs, 6 anode 7-segment displays for the crosswalk, 4 red LEDs and 2 servo motors for the railroad gate controls system. The circuit is powered with 21 of 470Ω resistors, 2 of 74LS47 decoders. There were three main phases of this project: the project development phase, then the hardware execution phase, and the software debugging phase. During the project development phase, parts and tools were purchased. Moreover, the basic foundation of the project was built such as traffic light poles with wooden sticks, train tracks with popsicle sticks, and street surfaces with construction paper. After that, hardware parts were installed and all parts were soldered in the ATMega328P microcontroller during the hardware execution phase. Finally was the software debugging phase where C codes were tested timed for the perfect execution.
The Traffic Intersection was constructed on a 20in by 30in black foam board. The chosen intersection design was a T-Junction, where a main road is intersected by a side road (Similar to the intersection outside The William Speed Building). Green construction paper was used as grass, and to create the shapes of the road. Gray duct tape lines the road to mimic sidewalks while yellow duct tape dots the center of each road. A few traffic arrows and signs were printed out to add to the aesthetic. The traffic poles were made of wooden sticks covered in shiny metallic tape. The traffic lights were mounted to popsicle sticks protruding off each pole. Also on the poles were the 7-segment displays. These displays would countdown so pedestrians would know how long they have to cross, similar to a real intersection. The buttons couldn’t be mounted to the poles since they required to be pressed, and we wanted to minimize the forces on the poles to prevent them from being torn out. So the buttons were placed on the ground near each pole. The IR Sensors are placed on either side of each road to act as a trigger, whenever a car passes by. In real life induction loops are used to detect when a car has come to an intersection, but in this mock intersection, IR Sensors are used.
The train tracks were made with small popsicle sticks, and sat on top of a strip of brown construction paper. The servo motors were covered in shiny metallic tape and the traffic arm is a large popsicle stick covered in red and white construction paper. The train LED indicator poles are made out of small popsicle sticks wrapped in duct tape with the LED stems just wrapped around the t-section. Some railroad crossing signs were printed out to add to the aesthetic. All the wires were ran underneath the board to prevent cluttering the surface and to maintain the illusion of simplicity. The two ATmega328P Microcontrollers and the three breadboards were placed on the southeast corner of the intersection.
We planned to use the I2C interface to serve as a means of communication for each candle. Two data lines are used: a clock line and and data line. These two line are shared with every device including the master and slave boards. The master board can request to write or read data to each slave board. The signal consists of multiple sets of two bytes of date. The first seven bits in the first byte is the address of the slave board that is being addressed. The last bit is signaling whether it is requesting for the following data to be written or read. The second byte is the data the master is trying send. If the slave successfully received the data bit then it will send an acknowledgment bit to the master board.
We ran in to difficulties trying to simultaneously interface with P and PB variant boards because they require different address name schemes.
The fundamental goal of this project was to recreate the same type of crosswalk that could be found at the intersection of Eastern Parkway and Speed School. The scope of the project contained two stop lights (6 LEDs Total), walk/don’t walk graphics, battery powered crosswalk button, a sounding buzzer for echolocation, and a “time remaining” indicator.
The A3BU board worked well for all functions that we needed to complete this project. The board provided us with enough GPIO pins to provide power control for 6 of the 3V LED’s, as well as frequency pulse with modulation to control the buzzer. An analog -to-digital converter (ADC) pin was also utilized to detect digital-hi’s when the crosswalk button was pressed. The battery provided a voltage that would then be tested against a certain range, and if the value was in that range, the crosswalk logic would trigger.
LED Layout with A3BU, buzzer, and button.
The LCD display served a large purpose as it displayed all of our crosswalk functions. When the crosswalk button was pressed and the light turns red, a ASCII graphic of a “walkman” appears letting you know its safe to cross. A incremented bar also appears, gradually growing larger allowing the walker to see how much time they have left to cross. Once this timer ends, an ASCII “stop-hand” appears, letting the user know it’s no longer safe to cross.
LCD displaying the ‘walkman’ and the timer bar at the top
The buzzer was turned off and on by varying the duty cycle on the GPIO output, while the pitched was changed by editing the frequency of the pulses. Here is a video displaying all the functions.