Home Store Project Ideas Project Guide Ask An Expert Blog Careers Teachers Parents Students
Create Assignment

Is It Ripe Yet? Build a Circuit to Detect Ripe Produce

Difficulty
Time Required Average (6-10 days)
Prerequisites None
Material Availability Electronic circuit components required. See the materials section for details.
Cost Low ($20 - $50)
Safety Short circuits can get very hot. Follow the directions carefully to avoid short circuits.

Abstract

When you go to the supermarket, how do you pick out ripe fruits and vegetables? You might look at their size or color, or feel them for firmness. That might be easy to do when you pick out a half dozen apples, but imagine if you had to examine thousands of apples growing in a field, or strawberries coming down a conveyor belt getting ready for packaging. Suddenly, it is a lot harder to do yourself! What if a machine could pick and sort the produce for you? In this project, you will address part of the problem by building a circuit that can differentiate between two colors.

Objective

Electronically measure how light is reflected from different color surfaces, and build a circuit that can differentiate between red and green produce.

Credits

Ben Finio, PhD, Science Buddies

Cite This Page

MLA Style

Finio, Ben. "Is It Ripe Yet? Build a Circuit to Detect Ripe Produce" Science Buddies. Science Buddies, 28 July 2017. Web. 19 Sep. 2017 <https://www.sciencebuddies.org/science-fair-projects/project-ideas/Elec_p088/electricity-electronics/build-a-circuit-to-detect-ripe-produce>

APA Style

Finio, B. (2017, July 28). Is It Ripe Yet? Build a Circuit to Detect Ripe Produce. Retrieved September 19, 2017 from https://www.sciencebuddies.org/science-fair-projects/project-ideas/Elec_p088/electricity-electronics/build-a-circuit-to-detect-ripe-produce

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.


Last edit date: 2017-07-28

Introduction

Many fruits and vegetables change color as they ripen. For example, tomatoes, strawberries, and red bell peppers all change from green to red. Color is just one way (along with size, texture, and smell) that you can tell if a fruit or vegetable is ready to be harvested or eaten. Imagine a factory that packs strawberries into plastic containers to be shipped off to grocery stores across the country. It might be useful to have a machine that automatically rejects any green strawberries that were picked before they were ripe. Or, you might want a machine on the farm that automatically recognizes strawberries by color and only picks the red ones to begin with. In this project you will build a circuit that uses visible light, which is the part of the electromagnetic spectrum our eyes can detect, to automatically differentiate between red and green objects.

Visible light comes in all the colors of the rainbow (which are measured by the wavelength of the light). Light can be reflected or absorbed by different surfaces (or transmitted through a transparent surface). The colors that we see in the world depend on what colors of light are reflected back to our eyes. White light (from the sun or most light bulbs) contains many different colors of light. When we look at a surface that is illuminated by white light, some colors are absorbed by the surface, and we see the color or colors that are bounced back. For example, an object that we see as red reflects mostly red light and absorbs the other colors (Figure 1, left). Objects that we see as white reflect all colors, and objects that we see as black absorb all colors. For a more detailed explanation of how humans perceive color, see the Bibliography.

White light reflected from and absorbed by a colored surface
Figure 1. When white light shines on a surface, some colors are absorbed, and other colors are reflected back to our eyes.

What happens if, instead of white light, you only shine a specific color of light on a surface? For example, if you shine a red light on a red surface, that red light will be reflected back. If you shine a red light on a green surface, however, the red light will be absorbed (Figure 2). If the green surface is only illuminated by red light, it will appear black.

Red light reflected by a red surface and absorbed by a green surface
Figure 2. Red light is reflected by a red surface and absorbed by a green surface.

You can use this information to build an electronic color-detecting circuit using a light-emitting diode (LED) and a photoresistor. An LED is a type of tiny light available in many different colors. A photoresistor is a special type of resistor. Resistors are electronic parts that resist the flow of electrical current (their resistance is measured in ohms [Ω]). A photoresistor's resistance depends on light—it has a high resistance in darkness and its resistance drops when exposed to light. When combined, a colored LED and a photoresistor can be used to differentiate between two different colors, as shown in Figure 3 (identifying any color requires multiple LEDs of different colors; see the variations section for more information). In this project, you will measure how a photoresistor's resistance changes when you illuminate different color surfaces with a red LED, and then use that information to build a circuit that can differentiate between red and green surfaces. Think of this as a first step toward building an automatic farming robot!

