Arduino Part 2

LED and Photocell:

As a part of Part 2 of the Arduino exploration, Julia and I were required to create a program and circuit board capable of varying the LED blink rate based on the intensity of light. A photocell, short for photoelectric cell, is a device that generates an electric current dependent on the light incident on its surface. Essentially, our circuit had to alter the LED blink rate dependent on the degree of illumination of the photocell.

Firstly, we connected the photocell and LED to the circuit. It was important to note the different resistors used within the circuit. The LED and photocell have different current capabilities, therefore the resistors attached to each component varied in resistance as to prevent the circuit from fusing.

We then tested the sensitivity of the photocell through varying light intensity in the background and analyzing recorded light values of light, dim and dark. This helped show that the photocell is responsive and properly connected to the circuit. From here, we defined the photocell within the computer program, as seen through line 3. Using the previously recorded light intensity values, we were able to assign the photocell with numerical values of dark, dim, light and bright. By defining the LED blink delay with the photocell value in the program (shown in the last 4 lines), we enabled the LED blink rate to vary with the photocell’s sensitivity to light.

LED- Tactile Switch:

The next challenge had us focus on integrating a switch within the circuit.

As pictured below, the digital write command helped operate the pull-up resistor within the switch. The “if” is programmed so that when the switch value records “low”, the LED output is high, otherwise when the switch value is “high” the LED output is low. In other words, when the switch is pressed the LED will turn on and visa versa.

Such a program and circuit set-up can be highly useful. Through this design, one can help control particular components within a circuit. For example, a specific colour type of LED and number can be turned on through the switch while turning off other components within the cell. This design allows the circuit to continually run current, however control the operating components.

 

LED- Knob and Sweep:

The last knob and sweep program enabled us to control the movement of a pointed wheel through with a potentiometer.

The standard sweep program part of the Arduino C++ program helped perform the sweep function on the servo. This program simply facilitated the continual circular movement of the pointed wheel attached to the servo, when the potentiometer value was changed.

The subsequent part of the problem, the LED-Knob program, had us limit the axis of rotation between 60° and 120°. The main difference between these two programs can be seen through the 3rd last line of the function. In the sweep program, the mapping value of the wheel is between 0° and 360°, thus allowing the wheel to complete full rotations. In the Knob program, this line limits the wheel to be mapped between 60° and 120°, therefore only allowing the wheel to oscillate back and forth within a 60° rotation when the potentiometer values are manipulated with.

One comment to “Arduino Part 2”
  1. You have a clear and detailed description of your approach and thought progress. I love how you not only have pictures but also videos of your finished product.

Leave a Reply