Sunday, May 10, 2015

Final Project: Noise-o-meter

Step 1a: Brainstorming Product Ideas

For our final project, my partner Sarah and I were to create a product that would aid the CSC.  We started out by brainstorming several ideas. Some key points we kept in mind were that the product should:

  1. engage the students
  2. not over-engage the students to the point that they become distracted
  3. not make noise
  4. be simple enough for children of different levels to understand and associate with noise
  5. be sophisticated enough to incorporate all the methods we learned in class. 
  6. allow for quick and easy modifications by the user
  7. be easy to debug 
  8. be able to be incorporated in the classroom curriculum 
  9. be aesthetically pleasing
We initially came up with several ideas,  later cutting down to two options:




Step 1b: Brainstorming Product Design

Our hearts were drawn toward the Noise-o-meter!  The first design was the image shown above.  After discussion with Professor Banzaert, she explained that a linear progression of sound would be easier to understand for the children than a circular one.  Our first thought was to make a wave-like design shown below:


After discussing with Becky, she made two points that required modification in our product design :
  1. If children assciate the red light with a face covering its ears, they may only associate it with covering their ears, allowing them to continue being loud.
  2. Some children associate better with pictures, where as others with words.
This made us change the design from the one above, to this:


When looking for LEDs to use for our project, we realized it would be time-consuming to solder hundreds of single LEDs together.  Professor Banzaert recommended we these LED strips instead: 

https://www.adafruit.com/products/285


Since these LED strips do not bend while lying flat, we had to change our design to accommodate them. The following image is our final design as well as price calculation for our purchase.  




Step 2: Product Building

1.  Laser cutting a delrin sheet into our desired shape (created on SolidWorks):



2. Attaching LED strips onto board and soldering the strips together with wires. This was the most time-consuming and difficult step in our entire process.  Many times the solder would break off, removing the underlying copper and rendering the entire strip unusable.



3. Making the necessary connections. The Arduino was connected to:

a) sound sensor which detected the noise level
b) LEDs that light up based on the number read by the sound sensor
c) two servos that move from position one (0 degrees) to position two (180 degrees) based on which LED is on.

The following image is our test piece before connections were made on the final delrin sheet with the LED strips.



4.  We attached the breadboards, ardunio, and servos to our product.  We used LEGOs to create a:

a) compartment for the arduino (to prevent damage)
b) gear mechanism to push a message out
c) base for the servo so that it would be on the right level to carry out the mechanism

The legos were attached to the delrin sheet using hot glue.





5.  Our last step was to create a code that would make this work!

a) The code for our test piece (before attachment to the delrin and with three single LEDs)


b) Code for final product (LED strips instead of three LEDs)


c) The code above reacts to the input from the sound sensor very fast, causing quick changes in the color of the lights.  This would confuse the children.  To smooth the transition between colors, we modified the code to average every 10 readings from the sound sensor.


Step 3: Product Testing

Time to test our product! Although we visited the CSC to collect data on noise level, for the simplicity of presentation, we used an online tone generator to test our product.



Future Modifications:
  1. With more time, we would incorporate a potentiometer to allow the teacher to to change the sensitivity of the product based on activities in the classroom. I.e. nap time would have a different loudness threshold than group activity. Although we wrote the code for the potentiometer, time did not allow us to perfect it for use.
  2. Another type of smoothing code we found on the arduino website averaged 10 readings and included every new reading in its previous average.  When applied to our product, we found our own averaging code to work better and decided not to use the one provided below.  With more time, we would be able to modify this code to produce our desired result.

Final Notes:


  1. The faces we added to our design are attached to the delrin by velcro, making them interchangeable and also allowing the teachers to use their own drawings.
  2. The delrin is a good surface for dry erase markers, allowing the teachers to change the messages as they desire.
  3. The messages are attached to the mobile actuator using legos, allowing the teacher to easily pop it off and on when they need changing.
  4. A battery pack allows the teacher to place the product where necessary, without the restriction of placing it near an outlet.
  5. We had so much fun creating this product!  

Sarah (right) and I with our final product!







Thursday, May 7, 2015

Matlab Introduction

This is my first experience with MATLAB!

To familiarize our selves, we read through the first four chapters Allen Downey's Physical Modeling in MATLAB and did some assigned exercises.



Here, n represents the nth element of the fibonacci sequence.





We first simplified the problem for ourselves like this:








The textbook knew we would think in this way!  It informed us that we did not account for all the cars being transferred. Below is the correct code:



This problem taught us how to use a for loop.  The loop runs 52 times to show the number of cars in each location at the end of the year.




Here, we learned how to make plots.  We added three new lines to our loop:












Wednesday, May 6, 2015

Frank the Sciborg follows the brighter path!

This was by far the most difficult project in class.  Our goal was to get cyborg to follow a path made of white tape.  A brightness sensor is attached to the cyborg that outputs readings based on the brightness it detects.

Bang-Bang:

Our first thought was to make the sciborg follow a straight line when it detected the brightest part of the tape.  When it detected darkness, it would rotate to find the bright path again and continue on it.

Several frustrating iterations for this method proved fruitless and Professor Banzaert advised us to allow the sciborg to follow the edge of the tape rather than the center.  We found the brightness sensor to read the edge as 535. The following code moves the sciborg forward when it it detects the edge and turns left to search for the edge when it no longer detects it.

 

Proportional:

This was the most difficult part of the most difficult project!  Our goal was now to implement proportional control.  This meant that our sciborg will be constantly moving instead of stopping and searching for the edge.  

We first calculated our error = current brightness detected - desired brightness = 475
Then we calulated our gain = largest error/total brightness = 1.1

We coded our sciborg so that when it detects a brightness greater than 475 it would search left and search right when it detected the white tape.

The numbers in this code are the result of over 30 iterations and changes in our gains, error, speed, parameters etc, to reach this final stage.  Although it isn't perfect, it was close!  Allowed more time and patience, we would continue to play with the numbers to make it perfect.







Notes:


  1. And interesting observation we made was that when we used a code that worked on a another groups sciborg, it would not work for our sciborg.  Till this day we are not sure why.
  2. This was hard.  
  3. I will forever be afraid of the combination of motors and brightness sensors.





Tuesday, May 5, 2015

Arduino Day 4 - Encoder, Touch Switch, and Ultrasonic Sensor with Frank!

1.  Run encoder code:



With readings:





2.  Have the touch switch turn on an LED and then turn it off.






3.  Connect an ultrasonic sensor and have it read values.



4.  Use encoder information to travel 10 feet.





5.  Have sciborg go forward until touch sensor is pressed and then go backwards.




6.  Have the sciborg go forward if the ultrasonic sensor detects nothing in front of it and stop when it does.






7.  Have the Sciborg use the encoder again to go 10 feet but with proportional control this time.




8.  Create a "nudge" function for the proportional 10 feet code to push the sciborg to the finish line!



10.  Give Frank the capability to follow a CONGA LINE (Bang bang w/ultrasonic sesnor)





11.  Let Frank follow the conga line using proportional control!