Reflected red light detected by a photoresistor
Figure 3. Schematic of how an LED and photoresistor can be used to detect the color of a surface by measuring reflected light. (Photoresistor and LED images credit Fritzing.org)

Terms and Concepts

  • Visible light
  • Electromagnetic spectrum
  • Wavelength
  • Reflect
  • Absorb
  • Transmit
  • Light emitting diode (LED)
  • Photoresistor
  • Resistor
  • Resistance
  • Ohms (Ω)
  • Potentiometer
  • Transistor

Questions

  • What are some different ways you can tell when fruits or vegetables are ripe?
  • What are some scenarios where it would be useful to have a machine tell if fruits or vegetables are ripe?
  • Does the resistance of a photoresistor go up or down when more light is shined on it?
  • If you shine a red light at a blue surface (similar to Figure 3), would the photoresistor's resistance be high or low?

Bibliography

Advanced students who want to learn more about circuits should read these references:

News Feed on This Topic

 
, ,
Note: A computerized matching algorithm suggests the above articles. It's not as smart as you are, and it may occasionally give humorous, ridiculous, or even annoying results! Learn more about the News Feed

Materials and Equipment

  • Assorted colored construction paper
  • Corrugated cardboard
  • Tape
  • Small cardboard box or large textbook
  • Red and green fruits or vegetables. If you have your own garden, you can grow your own and pick the fruits or vegetables at different times. Otherwise, you can go to a grocery store and purchase two different colors (for example, red and green tomatoes).
  • The following electronic components, available from Jameco Electronics:
  • Lab notebook

Disclaimer: Science Buddies occasionally provides information (such as part numbers, supplier names, and supplier weblinks) to assist our users in locating specialty items for individual projects. The information is provided solely as a convenience to our users. We do our best to make sure that part numbers and descriptions are accurate when first listed. However, since part numbers do change as items are obsoleted or improved, please send us an email if you run across any parts that are no longer available. We also do our best to make sure that any listed supplier provides prompt, courteous service. Science Buddies does participate in affiliate programs with Amazon.com, Carolina Biological, Jameco Electronics, and AquaPhoenix Education. Proceeds from the affiliate programs help support Science Buddies, a 501(c)(3) public charity. If you have any comments (positive or negative) related to purchases you've made for science fair projects from recommendations on our site, please let us know. Write to us at scibuddy@sciencebuddies.org.

Remember Your Display Board Supplies

ArtSkills sparkle letters

Holographic Poster Letters

ArtSkills buy now button
ArtSkills vinyl letters

Vinyl Letters & Numbers

ArtSkills buy now button
ArtSkills supplies trifold

ArtSkills Trifold with Header

ArtSkills buy now button

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.

Experimental Procedure

Build and Test Your Light-Measuring Circuit

  1. Assemble the circuit on your breadboard as shown in the slideshow (make sure you read the captions!) and Table 1.
    1. If you have never used a breadboard before, watch this video before you start building your circuit.
    2. Note that your jumper wire kit will come with a variety of colors. You do not need to use colors that match the diagram.
    3. Always connect the battery pack last when building a circuit. If you see or smell smoke, or any part of your circuit feels hot, immediately disconnect the battery pack. This means you have a short circuit and need to double-check your wiring.
blank breadboard 47 Ω resistor Clear red LED Photoresistor Jumper wire Jumper wire Jumper wire Multimeter dial Multimeter probe Multimeter probe Alligator clips Battery pack
Part Picture Notes
47 Ω resistor
47 Ω resistor
(+) bus to F13
Direction does not matter
Clear red LED
Clear red LED
Long leg to J13
Short leg to J15
Direction matters, your LED will not
light up if you get the two legs reversed!
Photoresistor
Photoresistor
J16 to J18
Direction does not matter
Jumper wire
blue jumper wire
(-) bus to F15
Color does not matter
Jumper wire
red jumper wire
One end to F16
Leave other end free
Color does not matter
Jumper wire
black jumper wire
One end to F18
Leave other end free
Color does not matter
Multimeter
DVM810 multimeter symbol
Insert black probe into COM port.
Use alligator clip to connect it to jumper wire from F18

