Skip to content

DIY Tutorial

Michal edited this page Mar 29, 2019 · 22 revisions

The tutorial presents the whole process in detailed way but only for the bluetooth version. This page shows some additional info about making wifi based version. You may also want to see the documentation of the PCBs I designed:
JDY-10 (BLE) based device
JDY-08 (BLE) based device
Esp-12F (Wifi) based device
These devices are smaller and look better than the end product of this tutorial but require more equipment and effort. There is no step by step guide for making these but all the necessary resources are there.

List of contents:


Prerequisites

  • Arduino Pro Micro 5V 16Mhz

(8Mhz version would get damaged without additional plugin. Take a look at product description for "Supported under Arduino IDE v1.0.2" which means that the device may not work without reflashing. Pick those with v1.05 support instead. I personally recommend this seller, gives outstanding support and has good knowledge about these devices.)

  • bluetooth module HC-06
  • 2K Ohm resistor
  • 4.7K Ohm resistor (tested and working with 5.1k too)
  • USB OTG adapter + optionally USB type A connector
  • solid core wire
  • soldering equipment
  • hot glue gun
  • heatshrink

Hardware setup

This video presents most of the steps below.

  1. Make sure to have all prerequisites.
  2. Desolder and remove pins from the bluetooth module. It may be difficult to desolder them all at once, I used pliers to make the metal pins straight and did gentle rotational movements to destroy the black plastic which holds them together and removed them separately.

It's a good idea to get rid of the solder inside the pins so it's possible to put the cables through the pins before soldering. It makes the soldering much easier. This video shows how I do it.

  1. Hot glue the Arduino and bluetooth boards together (chips pointing outwards)

Practice makes perfect but the point is to put enough hot glue for a firm connection but not enough to reach and block the pins. After some practice I put less of the hot glue and press the 2 parts harder, this way the device is a bit thinner than the first prototypes. I'd recommend to practice the movement of connecting the 2 boards without actually using glue.

  1. Cut a 6cm piece of wire, cut 1 "leg" of each resistor (2k and 4.7k) and create voltage divider by soldering all 3 together.

Heatshrink could be used to cover the bare metal parts.

  1. Cut wire into around 3x6cm pieces (check images for the exact length), strip the rubber from their ends and solder them accordingly to the pattern presented in the table and images below.

Personally I like to put all the cables inside the pins and bend them before soldering. By the way this project uses Arduino pin 8 and 9 for the bluetooth communication however it could also be done with the pins: 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI). (Why not all pins could be used for that purpose is explained here) The project uses "Software serial", alternatively "Hardware serial" could be used (pins 1 and 2) but I'm afraid it would require desoldering the pins before each upload of the code to Arduino.

Arduino HC-06
VCC VCC
GND GND
9 TXD
8 RXD (through 2k resistor)
GND RXD (through 4.7k resistor)
  1. Connect the device to PC, the bluetooth module should be blinking.

Once you connect to the bluetooth module with the mobile application the blinking should turn into steady light.

  1. Optionally the USB type A connector could be soldered to the USB OTG adapter and stabilized with hot glue as displayed on the pictures below.

By wiping the hot glue with a finger you could get rid of the hot glue excess (the connector at the bottom of the picture had its glue "wiped" so it's not so bulky unlike the other two connectors above it). Pictures don't show it clearly but the hot glue is also added on the other side of the connectors. If you look at the OTG adapter it has 4 flexible golden metal parts for each pin. Avoid soldering the USB type A connector to it because it may create serious safety issue. During tests I found out that if it's soldered to these flexible parts and both parts are squized together then some shortage occurs and the connector gets extremely hot (the device also doesn't work in such case). Take a look at images for the proper positioning.

Software (Arduino)

  1. Download Arduino IDE and Arduino sketch. Make sure to download the whole folder (you could clone/download the whole repository).
  2. Open arduino IDE. Click on Tools -> Board -> Arduino Leonardo (Important - incorrect setting of the board may require reflashing the arduino or performing a tricky reset. Click on Tools -> Port -> COM X. Paste this sketch and upload it to the board.
  3. Open Tools -> Serial Monitor, the new window will popup, select "No line ending" and "9600 baud" at the bottom corner of it. Then input the following commands into the input box located at the top: AT+NAMEyourname AT+PIN1234

The commands and the script mentioned above will set the name of the bluetooth module to "yourname" and its pin to "1234". Note that the pin has to consist of 4 digits. If everything goes right you should get "OKsetname" and "OKsetpin" responses.

  1. Upload the main sketch.

Software (app)

Install the app on your mobile from the Google Play Store

Software (app) - alternative installation from source

1.Download MIT project to your PC. Then download MIT App Inventor 2 Companion to your android.
2. Register at MIT app inventor website, log into it and import the MIT project (Connect -> Import project .aia). I recommend to watch this tutorial which explains how to create and manage applications made using this tool.
3. Click on Build -> App (provide QR code for .apk). The QR code will appear, it has to be scanned with a smartphone. Open your MIT AI2 Companion app on android and press scan QR code which will should appear on the screen of your PC.

This step isn't necessary to test and develop the application, MIT provides comfortable quick update system which automatically lets the user to preview application while changing its components. If you'd like to modify the source then instead of clicking on "Build" click on "Connect -> AI Companion" instead and also scan the QR code but this time it will show preview of the app on your mobile and respond in real-time to any changes you make using MIT App inventor 2.

  1. Complete the installation process and the project should be functional.

You can’t perform that action at this time.