Develop Nicla Vision applications for context-aware physical spaces using OpenMV and Bluetooth Low Energy.
Learn how to program a Nicla Vision board with existing applications, or develop your own.
A Nicla Vision and, optionally, a Pareto Anywhere instance creating a context-aware space
* a standard USB A to micro-B cable is required—but not included!
Connect with the Nicla Vision in the OpenMV IDE.
Update to the latest bootloader and install OpenMV
Follow the official Getting Started with Nicla Vision guide, specifically the following steps:
The Nicla Vision ships with an external 2.4/5GHz antenna for BLE & WiFi connectivity. Install this antenna by carefully aligning the connector and applying sufficient pressure for it to snap into place.
Note that once connected, the antenna should only be removed using a specialised tool, in order not to damage the connector.
Choose a USB A to micro-B cable of sufficient length to allow the camera to be pointed at subjects of interest while tethered. Connect the micro-B end to the Nicla Vision and the other end to the laptop.
Run the OpenMV IDE on your laptop. The default view should resemble the following. Annotations have been added to highlight key features.
Click the Connect icon to connect to the Nicla Vision via USB. If prompted to update the firmware on the Nicla Vision, go ahead and do so.
The OpenMV IDE footer will display information about the device which is currently connected, in this case the Nicla Vision with the GC2145 sensor.
The Nicla Vision can now be programmed via the OpenMV IDE, which is the subject of the next step.
Load a Python file and run it on the Nicla Vision.
From the OpenMV IDE connected to the Nicla Vision:
The OpenMV IDE should open a helloworld.py file by default. Click the Start (run script) icon at the bottom left of the IDE to run this script on the Nicla Vision.
Show the Serial Terminal to observe the number of frames per second (fps) printed to the console. Show the Frame Buffer to observe what the camera sees, as well as the Histogram of the colour space.
Click the Stop (halt script) icon at the bottom left of the IDE to stop running this script on the Nicla Vision.
Open a new file in the OpenMV IDE, and copy Ctrl+C and paste Ctrl+V the following lines of code into the code editor window:
import bluetooth, time # Advertising payload bytes: # 0: 0x06 = Length (not including the length byte itself) # 1: 0x09 = Complete Local Name (from GAP) # 2-6: 'Nicla' = Name (as ASCII characters) _ADV_PAYLOAD = [ 0x06, 0x09, ord('N'), ord('i'), ord('c'), ord('l'), ord('a') ] _ADV_INTERVAL_US = 500000 ble = bluetooth.BLE() ble.active(True) ble.gap_advertise(_ADV_INTERVAL_US, adv_data=bytearray(_ADV_PAYLOAD)) while(True): time.clock().tick()
Click the Start (run script) icon at the bottom left of the IDE to run this script on the Nicla Vision.
Observe in Pareto Anywhere, or from any Bluetooth Low Energy scanning mobile app, a device named Nicla. This is the Nicla Vision advertising its name to any devices in range.
Example to come.
Explore the potential of the Nicla Vision in context-aware physical spaces.
Load our nicla-vision-gauge-reader code to interpret and transmit analogue gauge level data that can be observed in Pareto Anywhere's APIs and web apps.
Choose the power source best suited for the application.
Power from the USB connector is prioritised over the ESLOV and the Battery Connector.
The Nicla Vision can be powered via USB, either via connection to a laptop, or from a standard USB power bank.
Power from the ESLOV is prioritised over the Battery Connector.
The Nicla Vision can be powered from the ESLOV Connector (J5) which nominally expects 5VDC, but can accept the range of voltages supported on the VIN pin* to which the ESLOV is diode-connected. For instance, it is possible to power the Nicla Vision via the ESLOV with 3 x 1.5V batteries (ex: AAA, AA, C or D) using commercially-available 3-cell battery holders.
*The datasheet specifies 3.5V-5.5V as recommended operating conditions.
Cut the cable in half, and carefully feed the ends into the first and last slot of the plug, observing the orientation such that each metal tab locks into place. Indicate Pin 1 (positive) with a red permanent marker, and take care to observe the polarity when connecting/soldering to a battery holder or alternative power source.
The Nicla Vision can be powered from the Battery Connector (J4) using a single-cell 3.7 V Li-Po or Li-Ion battery. See this tutorial for details.
Continue exploring our open architecture and all its applications.