Maker Module (MM01) – BLE Microcontroller

IMG_20150609_101555

I’m really excited about the potential with this building block – it’s core to any ‘smart’ home, and I can think of tons of wireless, phone controlled toys to make with this as a foundation!

Parts:

  • Arduino Pro Mini (or any equivalent clone via eBay)
  • HM10 BLE module

Notes:

I choose a 3v, 8mhz, ATMega328 Arduino Pro Mini (clone) – perfect for low energy applications, and has a very small size with just the right amount of space for the HM10 to sit onboard. Note that the HM10 has its VCC at 3.3V, so is unsuitable for any 5V Arduino without extra engineering.

The HM10 I purchased from eBay, shipping all the way from the far East; these take a while to arrive, but are very low cost.

Construction: 

Refer to the photo above – I flipped the Arduino over to expose its relatively bare back, and attached the HM10 with a double sided sticky foam pad. Leave a little room at the antenna end to maximise communication range.

Pin soldering was simple (if a little fiddly); refer to this pinout [https://github.com/nickswalker/ble-dev-kit/wiki/HM-10-Pinout]. The only pins that are needed for basic wireless serial communication are VCC, GND, TX and RX. Couple the TX/RX with any digital pins on the Arduino – simply use the SoftwareSerial library to use it.

Code:

The following is all that’s needed to echo anything arriving via BLE into the Arduino serial monitor, and likewise push anything typed there back over BLE.


#include <SoftwareSerial.h>

SoftwareSerial mySerial(7, 6); // RX, TX

void setup() 
{
    // Open serial communications and wait for port to open:
    Serial.begin(9600);


    //  set the data rate for the SoftwareSerial port
    mySerial.begin(9600);
}

void loop() // run over and over
{
   if (mySerial.available()) Serial.write(mySerial.read());
   if (Serial.available()) mySerial.write(Serial.read());
}

Writing code for ‘any other thing’ to push data over to the board, is a whole other post… I’ll be sure to cover it when I write about my smartwatch. To give a short hint for now: I had great success with a PhoneGap app I built for iOS and Android, using a plugin called EvoThings BLE.

Advertisements
Tagged ,

One thought on “Maker Module (MM01) – BLE Microcontroller

  1. Dave Owen says:

    Following you – glad ur back 🙂 I have just finished an azimuth/elevation antenna controller using a UNO. Nearly 200 pages of code !!

    Dad

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: