Project tutorial

Control a Cockroach with Arduino for under $30 © CC BY-NC-SA

Ever wanted to control a cockroach on the cheap? Now you can!

  • 11,704 views
  • 7 comments
  • 29 respects

Components and supplies

About this project

A few years ago I saw Backyard Brains' smartphone controlled cockroach, and it just blew my mind! I tried to get my mom to let me buy it, but the mention of cockroaches convinced her otherwise. :) I started doing projects with the Arduino a few years later. I remembered how much I wanted to do the cockroach experiment, so I convinced her that cockroaches weren't gross at all. Then I ordered a couple of Madagascar Hissing Cockroaches. Once they arrived, I started coding, testing, recoding, retesting. Finally I found out how to do everything right and temporarily change the cockroach's behavior as you will see in this video:

This is not a toy it is a scientific experiment to teach neuroscience. It is similar to someone getting a cochlear implant (which has returned hearing to more than 324,000 people.) Cockroaches can regenerate lost antennae and limbs. The cockroaches in this project were fully anesthetized during the “surgery.” Everything I did is reversible and was reversed at the end of the experiment. Also, I used Cyanoacrylate (super glue) in this project but it isn’t harmful because a similar chemical was used in the Vietnam War to seal wounds on humans.

Step 1: How it Works

How does it work you ask? Well as do many insects, cockroaches have antennae which are directly involved in navigation. By stimulating the antennae with variable frequencies (that mimic neural signals) from the Arduino you can make the cockroach think that there is a wall in front of it when there isn't. When that happens the cockroach turns in another direction. Although after a while the cockroach starts ignoring the stimulus and continues walking as if it didn’t have the backpack.

Step 2: Materials

Parts:

  • Arduino Micro or MKR 1000  $20
  • 12V A23 battery or coin cell if you are using a MKR 1000   $2
  • A23 battery holder or coin cell holder (or some aluminum to make your own)
  • Pin connector
  • Thin wire (I got mine out of some stranded wire) $1
  • Super glue(cyanoacrylate) $2.48
  • Your choice of non-toxic glue 90 cents
  • Sandpaper
  • Small washers

Cockroaches:

  • Madagascar Hissing Cockroaches (⚠ Before you buy, check your country and states regulations ⚠)
  • Large fish tank
  • Small fish tank
  • Bananas, apples and dog food (feed the cockroaches this everyday with a wet paper towel)
  • Egg cartons (use these as hiding spots for the cockroaches)
  • Cut up paper (use this as bedding in the terrariums)
  • heat pad

Make sure to check your country and states regulations on cockroaches. Always keep their cage shut and with a thick layer of petroleum jelly around the top. NEVER leave cockroaches unattended out side of their terrarium and NEVER EVER release cockroaches into nature where ever you live.

Tools:

  • Soldering iron
  • Straight pin
  • Hot glue gun
  • Scissors
  • Box cutter
  • Lighter or matches (for burning super glue off if a wire comes out)

Step 3: Build the Backpack

The first step is making the “backpack.” Using some sheet aluminum cut out a 3in x 2in “+” shape. Then bend the edges up (see pictures.) If they break off try cutting against the grain of the aluminum. After that, wrap electrical tape around one of the ends. Next, drill a small hole on one of the ends toward the middle, and insert the wire through. Then solder one of the ends to a small washer. Do the same to the other side. Once you are done with that, solder a pin connector to the wires you just installed, and put electrical tape on the solder joints. Next, hot glue a bigger pin connector to one of the sides of the "backpack," solder an approximately 1 inch long wire from the stranded wire to one of the pins, and do the same with the other pin. Also, if you want to test it put an A23 battery into the holder and put the pin connector into the Arduino Micro's VIN and GND pins. If it lights up you did it right. If not you might need to bend the battery pack so it touches the A23 battery.

Step 4: Antennae Procedure

Take a cockroach and gently put it in a cup of ice water(this anesthetizes the cockroach) for approximately 2 minutes or until there is little or no reaction to movement. After that lay the cockroach on your paper towel and lightly sand the top of the cockroach's thorax (this is a nerve-less substance much like your finger nails and hair) then with your non-toxic glue, glue the backpack to the sanded area. Next, trim the antennae down to about 2-3 cm. After that, lightly insert the wire about 1/4 cm into one of the trimmed antenna (which is hollow) then apply some of the super glue onto the wire and push it another 1/4 cm into the antenna, do the same with the other antenna. Almost there! Before continuing make sure the cockroach is still fully anesthetized, if not put him gently back into the ice water. Carefully insert the straight pin into the side of the cockroach's thorax. Next, insert the ground wire 1/4 cm into the small perforation you just made, and apply a small amount of super glue onto the wire and insert it another 1/4 into the hole. Make sure the wires are away from his legs because they can pull the wires out! When you are done let him recover overnight in a separate terrarium. Once you've done the surgery a couple of times it gets easier. Also, remember to clean off the table and dispose of the ice water to keep your mom happy.

Step 5: Code

The code is simple and easy to modify. If you try to rewrite the code remember to use noTone(your pin# here) after every time you use the tone function. Also, Arduino uses milliseconds so 1 second equals 1000 milliseconds. If you want to stimulate the other antenna simply change 11 to 12.

/* void setup() {void loop() {  tone(11,random(1,100),random(1,1000)); //this will make the cockroach turn in one directionnoTone(11)}

Step 6: Try it Out!

Once you've uploaded the code to the Arduino, take the cockroach with the backpack out of its terrarium, insert an A23 battery into the backpack, put the pin connectors into the Arduino and watch the cockroach turn! If you suspect it isn't properly grounded get out a voltmeter and set it on ohms. Put a lead on the antenna wire and one on the ground wire, if it reads anything above 1 ohm you've done it right, if it reads below 1 the antenna wire and the ground wire are touching, and if it reads “out of range” it isn’t grounded properly so you will need to redo the procedure for the ground wire. Once you are done with this experiment, remember to gently remove the backpack and cut the wires off. Another tip, when testing it out make sure to do it in a room where the lighting is generally the same because the cockroaches sometimes turn in darkened areas.

A special thanks to my mom who put up with having live cockroaches in the house and to my dad for providing help with the project. Thanks for reading!

Code

Code snippet #1Arduino
/* void setup() {

void loop() {

  tone(11,random(1,100),random(1,1000)); //this will make the cockroach turn in one direction
noTone(11)
}

Comments

Similar projects you might like

Arduino Bluetooth Basic Tutorial

by Mayoogh Girish

  • 454,894 views
  • 42 comments
  • 239 respects

Home Automation Using Raspberry Pi 2 And Windows 10 IoT

Project tutorial by Anurag S. Vasanwala

  • 285,569 views
  • 95 comments
  • 672 respects

Security Access Using RFID Reader

by Aritro Mukherjee

  • 229,462 views
  • 38 comments
  • 237 respects

OpenCat

Project in progress by Team Petoi

  • 196,047 views
  • 154 comments
  • 1,363 respects
Add projectSign up / Login