Insert red probe into VΩMA port.
Use alligator clip to connect it to jumper wire from F16

Set dial to "20k"
3xAA battery pack
3xAA battery holder
Black wire to (-) bus (blue line on breadboard)
Red wire to (+) bus (red line on breadboard)
Table 1. Assembly instructions for the circuit. Image credits Fritzing.org.
  1. Set up the experiment as shown in Figure 4.
    1. Tape your breadboard to a piece of cardboard.
    2. Tape a cardboard box about 1 cm away from the edge of the breadboard. The exact distance does not matter, as long as it remains constant throughout your experiment.
    3. Bend the LED and photoresistor 90° to the side, so they both face the cardboard box.
    4. Cut a small piece of black construction paper and tape it around the edge of the photoresistor, so only the front face is exposed. This will help the photoresistor primarily measure reflected light, and not ambient light coming from other directions.
Experimental setup for color detection circuit
Figure 4. Experimental setup for the light-measuring circuit.
  1. Cut squares (roughly 6x6 cm) from black, white, red, blue, and green pieces of construction paper. Test that you can prop the squares of paper flat up against the cardboard box without them falling over. If necessary, you can use tape to hold them in place.
  2. Even with the black construction paper wrapped around it, the photoresistor is still sensitive to ambient light levels. It is important that you do the experiment in a room with constant ambient light levels. For example, avoid doing the experiment on a partially cloudy day in a room with lots of windows, as light levels may fluctuate when clouds pass in front of the sun.
  3. Create a data table like Table 2 in your lab notebook.
 Resistance (kΩ)
Paper Color Trial 1 Trial 2 Trial 3 Average
Black     
White      
Red      
Green      
Blue      
Table 2. Data table for recording resistance values.
  1. Double-check your circuit. Make sure the battery pack is on, the LED is on, and your multimeter is connected and set to measure resistance in the 20 kΩ range.
  2. Place a black square of construction paper against the box in front of the resistor and LED. Read the resistance from your multimeter and record it in your data table.
  3. Repeat step 7 for each of the other colors.
  4. Repeat steps 7–8 two more times, for a total of three trials with each color.
  5. Calculate an average resistance value for each color and make a bar graph of your results.
  6. Analyze your results.
    1. Do you see a large difference in resistance between any two colors?
    2. Do any colors have about the same resistance?
    3. Imagine that the resistance value was the only information you had available (you could not actually see the surface you were measuring). Could you identify the color of the surface from that value alone?

Build a Circuit to Differentiate Red and Green Produce

In this section, you will use the information you learned in the previous section to build a circuit that can differentiate between red and green produce. It will light a second LED when red produce is placed in front of it, and the LED will stay off when green produce is placed in front of it (Figure 5). You will need to make some adjustments to get the circuit working perfectly. See the technical note for a more detailed explanation of how the circuit works (you do not need to fully understand how the circuit works in order to complete the project).

Concept for LED color detection circuit
Figure 5. Concept for a color-detecting circuit to separate ripe (red) and unripe (green) produce.
Technical Note

Figure 6 shows the circuit diagram for this circuit. It uses several additional parts that you did not use in your first circuit. See the advanced section of the bibliography to learn more about these components.

  • A potentiometer is a type of variable resistor. Its resistance can be adjusted by twisting a knob. The potentiometer is used to adjust your circuit's sensitivity to light.
  • The potentiometer is combined with the photoresistor to form a voltage divider. A voltage divider uses two resistors to take an input voltage (V1 in Figure 6) and reduce (or "divide") it by a certain amount. The output voltage (V2) depends on the values of the two resistors. In this circuit, those resistances depend on how much light is hitting the photoresistor, and how you have adjusted the potentiometer knob respectively. When more light hits the photoresistor, the output voltage goes up.
  • The output of the voltage divider is sent to the input of a transistor. A transistor acts like a valve that can control the flow of electrical current through something else, like a motor, buzzer, or LED. In this circuit, when the input voltage to the transistor exceeds a certain threshold (which occurs when enough light is reflected back to the photoresistor), it will cause a second LED to turn on.
