Introduction: Food Detector

So, i was just bored and was browsing Arduino Project Ideas page, and saw something odd and fascinating: it said something like Food Detector: By Measuring Resistances) and there was a link too. Click the link lol, and see how it blew my mind, sadly there was no tutorial on how to do it. But when you scroll down, deep inside there is a picture of guy plugging ammeter into cucumber, i was like haha i can do that. So here it is, super simple, you just need Arduino and 10k resistor, taaadaa. If you would like to add a LCD screen (mine came with SparkFun Inventor Kit) so go on.

Step 1: Setup

You would need:

  • Arduino UNO R3 or any thing that has a computer brain.
  • 10k Ohm Resistor
  • Wires

As shown in the picture, do that.

Step 2: Cooooooode !! -ing Time

Okay so here is the idea. So by now you've must guessed it like oh, different foods have differents resistances so thats almost. Just put it into IF and ELSE loop, tadaaa !!

So here is the breakdown for you:

  • Check resistance range of different ffoods using Serial Output.
  • Use those resistances to make create a range.
  • Serial Output the food name

The code below will cut down your time, but do it yo self, so you can learn.

NOTE: The Resistances below are not gonna be similar to the fruits i used, so use your own lol.

CODE STARTS HEEEREE:

const int frootSense = 0;

int frootResistance, high = 0, low = 1023;

int frootDetect;

#include <LiquidCrystal.h> //remove this if u don't have LCD, anyways it wont affect.

LiquidCrystal lcd(12,11,5,4,3,2); //remove this if u don't have LCD, anyways it wont affect.

void setup(){

Serial.begin(9600);

lcd.begin(16, 2); //remove this if u don't have LCD, anyways it wont affect.

lcd.clear(); //remove this if u don't have LCD, anyways it wont affect.

}

void loop()

{

lcd.clear(); //remove this if u don't have LCD, anyways it wont affect.

lcd.setCursor(0,0); //remove this if u don't have LCD, anyways it wont affect.

lcd.print("Food Detect:"); //remove this if u don't have LCD, anyways it wont affect.

lcd.setCursor(0,1); //remove this if u don't have LCD, anyways it wont affect.

frootResistance = analogRead(frootSense);

Serial.print("Resistance:");

Serial.print(frootResistance);

Serial.print("\n");

if (frootResistance>400 & frootResistance<700){

Serial.print("Cucumber \n");

lcd.print("Cucumber"); //remove this if u don't have LCD, anyways it wont affect.

}

else if(frootResistance>140 & frootResistance<300){

Serial.print("Apple");

lcd.print("Apple"); //remove this if u don't have LCD, anyways it wont affect.

}

else {

Serial.print("No Food \n");

lcd.print("No Food"); //remove this if u don't have LCD, anyways it wont affect.

}

delay(1000);

}

Step 3: Bye !!

Well it was that simple, and this is my first instructable :P Anyways, i don't take credit for this as i said i was just bored and accidently (jk) clicked that link and it clicked in my mind FOOD HAVE RESISTANCES TOO.

HEADS UP:

I was trying to get resistance values for cut open apple, but they kept changing abnormally from time to time. Maaaybbbeeee cuz the chemical changes inside the apple due to the air was changing the resistances. Experiment and lemme know which food works the best. Cucumber and Strawberry work great tho'.

Comments

author
oguzt (author)2017-04-02

I want to read on the screen the voice on the android mobile phone. Is it possible?

thnak you.

author
oguzt (author)2017-01-18

What kind of wire do you touch the apple in the video? Where's the wire? How did you connect?can you help me. please.

thank you.

author
Goolien (author)oguzt2017-01-19

its the normal jumper wire, or just use any piece of wire laying around. The diagram shows the wire is connected to a metal piece. The diagram illustrates the same schematic shown in the video.

author
krithiga narayanan (author)2016-07-28

How could I find the resistance of other food? pls help me

author

write in your program this ((( Serial.print ("Resistance:");

Serial.print(frootResistance);

Serial.print("\n"); ))) then just try to put the probe into any kind of food and then open the serial monitor and read what is the resistance and don't forget to put the Serial.begin(9600) IN the voidsetup
and read the last note in the last step

author
tomatoskins (author)2015-04-01

That is an interesting concept. Thanks for sharing your results. Its a great first instructable!

About This Instructable

3,290views

11favorites

License:

Bio: I shower naked.
More by Goolien:Food Detector
Add instructable to: