Engr 415
Sound Sensor Signal Processing
A sound sensor uses sound waves to make diaphragm vibrate in response to sound. The capacitance changes, so the voltage across the plates changes
Using analog.Read() to get this voltage gives you a not so usable waveform

Using the SoundSensor() function allows us to read a more desirable waveform


Control Panel Code
Manipulator Code

Game Variables
For the structure of the Arduino mega code, we had global variables that would control the state of the game and each subsystem of the manipulator.
Motors


To set the boundaries of the play area on the manipulator, we made a reset function with limit switches.
If we did not do this, the motors would run free and would potentially damage the timing belt, the frame, or even the 3D printed part. In doing so is crucial to the parts of the manipulator and also making sure we can accurately move the motors.
​
In short, the reset function would:
​
1) Run motors in direction of one switch
​
2) When switch closes, it would stop the motors and set that axis counter to 0 steps
3) Repeat for other switch and axis counter


Now that the position is at (0, 0) steps, we can start moving the motors.
​
We found that we had limitations in motor movement due to the wifi setup we were given, so we had to compensate with preset steps for each command given by the master operator.
​
To make sure the position of the manipulator moved within our boundaries, we counted each step the motors took and tested the amount of steps it took to reach the end of each axis.
We then set a condition, along with the direction given, to not move if the step count is greater than the step limit (in both cases 1050).
​
For the opposite direction of each axis, we just set the condition to not move if the switch is closed.
Embedded Systems Diagram

State Machine
