Hi guys, In this blog, I will be showing you how to get started with the Arduino Nano 33 BLE and BLE sense with the Arduino IDE and how amazing they are! I will be going over their features, setting them up with the Arduino IDE, different ways to power the board (with and without batteries) and a lot more. Let’s get started!
Configuring the Environment
Let’s start by setting up the Arduino IDE with the necessary libraries, board settings, etc. so that if you have a Nano 33 BLE/BLE sense, you can get started programming it right away!
Start by opening the IDE and going to the Boards manager under Tools.
After opening the boards manager, search for “nano 33 ble” and install the latest version of the first option which show up. It should look a little like this. As I have already installed it, it does not give me the option to install.
Now, the board should appear in your “boards” menu under tools and will also appear next to the COM port it is connected to, so connect your board to your PC, select the right COM port and board. Finally, open the Blink example sketch and upload it to your board. If everything has gone well, the LED should start blinking.
Since there is no difference between the BLE and BLE sense in terms of hardware (sensors don’t count here as they are add-ons) both the boards will be recognized as a Nano 33 BLE and you will have to select the same.
Something important to remember however, is that every time you upload something to the board, it will temporarily disconnect from your PC and then reconnect, often to a different COM port. Because of this you will have to re-select your COM port each time.
Powering the board
*Note- The onboard linear voltage regulator can handle a voltage between 5 and 21 volts. Failing to supply a voltage in this range can damage the board permanently (> 21v) or cause unstable working (< 5v). Also remember that the board runs on 3.3v logic levels, meaning any devices connected to its pins must not provide signals at a voltage higher than 3.3v, which can also permanently damage the board.
The board can be powered normally via the micro USB cable used to program it. If the cable is connected to an adjustable power supply, make sure it can supply a minimum of 4.5v and a maximum of 5.5v. The closer the voltage stays to 5v the better.
The board can be powered using the Vin, GND pins on the board (bottom left corner of the image, not marked) as an alternative to the USB, however as mentioned before, it must be in a range of 5 to 21v.
If you wish to directly supply a pre-regulated voltage to the board while bypassing the onboard regulator, simply cut the connection between the two 3.3v pads at the back. This allows you to directly supply 3.3v to the board without going through the onboard regulator.
This adds the the advantage of greater power efficiency and reduced heat generation. However, do remember that while the two pads are disconnected, it wont be possible to upload any new code to the board. Only cut it after you have finalized the program and uploaded it. If you do end up accidentally disconnecting them, a drop of solder can be used to reconnect them.
Configuring Sensor Libraries
The board has a plethora of sensors available on it. They are ambient light, proximity, RGB color, gesture, temperature, humidity, pressure, 3 axis accelerometer, 3-axis gyroscope, 3-axis magnetometer (all combined into a single 9-axis IMU), and finally, a microphone. In this section, I will be showing how to get the libraries necessary to use them.
Opening the IDE and go to the libraries manager under Sketch as shown-
Next, search for “nano” in the search box. The top 5 search results are all libraries you want to install. Since I have already installed them, they show up as such. The Libraries may not show up in the same order as shown below, but just make sure to match their names.
And, you are done! You can now open examples from each of these libraries and try them out. For an in depth tutorial on the sensors and their libraries, click here(coming soon).
Bluetooth Low Energy
Both the new Nanos have BLE in their name which is short for Bluetooth Low Energy, a variation of Bluetooth which consumes lesser energy than the conventional version, allowing it to be used in many smaller devices where the battery is small and the rate of data transfer low.
Bluetooth can be used for wireless connectivity to be made between devices in close proximity. You might have already seen it being used in your smartphone, PC, headphone and many more devices. This allows your Arduino to function as a complete BLE client which can broadcast and connect to devices from which it can then receive and send data.
To use the BLE capabilities of the new board, the Arduino BLE library can be used which also contains all the necessary example sketches. To install it, follow the same steps as shown in the sensor library installation above, except you download the seventh result(ArduinoBLE library) as shown below.
Mbed Core Integration
Now, to my favourite bit, the integration of Arm Mbed OS. Mbed OS is a lightweight, but powerful RTOS (real time operating system) designed specifically for 32-bit ARM Cortex microcontrollers/processors and is used for IOT (internet of things) devices. An RTOS is a program that runs on a device and allows other programs to run. It manages system resources like RAM, CPU, power consumption etc. It always runs in the background and provides abstraction over the main hardware to any program or programs running on it. Here is a diagram showing the same-
Arduinos such as the UNO, Mega, Pro Mini are built using 8 bit AVR chips which run between 8 & 16 Mhz. They also have fewer pins (Exception- Arduino Mega) and limited capabilities in each pin such as PWM, external interrupts, analogue inputs etc. This makes them good for beginners to get introduced to the world of DIY and STEAM (Science, Technology, Engineering, Art, Math), and perfect for not-so smart devices which simply need to do a single repetitive task without much computing power, connectivity.
But these limitations also prevent them from running an RTOS with any meaningful benefits (they can, but without any of its benefits). They instead use a bootloader. A bootloader is a small program, unlike an OS, whose only function is to take code from storage and load it into memory to run when the Arduino is powered on. After doing this, it relinquishes control while your code takes center stage. This also means that only one program may run at a time and the programmer must define his own abstractions over the hardware. Here is a diagram showing the same-
Do keep in mind, it is not absolutely necessary for a bootloader to be present on a microcontroller. Programs can be flashed directly to the ROM by using external programmers, however, bootloaders do remove the need for one and make it more convenient at the cost of some space.
This is where ARM comes in. ARM Cortex processors feature much more robust chips which have more computing power, memory, etc while still keeping the size and power consumption low. They also have easy options for integration with various connectivity options, something essential for IOT. This allows them to run an RTOS instead of a bootloader.
Mbed OS is a very popular RTOS for ARM chips. Arduino integration with Mbed means big things for programmers and creators. You can now do time slicing, thread management, power management and much much more which was either outright impossible or incredibly hard before.
Applications and closing thoughts
The two new boards are tiny but definitely pack a large punch, with bluetooth, ARM chips, sensors, Mbed integration etc. They may not be ideal for a lot of simple projects but where they really shine is IOT and wearables.
The availability of an RTOS, sensors, bluetooth connectivity and their small form factor is what makes them well suited for projects related to wearables, IOT, physical computing.
To conclude, I would like to say that these two new Arduino Nanos are a good addition to the family, and can be used in many projects in the future.
If you found this blog helpful, or have any queries, feel free to write them down in the comments, I’d love to know your thoughts!
5 thoughts on “Getting started with Arduino Nano 33 BLE and BLE sense”
Well done Aditya
Pingback: Using Mbed with Arduino ARM Boards – DumbleBots
Great tutorial. Absoulutely fantastic!
Enjoyed reading your tutorial, especially the explanation about having to re-select the com port after uploading. This was driving me crazy. I could see it happening, but could not understand why. I thought it was something I was doing wrong. Thank You
Glad to know it helped!