The DFRobot Beetle is one the latest innovations in minimalistic Arduino technology. About the size of a quarter, and the capabilities of an Arduino Leonardo, this tiny guy can minimize your projects with ease without having to sacrifice functionality.
After working with the Beetle, I am going to show you some tips and necessary tricks I learned to get this little device working properly over a Bluetooth HC-06 module.
Step 1: About the Beetle
The Beetle is sold by DFRobot for about $8 (http://www.dfrobot.com/index.php?route=product/product&product_id=1075) and gets cheaper the more you purchase. Programmable through micro USB, the Beetle is very easy to use and functions just like an Arduino Leonardo.
The website has all the details about the product itself, so I will focus solely on how to get this thing wireless through Bluetooth.
Step 2: Power
The Beetle specs says it requires 5 volts to operate, but it can also function at 3.7V. This is handy, because most LiPo batteries operate at 3.7V and are sold at most hobby stores. I used Tenergy because I have a bunch for quadcopters, but really any 3.7V source should do; however, do not exceed 5 volts to avoid risk of frying the surface components.
Unfortunately, the Beetle doesn't have a way to plug in a battery directly unless you decide to solder on a female connector or supply power through the micro USB port. But, there are power terminals which we'll see in the next step.
Step 3: Where to Supply Power
The Beetle has two terminals where you can supply power. On either end there are two plus and minus (hot and ground) terminals that can be used to supply power. The pictures above show the Beetle turning on with the battery.
Note: The LED will blink blue when the device is on until you upload a new code to the Beetle, then it will not turn on anymore unless you write digital 13 high.
Important Note: Don't mix up your hot and ground when wiring, your Beetle will get very hot and possibly melt components!
Step 4: Bluetooth HC-06
One of my favorite and easy to use Bluetooth modules is the HC-06. This module uses TTL serial communication over a virtual COM port to stream data to the computer from the Beetle.
The great thing about this module is that it can also be powered with the same 3.7V LiPo battery by hooking it up in parrelel with the Beetle circuit.
Another great thing about this module is that it is cheaply priced, about $5. Many websites sell them, but here is an example ( http://gearbest.com/sensors/pp_241478.html?currency=USD&gclid=COKyiaqNnswCFQwxaQod15UFRA)
Note: The default pairing code for these modules is 1234.
Step 5: Powering Beetle and Bluetooth
By using the unused terminals on the Beetle, you can power the Bluetooth module by wiring the Bluetooth Vcc lead to plus, and ground to ground.
Under the Beetle, as seen in step 1, there are soldering spots for RX and TX output. The RX lead of your Bluetooth will attach to the TX lead of your Beetle, and the TX of the Bluetooth will attach to the RX of the Beetle.
When the Bluetooth module is powered on, you will want to pair it with your computer by opening up your Bluetooth settings and selecting pair with HC-06 and entering the pair code 1234. This will create a virtual COM port and allow communication to and from the device.
Step 6: Uploading Your Code
This part took me a while to figure out.
In order for the RX and TX ports to work properly on the Beetle, you'll need to bring up the internal resistance of pin 0 (the RX line). To do this, you'll use:
and just to be on the safe side, I dedicated channel 1 (TX) as an output:
After a bit more searching, I also found out that Arduino Leonardo uses Serial1 instead of Serial. This is important to get the Bluetooth working properly. If you are streaming serial data over a USB line, just use Serial command. Otherwise the HC-06 needs Serial1 when using the Beetle. Use this anywhere you'd use Serial, including Serial.println.
So I have the Beetle programmed to read the analog 0 channel and print the results. The code in the picture is all that is needed to do that, but please feel free to modify it in any way that seems fit.
Plug in your micro USB to the Beetle and select Arduino Leonardo from your board type and port on the Arduino IDE. Don't try and upload code via Bluetooth - it will not work. You must plug in your Beetle when uploading or changing code.
Step 7: Final Results
It isn't pretty, but this little project is something I am playing around with, and it is smaller than a pack of Juicy Fruit. Thumping the piezoelectric plate will read a voltage, and send that response wirelessly via Bluetooth to my Bluetooth enabled computer where I can plot it via serial plotter or LabVIEW. Added a switch to save battery power.
Note: Yes, you can pair multiple HC-06's and Beetles to your Bluetooth enabled computer and make multiple Beetle sensors. I've made three so far and each of them independently report data to the computer through three COM ports. You'll want to make sure you select the appropriate COM ports on the Arduino IDE to display your Bluetooth data (this is not the port labeled Arduino Leonardo.) Check device manager to locate the correct incoming and outgoing COM ports for your Bluetooth device.
This Beetle could be used as one of the smallest data acquisition devices, motion alarms, wireless monitoring of soil moisture and temperature, or even control some LEDs for a wearable project that's smaller than the Arduino Lilypad. The only limitation is your imagination.
This is my first Instructable, and I wanted to share this information because it would have been a lot of help to me a while back and I hope it can help someone else minimize their projects easily without wasting time scratching their heads.
Questions and comments are greatly appreciated!