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


  1. Arduino Micro $20
  2. 12V A23 battery $2
  3. A23 battery holder (or some aluminum to make your own)
  4. Pin connector
  5. Thin wire (I got mine out of some stranded wire) $1
  6. Super glue(cyanoacrylate) $2.48
  7. Your choice of non-toxic glue 90 cents
  8. Sandpaper
  9. Small washers


  1. Madagascar Hissing Cockroaches (⚠ Before you buy, check your country and states regulations ⚠)
  2. Large fish tank
  3. Small fish tank
  4. Bananas, apples and dog food (feed the cockroaches this everyday with a wet paper towel)
  5. Egg cartons (use these as hiding spots for the cockroaches)
  6. Cut up paper (use this as bedding in the terrariums)
  7. 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.


  1. Soldering iron
  2. Straight pin
  3. Hot glue gun
  4. Scissors
  5. Box cutter
  6. 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 direction

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!

<p>you might have noticed I entered this project in a few contests so if you like it just hit that vote button and select the contests! </p>
<p>Wow..! i did hate roaches, but from now i look at them as living Arduino shields !! xD</p>
<p>Its hard for me to order Madagascar Hissing Cockroaches in my country. Can we use other types of cockroaches? Can the ones I find in the corner of my house work too?</p>
<p>they should work but they need to be big enough for the backpack to fit on</p>
Why do you have to be mean to such a innocent creature!?!
<p>In case you didn't notice - it is a COCKROACH, not a baby panda.</p><p>Also, they're not exactly an endangered species...</p>
<p>Neither are humans an endangered species. Maybe you should try it on a human next time. I like your logic.</p>
<p>Hey, maybe he should.</p><p>Except, you know... </p><p>...it's illegal.</p>
<p>Neither are people, does that mean we should be cruel to people?</p>
<p>Have you ever thoughtlessly eaten an innocent animal? killed spider? Yeah, me too. This doesn't seem so bad. Also it is probably far more complicated to test it on humans.. That being said if you volanteer - I would be happy to give it a go.</p>
<p>Have you considered using an ATtiny for this project? That is a large roach and seems to be able to carry pretty heavy loads, but if you could follow these instructions from MIT's High-Low Tech page and use your code on a tiny, it might make it easier on your little friend. <br><br><a href="http://highlowtech.org/?p=1695" rel="nofollow">http://highlowtech.org/?p=1695</a></p>
<p>thanks but I'm not familiar with the ATtiny. On the page you linked to in the list of working functions it doesn't say that the tone() function works. Also, if a hissing cockroach were a person it would be able to lift thousands of pounds.</p><p>thanks for the comment!</p>
<p>In the movie &quot;5th element&quot; there is a thing like that</p><p>(a spy roach)</p>
<p>i love it!</p>
I think step four is wrong, as it has the same discription as step three. or could the problem be with my device
<p>fixed that thanks!</p>
Very cool!
<p>You need to extend your bio: ... and insects xD</p><p>Next you need to spend some time in creating smaller circuits (or you need to buy bigger cockroaches....).</p><p>Very interesting!</p>
This is awesome. Try it on a human next!
This is just so erong but so dam awsome i cant decide.Were on flipong earth did you buy those things.

About This Instructable




Bio: A 14 yr-old that loves welding, chiseling, sawing, cutting, hammering and all kinds of making
More by bravoechonovember1:How to Build a Wood and Leather Water Ski Pickle Lamp Cutting Steel With a Welder! 
Add instructable to: