Maker Pro
micro:bit

Build a Bluetooth Selfie Remote for Your Smartphone Using micro:bit

January 25, 2020 by Reginald Watson
Share
banner

Fond of taking selfies? Make a Bluetooth selfie remote for your phone, and learn to usemicro:bit along the way!

Hardware

When we talk about open-source electronics projects, there are two things that come to mind: Raspberry Pi and Arduino. However, f you are looking for a small cheap microcontroller with multiple features, the BBC micro:bit could be the device for you.

In this tutorial, I will show how to make a selfie camera remote system using a BBC micro:bit’s BLE chip to control a smartphone’s camera. So basically we are using a micro:bit as a wireless Bluetooth remote for a smartphone’s camera. This method works on both IOS and Android smartphones.

If you’re unfamiliar with micro:bit, I encourage you to check out How to Get Started With BBC micro:bit before jumping into this project.

Bluetooth_Selfie_remote_RW_MP_image2.jpg

My robot testing out the micro:bit selfie remote!

micro:bit Specs and Features

There are so many solvable problems with this small computer. The micro:bit helps you to better understand coding while having fun along the way. Whenever you wanted to build a robot or develop an application in order to solve one of life’s woes, the micro:bit is a great starting point for anyone who doesn’t know about programming but wants to learn.

Micro:bit gained popularity with students as a hardware option to take up coding and software development.

The micro:bit contains a 16Mhz ARM-based CPU, so there’s plenty of power to perform complex and advanced projects. Other features include:

  • Micro USB controller
  • Digital Compass
  • Bluetooth Low Energy
  • Weight: 8g
  • Accelerometer
  • Size: approximately 5cm x 4cm
  • 5x5 LED matrix with 25 red LEDs
  • 32-bit 16mhz ARM Cortex M0 CPU processor

Without further ado, let’s get started!

Hardware Requirements

  • BBC Micro:bit
  • Android or IOS Smartphone

Software Requirements

Upload Source Code on MakeCode

Using MakeCode, you can upload the source code and start writing your code in Scratch. You can also use other programming languages, including C++ and MicroPython. However, in this tutorial, we are uploading the code with Scratch programming as shown below.

Click on New Project, and start by adding the necessary Bluetooth and Device Extensions in the console.

click new project

Click on New Project.

Bluetooth_Selfie_remote_RW_MP_image14.png

Add extensions.

Bluetooth_Selfie_remote_RW_MP_image16.png

Use the search bar to easily find the extension you need.

Bluetooth_Selfie_remote_RW_MP_image12.png

Our required extensions are added!

Bluetooth_Selfie_remote_RW_MP_image21.png

Add the Input block.

Bluetooth_Selfie_remote_RW_MP_image20.png

Set up the devices code.

Bluetooth_Selfie_remote_RW_MP_image22.png

Add in a pause feature.

Our final code will look like the code in the image below. Once the code is complete, compile and download it by clicking the Download button.

Bluetooth_Selfie_remote_RW_MP_image9.png

Our final selfie camera code.

Once the code is done downloading, copy and paste the code into your micro:bit by following the steps shown in the images below.

Bluetooth_Selfie_remote_RW_MP_image13.png

Open the downloaded code.

Bluetooth_Selfie_remote_RW_MP_image1.png

Choose "micro:bit."

If you don’t want to write the code yourself, you can download the hex file at the end of this article.

Installing the App on Your Smartphone

Use the following steps to install the micro:bit app onto your phone by searching “micro:bit” in the Play Store or App Store on your phone.

Bluetooth_Selfie_remote_RW_MP_image17.png

Find and install the micro:bit app onto your smartphone.

Bluetooth_Selfie_remote_RW_MP_image8.png

Grant storage permission.

Bluetooth_Selfie_remote_RW_MP_image3.png

Allow micro:bit access to photos, media, and files.

Once the micro:bit app is installed, launch it. Tap on “OK” and then “Pair.”.

Bluetooth_Selfie_remote_RW_MP_image23.png
Bluetooth_Selfie_remote_RW_MP_image5.png

Next, tap on “Pair a New micro:bit.”

Bluetooth_Selfie_remote_RW_MP_image10.png
Bluetooth_Selfie_remote_RW_MP_image24.png

Tap “Allow” to automatically turn on Bluetooth. Then, connect the micro:bit to your phone using a micro USB cable or with its battery.

Next, hold the A and B buttons on the micro:bit and press the RESET button for a second. From there, the micro:bit will start PAIRING MODE on the LED display.

In order to pair your board and phone, enter the pattern shown on your micro:bit into your phone which should look something like this:

Bluetooth_Selfie_remote_RW_MP_image11.png
Bluetooth_Selfie_remote_RW_MP_image15.png

Enter the pattern on your phone and tap OK.

Bluetooth_Selfie_remote_RW_MP_image19.jpg

After pairing successfully, micro:bit will take you to the home screen. Tap on Previously Paired micro:bit. Once it’s connected, the switch logo turns green as shown in the screenshot below.

Bluetooth_Selfie_remote_RW_MP_image6.jpg
Bluetooth_Selfie_remote_RW_MP_image7.jpg

With micro:bit paired with your phone, start pressing the micro:bit’s pushbuttons. The following buttons perform the following tasks over BLE.

  • Pushbutton A: Take a selfie after five seconds.
  • Pushbutton B: Start video recording after five seconds.
  • Pushbutton A+B together: Stop video recording.

That's it! Your selfie remote is ready to go. Happy snapping!

Author

Avatar
Reginald Watson

I love challenging myself by creating new projects using different microcontrollers to see what I can come up with.

Related Content

Comments


You May Also Like