Schematic for color detection circuit
Figure 6. Schematic for the color-detector circuit. If you do not know what these symbols mean, see the "How to Read a Schematic" reference in the bibliography.
  1. Assemble your new circuit as shown in the slideshow (make sure you read the captions!) and Table 3. Disconnect the battery pack while you are building your new circuit, and reconnect it at the end.
Parts from the first circuit Jumper wire Jumper wire Jumper wire Jumper wire Jumper wire Transistor Diffused red LED 47 Ω resistor Potentiometer Battery pack
Part Picture Notes
Photoresistor
Photoresistor
J16 to J18
Direction does not matter
47 Ω resistor
47 Ω resistor
(+) bus to F13
Direction does not matter
Clear red LED
Clear red LED
Long leg to J13
Short leg to J15
Direction matters; your LED will not
light up if you get the two legs reversed!
Jumper wires (6 total)
blue jumper wire
(-) bus to F15
(+) bus to F16
(-) bus to A20
(-) bus to F27
E19 to F18
G18 to G25
Color does not matter
Transistor
transister mosfet
With writing facing to the left, pins in H25, H26, H27.
Direction matters!
Diffused red LED
Diffused red LED
Long leg to E16
Short leg to F16
Direction matters!
47 Ω resistor
47 Ω resistor
(+) bus to A26
Direction does not matter
Potentiometer
potentiometer symbol
Holes D23, D24, D25
3xAA battery pack
3xAA battery holder
Black wire to (-) bus (blue line on breadboard)
Red wire to (+) bus (red line on breadboard)
Table 3. Assembly instructions for the circuit. Image credits Fritzing.org.
  1. Now you will make some adjustments to get your circuit working properly. As described in the technical note, the diffused LED will turn on when the voltage V2 in the circuit exceeds a certain threshold. This voltage depends on two different factors:
    1. The resistance of the potentiometer, which you can adjust by turning the knob. This allows you to tune your circuit's sensitivity to light. The farther clockwise you turn the potentiometer, the more light is required to turn on the diffused LED.
    2. The resistance of the photoresistor, which gets lower when more light hits it. When the photoresistor's resistance is low enough, the diffused red LED will turn on. The exact amount of light hitting the photoresistor depends on many factors, such as:
      1. The distance to the surface being measured.
      2. The angle of the surface being measured (more light will be reflected back if the surface is perpendicular to light from the LED than if it is at a sharp angle).
      3. The relative position and orientation of the photoresistor and clear red LED.
      4. Ambient light levels in the room.
      5. How the photoresistor is shielded (for example, using black construction paper) from ambient light and direct (as opposed to reflected) light from the clear red LED.
  2. Your goal is to adjust the circuit such that the diffused red LED will only light up when you hold a piece of red produce in front of the clear red LED and photoresistor, but not when you use a piece of green produce, as shown in Figure 5. This lets you quickly identify whether a piece of produce is ripe just by looking at the LED. You can imagine how such a machine would be useful in a factory or farming setting to quickly and automatically identify, harvest, or sort ripe fruits and vegetables. Try adjusting some of the factors in the previous step to see if you can get the circuit to work to identify red and green produce. It may help to practice with squares of red and green construction paper first. How reliable is your circuit? Does it ever give a false positive (identify green produce as red) or a false negative (identify red produce as green)? See the variations section for more ideas about how to improve or modify your circuit.

Communicating Your Results: Start Planning Your Display Board

Create an award-winning display board with tips and design ideas from the experts at ArtSkills.
ArtSkills button poster gallery 350
ArtSkills button design tips 350
ArtSkills button for more tips 210 h

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.


Variations

  • Try this project with a different color LED. For example, use a super bright green LED (Jameco part #2077079, use with 68 Ω resistor, part #690582) or blue LED (Jameco part #183222, use with 47 Ω resistor, part #690540). Note that these LEDs have a higher forward voltage drop so you will need to replace the 120 Ω resistor in the circuit as noted. How do your results change if you use a different color LED?
  • Try testing your circuit on a broader range of colored surfaces (yellow, cyan, magenta, orange, pink, etcetera). What colors result in similar resistance values? What colors result in different resistance values? What colors can you use your circuit to clearly differentiate?
  • How do your results change with varying ambient light levels? Does the circuit work outside in direct sunlight? What about in a busy room where people walk by and cast shadows on the circuit? How realistic would it be to use the circuit in different settings, for example a setting with controlled lighting (inside a factory) versus an outdoor area like a field?
  • The circuit in this project is not designed to identify all possible colors. It is designed to differentiate between two known colors (meaning you assume you will only show the circuit red or green tomatoes, and that you will never show it a blue tomato). Can you design a circuit that can detect any color? Hint: your circuit will need three LEDs (the red LED from the materials list, and the blue and green LEDs listed in the first variation), or a single RGB LED (an LED with red, green, and blue LEDs all built in to the same packaging). This task may be much easier with a microcontroller such as the popular Arduino™. Search online for "Arduino color detector circuit" or "Arduino color sensor" and you will find many examples.
  • Can you accomplish color detection using a webcam and computer vision instead of a circuit? What are the advantages and disadvantages of each approach?
  • As discussed in the background, there are other ways that you can tell if produce is ripe, like size, firmness, or smell. Can you design a different circuit that uses one of these methods to detect ripe produce? A photoresistor is an example of an electronic sensor that measures light. There are a variety of other sensors available that can measure things like distance, pressure, or the presence of certain gases. Do some research on these sensors and determine which ones you could use.

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.

Ask an Expert

The Ask an Expert Forum is intended to be a place where students can go to find answers to science questions that they have been unable to find using other resources. If you have specific questions about your science fair project or science fair, our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

Ask an Expert

Related Links

If you like this project, you might enjoy exploring these related careers:

electrical engineer aligning laser

Electrical & Electronics Engineer

Just as a potter forms clay, or a steel worker molds molten steel, electrical and electronics engineers gather and shape electricity and use it to make products that transmit power or transmit information. Electrical and electronics engineers may specialize in one of the millions of products that make or use electricity, like cell phones, electric motors, microwaves, medical instruments, airline navigation system, or handheld games. Read more
Scientists inspecting special corn oil

Food Scientist or Technologist

There is a fraction of the world's population that doesn't have enough to eat or doesn't have access to food that is nutritionally rich. Food scientists or technologists work to find new sources of food that have the right nutrition levels and that are safe for human consumption. In fact, our nation's food supply depends on food scientists and technologists that test and develop foods that meet and exceed government food safety standards. If you are interested in combining biology, chemistry, and the knowledge that you are helping people, then a career as a food scientist or technologist could be a great choice for you! Read more
Agricultural technician evaluating a plant

Agricultural Technician

As the world's population grows larger, it is important to improve the quality and yield of food crops and animal food sources. Agricultural technicians work in the forefront of this very important research area by helping scientists conduct novel experiments. If you would like to combine technology with the desire to see things grow, then read further to learn more about this exciting career. Read more
Inspector examining turkeys

Agricultural Inspector

Who works to protect the public health from food-borne illnesses? Agricultural inspectors. Everyone needs to eat, and agricultural inspectors work to ensure the quality and safety of the food supply to determine if they are in compliance. They also inspect farms, businesses, and food-processing plants to determine if they are in compliance with government food regulations and laws. Read more

News Feed on This Topic

 
, ,
Note: A computerized matching algorithm suggests the above articles. It's not as smart as you are, and it may occasionally give humorous, ridiculous, or even annoying results! Learn more about the News Feed

Looking for more science fun?

Try one of our science activities for quick, anytime science explorations. The perfect thing to liven up a rainy day, school vacation, or moment of boredom.

Find an Activity