Design: Test Plan

In order to determine whether my device succeeded, it make make noise according to the amount of light they receive, if the light is strong, then the noise will be loud and it will get weaker as the light gets darker.

The action of the device will be measure as scaled value form 0 to 1023. We will use the sound sensor to measure the level of the sound and use photo sensor to measure the brightness of the light.



Design: Device Plan

form today to the due day, I still have  5 days to complete my device and so far, I think I have all the part I need for my project beside a capacitors that will supply  power for my device.

The skill I need to complete my device is the ability for coding and so my light sensor can start to work and order to build my device will be Electronics first because my device doesn’t to much mechanical and the only thing that’s doing the mechanical is the microphone.


“Light Sensor Microphone”

In the real world, my device when create sound base on the light and since my device doesn’t do anything mechanical so only thing I need on my mechanical list will be speaker.

For my device, the speaker/sound will be the output and the light sensor/light will be the input that give order to the out put. In my electronic list will be a light sensor, a capacitors, and the jumpers.

The information my device need to know is the light, which is the input for my device. The device will only face two situation, it’s whether the light is on and the device will stop making sound or the light is off and the device will remain silent. The things that my Arduino code will do is that the light sensor will receive the information of light and send the information of the light to the speaker and the speaker will start making sound.


// These constants won’t change:
const int sensorPin = A0;    // pin that the sensor is attached to
const int ledPin = 9;        // pin that the LED is attached to
// variables:
int sensorValue = 0;         // the sensor value
int sensorMin = 1023;        // minimum sensor value
int sensorMax = 0;           // maximum sensor value
void setup() {
  // turn on LED to signal the start of the calibration period:
  pinMode(13, OUTPUT);
  digitalWrite(13, HIGH);
  // calibrate during the first five seconds
  while (millis() < 5000) {
    sensorValue = analogRead(sensorPin);
    // record the maximum sensor value
    if (sensorValue > sensorMax) {
      sensorMax = sensorValue;
    // record the minimum sensor value
    if (sensorValue < sensorMin) {
      sensorMin = sensorValue;
  // signal the end of the calibration period
  digitalWrite(13, LOW);
void loop() {
  // read the sensor:
  sensorValue = analogRead(sensorPin);
  // apply the calibration to the sensor reading
  sensorValue = map(sensorValue, sensorMin, sensorMax, 0, 255);
  // in case the sensor value is outside the range seen during calibration
  sensorValue = constrain(sensorValue, 0, 255);
  // fade the LED using the calibrated value:
  analogWrite(ledPin, sensorValue);



// the setup function runs once when you press reset or power the board

void setup() {

 // initialize digital pin 13 as an output.

 pinMode(13, OUTPUT);



// the loop function runs over and over again forever

void loop() {

 digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)

 delay(1000);              // wait for a second

 digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW

 delay(1000);              // wait for a second