MIT App Inventor tutorial implementing the nRF Blinky protocol

Hi, I'm coaching a team of 14 year olds in a french national competition called Course en Cours. As part of the project we're designing a device to measure acceleration, using an Arduino Nano BLE. The kid on the team who wants to do this has no programming background at all, I have to start him off from zero, so I'm looking for the absolute simplest way to code the app on his Android phone which will communicate with the Arduino. To learn about this myself, I've written a sketch that talks to an existing template app (nRF Blinky) . How complicated would it be to implement the exact same functionality as nRF Blinky app on the android, but with MIT App Inventor?Thanks for any advice on this

I don't know what nRF Blinky does. The acceleration of a cell phone can be monitored in x, y and/or z axis like this

Is this what your student wants to do with the cell phone?

or perhaps

which does not use nRF Blinky but only an Android device to measure acceleration using AccelerometerSensor

1 Like

Are you using an IRU? If so, see this:

@uskiara and @ABG will have some good advice relating to integrating Arduino with your app.

Bonjour @dbonner,
comme première chose je te souhaite la "bienvenue" su ce forum !
Mais j'irai continuer en Anglais comme dans cette façon il y aura plus d'occasion d'obtenir aide, et aussi parce que mon Français technique est très pauvre :smirk: (je suis Italien).
If I have correctly understood your aim is to have an app that talks with an Arduino board, featuring a BLE comm's, so to acquire an accelometer on the Arduino device, transmit its data to the app, and on the app to show the vaules.
Is this correct ?
Then we can go deeper later on...
A+

EDIT : if possible avoid the use of BLE (more complicated than classic BT)

1 Like

The nRF Blinky UUIDs are at

for what it's worth.

1 Like

Hi @SteveJG thank you for your suggestion but the acceleration measure has to come from the Arduino, because the Arduino will be mounted on the car that is accelerating.

Hi @nishyanthkumar thanks for that suggestion, I am not accessing an IRU or accelerometer directly it's part of the Arduino board, so on the Arduino side I only use the Arduino libraries and getting the sensor data is very simple.

1 Like

Bonjour @uskiara thank you very much for your warm welcome, you've perfectly understood, that's exactly what we're doing. I would like to use BLE because I find the Arduino BLE library to be very nice and because I'm using an Arduino Nano 33 BLE and it runs fine with the sketch that I linked to above. My first idea was to use the nRF Blinky app as a template, because it implements a neat little"educational" BLE protocol called "Nordic Led and Button Service (LBS)" but then I realized that for my 14 year old student, it will be too hard to modify the Kotlin code.
So I thought maybe I can reproduce the nRF Blinky app with App Inventor, to make it easier to work with and modify.

Hello @ABG thanks for adding the link, I find the nRF Blinky to be a brilliant idea because its only purpose is to demonstrate bi-directional BLE communication and to be a template for people to build their own apps. The catch is that it's not as easy to modify and build on for a 14 year old as an MIT App Inventor program, which is why I would like to reproduce nRF Blinky in App Inventor.

Bonjour David (@dbonner),
honestly I was "fearing" that you were using BLE due to the Arduino board characteristics (a NANO33, in this case).
Nevertheless, there are already many topics in this forum dealing with this type of interface between AI2 and an "on field" device, specifically the Nano33.
For example by writing "nano33" in the search tool, you will access to:
https://community.appinventor.mit.edu/search?q=nano%2033
where many topics related to the connection between an AI2 app and that specific type of Arduino board are collected.
I believe that, once got the connection part working, the remaining part of the app building will be essy and your students will appreciate the friendliness of the development environment and the power of visual interface creating.
My hint is then to (teach your students to) proceed with little steps and don't do the "big bang approach", like many young guys often do. As a first step just try to make a simple app that is capable to exchange data between AI2 and the Nano: on the AI2 just implement a couple of pushbuttons that send a character each (i.e. 'A', 'B') to the BLE. You need an extension to do that:

On the Nano a simple code that can show on the SerialMonitor everything is coming from the BT. Second step, is to transmit from the Nano any character got from the Serial Monitor to the app and show these characters into a label in the AI2 app.
To help in debugging all the above you can use a free app named Serial Bluetooth Trerminal that you can download from Google Playstore.
The road to the target seems to be long and harsh, but is not that true. :grimacing:
Bonne chance !
Ugo.

(Edited: corrected typos)

1 Like

Thank you very much Ugo! I can see that what I want to do is quite doable, I will try to get it running and report back here. And don't worry I indeed plan to make this by very small steps, starting from something that works. Cheers David

Bonjour David,
n'hésite pas à me contacter encore si tu a besoin de plus d'explications.
Bon courage. :muscle:

Hi, I wrote the ai2 app it works. Putting here as an attachment because I haven't yet figured out how the publication works in the gallery...
Thanks for all your answers and advice!

nRFBlinkyInAI2v1.aia (197.4 KB)

1 Like

Merci beaucoup, je viens de poster l'app AI2 ça fonctionne merci!

Bonjour David,
je suis heureux de lire que tout marche bien.
Bien cordialement,
Ugo.