Shop OBEX P1 Docs P2 Docs Learn Events
Where's the Crab? (RFID?) — Parallax Forums

Where's the Crab? (RFID?)

John KauffmanJohn Kauffman Posts: 653
edited 2014-09-27 11:17 in Accessories
I will have an aquarium holding a crab. I would like to know the crab’s location in the tank (details below). Any suggestions on sensor/system to use? I’m pretty familiar with the sensors out there but am stymied on this one.

The best idea I have come up with is a matrix of RFID sensors on the floor of the tank and RFID glued on crab. But I’m worried that sensor detection is strong enough that all sensors will detect the crab no matter where it is. Is there a way to reduce sensitivity of the RFID detector? Cover with something like thin aluminum foil? Lift tank to be several inches above the matrix? Create a partitioned box for under the tank with one detector per compartment where the partitions block RF - designed like the dividers in a case of wine.

I also thought maybe some kind of color or florescence detectors placed at many locations in the tank and a colored panel glued to the crab.

Aquarium: 50cm cubed. Salt water. Glass walls.
Crab: about 10 cm across. May be several crabs but system for 1 crab is OK. No problem gluing devices to crab’s back.
Measurement: Location of crab. 3D would be great but 2D OK. Data every few seconds for 24 hours
Budget: (not including board) US$ <100

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2014-04-27 10:21
    I think RFID is going to be a problem underwater, since water conducts, it's going to create a weak Faraday cage around any RFID sensor.
  • John KauffmanJohn Kauffman Posts: 653
    edited 2014-04-27 11:10
    I was thinking I could place the sensors on a sheet below the floor of the tank (outside & dry). Would the glass induce the F. cage?
    Thanks Beau.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-27 11:22
    In my experience, the common RFID tags have to be almost right up against the reader for them to work. Here's mine and Dave's project of getting the Propeller to read from the inexpensive MFRC522 readers.

    I think Beau was concerned the water would form a F cage around the tag.

    What about some sort of machine vision? Use Hanno's technique and have a camera viewing the side of the tank and another camera looking either from the top of one of the other sides.

    Here's one of my photos I share whenever I think I can get away with it.

    attachment.php?attachmentid=80519&d=1303582009

    The LED array is displaying the "HI" as seen by the camera in the top left of the photo.

    If you could have the crabs contrast against the background well enough, the camera could probably pick them up. If you used the new Pixy (CMUcam 5), you could paint the various crabs different colors and have the Pixy help you track them.

    Phil's PropCam is other possible machine vision solution.
  • John KauffmanJohn Kauffman Posts: 653
    edited 2014-04-27 11:33
    Thanks, Duane
    I think I'll work on two tracks with the visual detection as as higher level. I've been meaning to try those techniques for some time.
  • John KauffmanJohn Kauffman Posts: 653
    edited 2014-04-27 11:37
    Another idea:
    Super magnet on bottom of crab then matrix of magnetic field detectors under floor of tank (dry). Both options below are cheap but for >16 would feed back to board via PISO shift register.

    Hall effect transistors
    DIY copper coils

    Any thoughts?
  • varnonvarnon Posts: 184
    edited 2014-04-27 12:55
    John,

    I would love to hear more background on this project. Why are you interested in this? At the moment, I use the Propeller exclusively to detect the behavior of animals in learning research. My laboratory currently specializes in invertebrates, so I get to design many Propeller-based devices to detect and affect invertebrate behavior. Academia can be pretty competitive, so I can't go into specific details about equipment until we publish a paper that uses that equipment, but after that I make everything as transparent as possible. At the moment our Propeller-based experiments are not published, but the first version of the system we use is published. If you are interested, you can see that here: http://www.amsciepub.com/doi/full/10.2466/07.08.IT.2.2

    IR beams are simple and work great. You could build an array of IR beams around the perimeter of the aquarium. Each beam in the array can pulse on momentarily to check if an object is in the path, then turn off so adjacent beams can pulse on. Depending on the spacing, you may be able to activate all beams at once. This method has the downside of only being able to track one object in a grid. If multiple crabs are present, or other objects are present, this method will not work.

    Machine vision seems like a good possibility. I have really been wanting to explore this myself for some projects.

    I think you need to be cautions about any system that puts the crab near electromagnetic fields. Invertebrates can be surprisingly sensitive to these fields. I am concerned that something like a magnet on the crab would be very disruptive to its behavior. I know, for example, another researcher that is able to train roaches to wave their antenna in front of a reflective IR sensor for food. Even though they smart enough to learn this, they still avoid a proximity to certain parts of the enclosure where circuitry is present on the other side of the enclosure wall. I believe this researcher had to spend considerable time redesigning the system so that the weak electromagnetic field from the circuitry did not prevent the roaches from coming to the feeder system. It appears some species strongly avoid electromagnetic fields, and this might be a possibility with the crabs, especially if you are intentionally generating strong magnetic fields.

    If you want to do something under the tank, you might also be able to use an array of photo-resistors. If there is no substrate in the tank, the crab could block the light coming from an overhead light as it passes over the photo-resistors. This would give you a similar grid-output as an LED array, but could work for multiple crabs - as long as the tank is empty.

    Also, what species of crab is it?

    Please keep us posted. This is very interesting to me.
  • John KauffmanJohn Kauffman Posts: 653
    edited 2014-04-27 16:12
    Varnon:

    Thanks for letting me know about the research you have done to date. Your thoughts and experiments have saved me many days of work. I'll be looking into each.

    The application is still theoretical. I was thinking through if it would be an appropriate project for late teen biologists that are studying laboratory applications of microcontrollers (Prop Activity Board). I will keep posting if I work on proof of concept.

    Regarding EMF fields, I had heard of that but then forgotten. For starters would be interesting to observe behavior of crab with super magnet and with control piece of non-mag steel.
    =============
    In paras 2-3 of the paper you present the benefits of keeping research in an applied mode rather than simulations. I would add another reason. Students should develop basic skills in building simple instruments for their specialty. An ornithologist should know enough about woodworking tools to build birdhouses. For biology, where larger sample sizes are generally better, being to automate a process can bring more repetitions within the budget.
  • John KauffmanJohn Kauffman Posts: 653
    edited 2014-04-27 19:51
    Varnon:

    Do you have any references to prior work on Ir in this application? I have used emitter/detector for BoeBot looking at distance to walls. Time for some experimenting.

    Questions in my mind include:
    Works through glass tank walls?
    Works through water?
    How focused can a beam be - 10 cm^2?
    What would be experience with false neg and positives?

    The emittor/detector on BoeBot provides 0/1 output. Are there analog types?

    Much Thanks, John.
  • varnonvarnon Posts: 184
    edited 2014-04-27 23:10
    In paras 2-3 of the paper you present the benefits of keeping research in an applied mode rather than simulations. I would add another reason. Students should develop basic skills in building simple instruments for their specialty. An ornithologist should know enough about woodworking tools to build birdhouses. For biology, where larger sample sizes are generally better, being to automate a process can bring more repetitions within the budget.

    I completely agree! Having the skills to build equipment creates many opportunities. There are so many things you create yourself for much lower prices, and so many things you can create that cannot be purchased. The referenced paper was more on teaching exercises. I am working on another more technical paper geared toward research applications. It will be a while, but I will post something about it when it is published. I also have a thread on the topic that I will update as more things are released: http://forums.parallax.com/showthread.php/147821-Using-the-Propeller-for-Behavioral-Research-The-Propeller-Experiment-Controller
    Varnon:
    Do you have any references to prior work on Ir in this application? I have used emitter/detector for BoeBot looking at distance to walls. Time for some experimenting.

    Much Thanks, John.

    No perfected aquatic uses of IR yet. And so far I haven't published anything that uses the Propeller for an IR system.

    In the paper: Aversive conditioning in honey bees (Apis mellifera anatolica): A comparison of drones and workers, we used IR beams to detect the movement of honey bees in a small "shuttle box" apparatus. This apparatus used an older device from a few decades ago. I had yet to finish the software to use the Propeller for experiments. Some of the circuitry was more elaborate than needed. See the paper (attached) if you are interested in details.

    The short version is that bees were placed in narrow shuttle boxes about 14 cm long. There was enough room for the bees to turn around, but they were mostly restricted to walking on one axis. Under the shuttle box was a shock grid, and underneath that was a computer monitor. The bees could learn to avoid shock by moving to one side of the shuttle box, sometimes shock was associated with colors on the computer monitor. To record the location of the bees we used two IR beams at the center of the shuttle box positioned about 2 cm apart. The IR beams were made from a side-looking IR LED and side-looking IR transistor (512-QEE113, 512-QSE113). By recording which IR beam was broken and in what order the beams were broken, we could determine what side of the shuttle box the bees were on. Unfortunately, it was difficult to line up the parts precisely, and the beams could affect each other easily. In the end, we found that the orientation of one LED–transistor pair needed to be reversed with respect to the other pair in each shuttle box so that light from the LED in one pair would not inadvertently affect the other pair’s IR transistor. When the apparatus was complete another student that worked on the apparatus took it to Turkey for research and found there was too much IR in the room lights for the beams to work. I am told he got the apparatus working at the very last minute.

    We also previously used another apparatus to study foraging behavior in wild honey bees. The bees fly from the hive to the apparatus, enter a small hole, pass an IR beam (same parts I think) and then receive a drop of sucrose solution from a syringe pump. Then the bees can learn other things like backing out and triggering the IR beam several times before they are provided with sucrose. We can also see how things like alcohol and pesticides affect their performance. This apparatus has many of the same problems. It is very sensitive to ambient light and the parts must be lined up very precisely. Paper also attached if you want more details.

    After messing these apparatuses and other parts in other projects, I have decided that modulated IR beams are the way to go. Parallax's parts work great:
    http://parallax.com/product/350-00017http://parallax.com/product/350-00014
    Same parts on the BOE bot I think.

    I am impressed how well a beam made from these parts works in full direct sunlight. I cannot find any errors in detection. They also work well to make a reflective IR sensor. I am now using these parts to create much better versions of the previous apparatuses.

    My software for input event detection also makes these a little easier to use. Input events are broken down into four states: onset (just activated), on (continuing activation), offset (just deactivated) and off (continuing deactivation). This makes it very easy to record data and implement consequences. I don't know of another system that does this. It isn't needed for everyone but it is crucial for my work.The software also has an adjustable debounce for inputs. I turn up the debounce for IR beams from the default 25 ms to about 50 ms. I think adding these features in software really increases the robustness of signal detection with these parts. My software isn't in the obex yet, but you can get it from my website (cavarnon.com) or from the first paper I posted earlier. I think there are some good simple debounce objects in the obex too.

    With modulated IR systems, the only problem I have is when something is right on the edge of a beam, but increasing the debounce time eliminates this problem.

    I have done some testing of modulated IR systems in aquariums.

    Pololu carries some really cool digital Sharp IR sensors: http://www.pololu.com/product/1134
    The range of this reflective sensor is reduced through water and glass, but they can still be used for some purposes. See a test here: https://www.youtube.com/watch?v=76l2uSkdriM
    For this project, I really only wanted to detect animals when they were adjacent to the sensor, so a reduction in detection range through class and water was not an issue.

    I imagine an IR beam made from Parallax's parts could likely span the length of most aquariums. The beams work for me through air at 43 inches. I didn't have enough cables to test further distances. Glass and water may interfere, but I don't think they will remove function completely. The water needs to be clean though.

    How focused can a beam be - 10 cm^2?

    It really depends. Parallax's modulated IR parts are very forgiving about angle and alignment, so I imagine the IR light fans out quite a bit from the LED. But if you want a narrow beam, just shine the IR LED through a very small hole, and only let light to the receiver from an equally small hole. I have been able to detect beam breaks from things as small as a single strand of wire inside a 22 gauge stranded wire cable.
    The emittor/detector on BoeBot provides 0/1 output. Are there analog types?

    I would imagine so, but I have not looked into them. My optics detection has been limited to digital IR beams, digital reflective IR sensors, and analog photoresistors (not restricted to IR), and Sharp's analog IR distance sensors.

  • ercoerco Posts: 20,255
    edited 2014-04-27 23:37
    Tracking a slow moving crab sounds like a fun project. If painting the shell is OK (sounds better/safer/more reliable than gluing RFID on) then either:

    1) Paint the shell a bright contrasting color and track via a camera and blob tracking (such as RoboRealm), or

    2) Attach a retroreflective sticker and track with IR. I posted here about a special IR sensor which when used with a laser can detect a reflective target 10 feet away. You wouldn't want to laser your poor crab, but you could probably get a foot or better using a focused IR LED beam. You could XY scan for the crab by moving the IR source & sensor with two servos in an overhead pan & tilt arrangement. Again, not too daunting with a slow-moving crab.
  • John KauffmanJohn Kauffman Posts: 653
    edited 2014-04-28 05:30
    Erco:
    It had not occured to me to sweep one sensor rather than set up a matrix of sensors. Thanks. That also led me to another thought. By making the tank long and thin it could almost be changed into a 1D system for a first go.

    Varnon:
    Thanks for so many references and your experience with them.

    Overall:
    - It looks like this could be developed into a project for late teens with some uCon experience. In fact, it looks like a project that could be assigned to different groups with different implementations.
    - Ir should work.
    - A video image system should work at the next level up.
    - Once done, a second project can look at changes in behavior in EM fields.
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2014-04-28 08:08
    "Where's the crab?" is a tantalizing title.

    Would the subject crabs stay mostly on the floor, or do they also climb the walls and will you find them swimming(?) in the middle of the volume? I have no idea.

    I thought of some kind of sonar, either a sonar tag on the crab with 3 microphones, or a kind of ultrasound imaging. But it feels expensive and too high tech.

    If there could be discrete hiding places within the tank, the question could reduced, which house if any is it in, or on? Who's on third base? The houses could even be platforms that close a mechanical switch from the weight.
  • John KauffmanJohn Kauffman Posts: 653
    edited 2014-04-28 08:44
    Tracy: thanks for your interest, your SIC on sensors is great.

    I am thinking through possibilities for a cumulative project for teens interested in marine biology. I thought this might be a step up from recording differences in microclimates.

    I actually don't know much about crabs other than they look like a good model for this study. For this level of student, I like the idea of several specific locations rather than sensing the entire range of the tank.
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2014-04-28 09:43
    I once helped a colleague with an study to test visits of kangaroo rats to pans of food (grain). The pans were on crude weighing scales made with FSRs, three in parallel in a triangle under the pan, feeding ADCs connected to a computer, at the time a TRS80 model 100.

    It seems like you could do a lot here with a photoreflective sensors, or with simple DIY bump switches. I agree that biology students might find this very interesting, especially if they can play with the environment, or micro-habitat and microclimate within the tank.

    How about crowd sourcing the observations? They set it up with a webcam or two and build a site where people from around the world can see and check, Where's Crawldo?
  • RforbesRforbes Posts: 281
    edited 2014-04-28 12:43
    Where's crawldo ???

    OMG you ain't right in the head... LOL blahaha!!
  • varnonvarnon Posts: 184
    edited 2014-04-28 14:01
    Where's Crawldo?
    Ha ha, this is the best thing I have heard all day!
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2014-04-28 15:14
    Varnon, we intersect paths! Looking at the Solowoski&Abramson paper, I see where it references Waddington et. al. 1981. I'm one of the et. al. along with our professor and mentor Bernd Heinrich. "Floral preferences of Bumblebees (Bombus edwardsii) in relation to intermittent versus continuous rewards". I'd made a gadget out of stepper motors salvaged from printers, to drive a lead screw, to deliver nectar solution from syringes.
  • varnonvarnon Posts: 184
    edited 2014-04-28 19:48
    Very cool! I have that paper too. How surprising to encounter someone on the forms here! A lot of what I am doing now is recreating some of those older invertebrate apparatuses to be used with my system on the Propeller. It is a bit of reinventing the wheel, but I think you can see how it can be useful to have experimental equipment based on the Propeller. We might have more path intersections in the future, if we don't already.
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2014-04-29 08:12
    Things would have been so much easier with a Propeller, or BASIC Stamp. We did have an 8080 board around that time, and a Heathkit H8 box, but I recall that the apparatus for the bee experiment was mostly a board full of discrete CMOS logic, counters and gates and a 555 for the timing to deliver either small or large rewards. I do remember I blew out a few transistors driving the stepper motors before I beefed them up and learned by experience of magic smoke about the catch diodes.

    What will the crabs eat?
  • varnonvarnon Posts: 184
    edited 2014-09-13 20:50
    Kind of curious what happened with project "Where's Crawldo?"
    Also I thought of another thing you might could try. If you have decent lighting, I bet you could paint a bit of the crab with a colored dot and use a Pixy to track one or multiple crabs. I'm sure there are better solutions, but so far I have found the Pixy to be convenient for some tasks. (One of my turtles still has bits of blue painters tape on her shell from my tests last week.) It may not be great, but the Pixy might be a good enough solution especially as you could potentially track multiple crabs with no change in hardware.
  • John KauffmanJohn Kauffman Posts: 653
    edited 2014-09-14 19:13
    Interesting you posted now. Last weekend I was meeting with the people that might be interested in this. We decided to start with something along the lines of understanding the basics of a microcontroller and sensors like temp and light plus show to record to SD card. Then a second section would be the lab applications. All of it would come in next summer.
    I'm assuming pixy is like CMU cam (I'll look it up next). For CMU, I understand, you input an RGB value then get back x,y for position in camera field that has most intense reflection of that RGB.
    Like you said, it would be great to track multiple individuals with one solution.
  • ercoerco Posts: 20,255
    edited 2014-09-27 11:17
    erco wrote: »
    2) Attach a retroreflective sticker and track with IR. I posted here about a special IR sensor which when used with a laser can detect a reflective target 10 feet away. You wouldn't want to laser your poor crab, but you could probably get a foot or better using a focused IR LED beam. You could XY scan for the crab by moving the IR source & sensor with two servos in an overhead pan & tilt arrangement. Again, not too daunting with a slow-moving crab.

    John: Here's that concept executed with the laser that would not be appropriate for an animal, but again, such a system would work with harmless IR too. I'll get around to that eventually. :)

    http://forums.parallax.com/showthread.php/157586-Laser-Tracker-Pan-amp-Tilt

    Here's an IR-based sensor demo: http://forums.parallax.com/showthread.php/157415-Laser-Free-Reflector-Sensor-Uses-IR

    PS: I credit this thread with planting the seeds for both of these projects in may head.
Sign In or Register to comment.