Difference between revisions of "S16: Laser Harp"

From Embedded Systems Learning Academy
Jump to: navigation, search
(My Issue #2)
(My Issue #2)
Line 197: Line 197:
  
 
=== My Issue #2 ===
 
=== My Issue #2 ===
There was an issue with sending the note off command in the MIDI task because our queue only accounted for the note to be played, therefore some instruments would play the note forever. What we wanted to do was to have the note play as long as the sensor was blocked (indicated by bool variable), but we couldn't properly access the bool variable in the ADC task. Therefore we have the note turn off in the ADC Task when the sensor is no longer blocked.
+
There was an issue with sending the note off command in the MIDI task because our queue only accounted for the note to be played, therefore some instruments would play the note forever. What we wanted to do was to have the note play as long as the sensor was blocked (indicated by bool variable in the ADC task), but we couldn't properly access the bool variable from the MIDI task. Therefore we have the note turn off in the ADC Task when the sensor is no longer blocked.
  
 
== Conclusion ==
 
== Conclusion ==

Revision as of 05:35, 24 May 2016

Grading Criteria

  • How well is Software & Hardware Design described?
  • How well can this report be used to reproduce this project?
  • Code Quality
  • Overall Report Quality:
    • Software Block Diagrams
    • Hardware Block Diagrams
      Schematic Quality
    • Quality of technical challenges and solutions adopted.

Project Title

Laser Harp

Abstract

Our plan is to design a budget version of a laser harp. This can be accomplished using infrared LEDs and infrared sensitive photodiodes. The two diode system will emulate strings of a harp. When the infrared sensor has detected an note that is played, the microcontroller will read the input from the ADC and send out a control signal to the MIDI board and the corresponding sound will play from the speaker. Controls include changing the loudness of the speaker.

Objectives & Introduction

Show list of your objectives. This section includes the high level details of your project. You can write about the various sensors or peripherals you used to get your project completed.

Team Members & Responsibilities

  • Abraham Carrillo
    • Sensor Circuit Design
    • Interfacing Sensors with ADC
    • Frame Assembly
  • Kristen Kan
    • Interfacing MIDI with SJ One Board/Sensors
    • Power Supply Circuit Design

Schedule

Show a simple table or figures that show your scheduled as planned before you started working on the project. Then in another table column, write down the actual schedule so that readers can see the planned vs. actual goals. The point of the schedule is for readers to assess how to pace themselves if they are doing a similar project.

Week# Date Task Status Problems
1 4/3 Finalize following circuit designs and order parts

1. MIDI 2. ADC 3. Power Supply

Complete
2 4/10 1. Interface MIDI with SJ One Board

2.Test recording and sound projection

Complete
3 4/17 1. Lay out ADC, sensors, and power supply on prototype board

2. Calibrate sensors 3. Write drivers for ADC circuit

Complete
4 4/24 Basic input/output testing Complete
5 5/1 Volume/Instrument/Octave Changing Complete
6 5/8 Design improvements (Range/Sensitivity/Control) Complete
7 5/15 Final product testing In-Progress
7 5/24 Demo

Parts List & Cost

Part Quantity Price (Total) Description
SJOne Board 1 $80 Main microcontroller
Adafruit VS1053 Board 1 $25 Sound Decoder, used to produce sounds
MCP3008 1 $2.32 Analog to Digital Converter
SFH 4550 7 $2.87 Infrared 850 nm diode
SFH 213 7 3.08 Infrared Photodiode
220 Ohm resistor 7 $0
Part # $
Part # $

Design & Implementation

The design section can go over your hardware and software design. Organize this section using sub-sections that go over your design and implementation.

Hardware Design

Discuss your hardware design here. Show detailed schematics, and the interface here.

MIDI Pin Connections.png

Hardware Interface

In this section, you can describe how your hardware communicates, such as which BUSes used. You can discuss your driver implementation here, such that the Software Design section is isolated to talk about high level workings rather than inner working of your project.

Software Design

There are two tasks: the MIDI Task(consumer) and the ADC Task (producer). Data is sent between modules over SPI and the value in which a sensor has been triggered is stored in a FreeRTOS queue. The consumer task sleeps while waiting for the queue to receive a value.

The MIDI Task is high priority and handles sending commands to the VS1053 to turn a note on. When a note is received in the queue, the task wakes and processes the note type. Communication is done with the SJ One Board through SSP1.

The ADC Task is medium priority handles reading values from the sensors through the ADC converter by looping through every channel and checking if the value is above 835. If it is, it sends a corresponding note type to the queue, which signals the MIDI to play a note. This task also includes the volume and instrument controls, because the MIDI Task may be asleep when the button is pressed. Communication is done with the SJ One Board through SSP0.

Implementation

MIDI Task Algorithm

1. Sleep while queue is empty.

2. When a note is received, a message is sent to MIDI to turn note on.

3. Return to sleep.

4. Repeat.

ADC Task Algorithm

1. Read 'change volume/instrument' push buttons.

2. If active, perform relevant functions.

3. Read ADC channels 0-7 via SPI.

4. If data is below a certain value for channels 1-7, the note to be played is sent to the queue.

5. A message is sent to MIDI when the data returns to default to turn the note off.

6. Repeat.

Testing & Technical Challenges

Describe the challenges of your project. What advise would you give yourself or someone else if your project can be started from scratch again? Make a smooth transition to testing section and described what it took to test your project.

Include sub-sections that list out a problem and solution, such as:

My Issue #1

Talk about voltage drop?

My Issue #2

There was an issue with sending the note off command in the MIDI task because our queue only accounted for the note to be played, therefore some instruments would play the note forever. What we wanted to do was to have the note play as long as the sensor was blocked (indicated by bool variable in the ADC task), but we couldn't properly access the bool variable from the MIDI task. Therefore we have the note turn off in the ADC Task when the sensor is no longer blocked.

Conclusion

Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge?

Project Video

Upload a video of your project and post the link here.

Project Source Code

References

Acknowledgement

Any acknowledgement that you may wish to provide can be included here.

References Used

List any references used in project.

Appendix

You can list the references you used.