You are on page 1of 10

let's make Explore (/tag/type­id/) Publish (/about/create.

jsp) You (/you/)

Classes NEW! (/classes/)


Featured: share what you make (/halloween/) (/halloween/) (/id/intel/) Intel IoT (/id/intel/)
(/)
(/tag/type­id/category­technology/channel­leds/) LEDs (/tag/type­id/category­technology/channel­leds/)
58% DE DESCUENTO * EUR 174,71
(/tag/type­id/category­costumes/)
Mesa redonda Hood Costumes EUR 74,00
(/tag/type­id/category­costumes/)
MRHOOD-100 color blan...
*Descuento sobre el precio de venta recomendado

58% DE DESCUENTO *

*Descuento sobre el precio de venta recomendado

Mesa redonda Hood MRHOOD-


100 color blan...
EUR 174,71
EUR 74,00
(/file/F8K9SH4HZ6T6H61/)

Hello,
I was trying to send some data from an Arduino Ble4 device to a mobile device
(android). I tried with the wonderful MIT App Inventor 2 but the Ble features are
not implemented yet.
About This Instructable
So after looking around for a while, I have found an app called Kino App
Inventor, that is written for Iphone and Ipad devices.
8 9.481 views Posted:
The app is really easy and good looking and in a few I was able to do a lot of Aug 23, 2014
interesting things.
 15 favorites License:

Unfortunately it's hard to find a complete documentation or other resources on


line.
fabiodagnano
This is how it works at a glance. (/member/fabiodagnano/)
Follow 3
Assume that you have:
(/member/fabiodagnano/)
Arduino with a BLE device and that you are sending raw data with the
Serial.print(data) command. More by fabiodagnano:
BLE device (I am using a Xadow Ble from Seeed Studio) that is already
paired with your Ipad.
Kino App Inventor running (more or less 10$).
(/id/Kino­App­

Inventor­12­and­BLE­Bluetooth­Low­
Step 1: Intro Energy­/)

Add instructable to:

; Group

(/file/FM462FGHZ6T61GZ/)

In Kino App Inventor you have a section related to the input (internal as the Gps
or Gyroscope of your mobile) or linked to external resources as the Bluetooth or
Internet, that is calles "Controllers" (A in the image).
A second section is dedicated to the so called "Receptors" aimed mostly to
show some features. (B in the image). The third and really useful part is called
(Labels), and it's used to show the results coming mostly from the Controllers (C
in the image below).
Another useful part is called "Metters" (the developer is Spanish and maybe
there is an incorrect double T in Meters). This part is useful to show graph and
other meters of the data. (D in the image).
Last but not least you can do your own scripts in Lua and this add a great
performance to your experiments. Now we can start.

Step 2: Add a BLE controllor on the Kino


Kino App Inventor 1.2 and BLE (Bluetooth Low Energy) + Xadow by
p
fabiodagnano (/member/fabiodagnano/) in technology (/tag/type­id/category­technology/)Earduino (/tag/type­id/category­technology/channel­arduino/)

Download h4 (/id/Kino­App­Inventor­12­and­BLE­Bluetooth­Low­Energy­/) 8 Steps .


5  Collection I Made it!  Favorite  Share 

?
(/file/FA9XMKRHZ6T6A8P/)

Switch on your BLE device (I am using a Xadow Ble from Seeed Studio, but
it should work with any other).
Find in the controllers section the "Bluetooth 4.0". Drag it and keep it pressed
until a panel is sliding on the right side of the screen.
press th "+" sign and add your Ble device

Step 3: Check if it's working

Kino App Inventor 1.2 and BLE (Bluetooth Low Energy) + Xadow by
fabiodagnano (/member/fabiodagnano/) in technology (/tag/type­id/category­technology/)Earduino (/tag/type­id/category­technology/channel­arduino/)

Download h (/id/Kino­App­Inventor­12­and­BLE­Bluetooth­Low­Energy­/) 8 Steps .


(/file/FNXDLU4HZ6T6A8X/)
 Collection I Made it!  Favorite  Share 
Go in the Receptor part and drag into the screen a Green led.
Keep it pressed and wait for the panel.
Choose as Source "BLE1"
Choose as target "ONLINE"
A warning should appear to ask you if you want to switch to the Ble device. Say
Yes.
If everithing is all right you should see the green light on to tell you that the Ble is
online.
In the previuos steps we told to the receptor to get the data from the Ble device
called "online". This is 1 if it's working. If the data is =1 the led is green,
otherwise it's not working.

Step 4: Send data from Arduino

(/file/F7U1D2BHZ6T69SC/)

In Arduino you can easlily send data with the Serial.print command.

Kino App
I suggest to Inventor 1.2Serial
use the Software andexample
BLE (Bluetooth
in order to have Low Energy)
a second virtual + Xadow by
serial port(/member/fabiodagnano/)
fabiodagnano in Arduino, different from the standard
in technology 0 and 1 digital pins used
(/tag/type­id/category­technology/) Efor the (/tag/type­id/category­technology/channel­arduino/)
arduino
standard serial transmission.
Download h (/id/Kino­App­Inventor­12­and­BLE­Bluetooth­Low­Energy­/) 8 Steps .
For instance if we want to see something in the Serial Monitor we use the
Serial.print(data) command, and if we want to send it through theBLE Collection
device we I Made it!  Favorite  Share 
use Serial1.print(data) ­ where Serial1 is the virtual/software serial port.

To be sure that the transmission is fine we can send numbers from Arduino with
a simpe code like the following.
This produces a series of numbers starting from 0 to 99, and then starts again.
This is commonly called "saw curve".
Now we have to decode the data in Kino.
BLE_saw.ino (/files/orig/F0X/XKEV/HZ6T6GAP/F0XXKEVHZ6T6GAP.ino)

Step 5: Get data in Kino

(/file/FOY25HIHZ6T6A9G/)

In Kino go the the Label part (see step 1) and:


drag a Label into the screen
keep it pressed and wait for the panel
choose BLE1 as source and ffe0/ffe1 as target.
Now you are able to see the data coming from the BLE.
In the next step we can use the coming data in a script.

Step 6: Use the data in a script

Kino App Inventor 1.2 and BLE (Bluetooth Low Energy) + Xadow by
fabiodagnano (/member/fabiodagnano/) in technology (/tag/type­id/category­technology/)Earduino (/tag/type­id/category­technology/channel­arduino/)

Download h (/id/Kino­App­Inventor­12­and­BLE­Bluetooth­Low­Energy­/) 8 Steps .


 Collection I Made it!  Favorite  Share 

(/file/FC0BXQKHZ6T6EAJ/)
(/file/FJGXVJ6HZ6T6EAQ/)

Open the script part (letter E of the first step)


and write this:
____
dim value as integer
value = [BLE1.ffe0/ffe01]
____

In the first row we are declaring that the variable "value" is an integer number.
In the second row this variable is equal to
[name_of_the_controller.name_of_the_feature] ­ (Mind the brackets!).
Now we can use this variable in our sketch.
Use a Label (see previuos steps) and use Script as source and "int.value" as
target.
if everything is fine you should see the same value in both labels (the first
coming directly from the Ble device, the second passing through the Scripts in
the first image).

Kino App Inventor


Why should 1.2instead
we use the script and BLE (Bluetooth
of getting Low
raw data directly fromEnergy)
the + Xadow by
controller?(/member/fabiodagnano/) in technology (/tag/type­id/category­technology/)Earduino (/tag/type­id/category­technology/channel­arduino/)
fabiodagnano

Simple, to use it in(/id/Kino­App­Inventor­12­and­BLE­Bluetooth­Low­Energy­/)


logical statements. For instance if you want to switch 8on a led
Download h Steps .
if the values is going below 50 you can add the following lines, as in the second
image:  Collection I Made it!  Favorite  Share 

_____
dim led as integer
if value < 50 then led = 1
else led = 0
end
______
Step 7: Show the results!

(/file/F1KUIBAHZ6T6A9Q/)

Now we can add other features from Metters, always using script as a source
and int.value as target.
You can do a lot more with the Kino App Inventor and Arduino Ble (Xadow),
enjoy!

Step 8: Example: send and check the battery charge of


Xadow board

Kino App Inventor 1.2 and BLE (Bluetooth Low Energy) + Xadow by
fabiodagnano (/member/fabiodagnano/) in technology (/tag/type­id/category­technology/)Earduino (/tag/type­id/category­technology/channel­arduino/)

Download h (/id/Kino­App­Inventor­12­and­BLE­Bluetooth­Low­Energy­/) 8 Steps .


 Collection I Made it!  Favorite  Share 

(/file/FKBJALBHZ6T6KF9/)
(/file/FJD68QWHZ6T6LL4/)

To do this we need to add few lines and to send the value of the battery charge.
You can refer to the first image to get the value from the Xadow.
Now we have to remap the values to get the charge range from 0 to 100%.
At a maximum charge my battery can give 4.23 volts and below 3.3 it's dead.
So I do 4.23­3.3 and I have 0.93.
100/0.93 gives 107.5 that is the proper ratio to have my values in a percent
base.
So I add:
dim charge as double
charge= [BLE1.ffe0/ffe01]
charge=(charge­3.3)*107.5
At this point I can Use this value to display the battery charge with a meter.
In the second image you can se the volts (3.95) the remapped value (71) and a
graph.

Kino App Inventor 1.2 and BLE (Bluetooth Low Energy) + Xadow by
fabiodagnano (/member/fabiodagnano/) in technology (/tag/type­id/category­technology/)Earduino (/tag/type­id/category­technology/channel­arduino/)

Download h (/id/Kino­App­Inventor­12­and­BLE­Bluetooth­Low­Energy­/) 8 Steps .


 Collection I Made it!  Favorite  Share 

We have a be nice comment policy.


Please be positive and constructive. w I Made it!  Add Images Post Comment

stonez56 (/member/stonez56)
It was a pity that I don't have an iPhone. 2 years ago Reply

I was also looking BLE implementation libraries for Android App Inventor 2, but
no luck so far. Any one know about this?

Flag

mndrk (/member/mndrk) . stonez56 (/member/stonez56) 2 years ago Reply

Yes, it looks like you can't.

I
did it with a trick: use a third part software for ble (for instance Ble
tool from Tony was perfect for me) and use his log file in App Inventor
2. It works in real time.

Flag

eshwar2014 (/member/eshwar2014) . mndrk (/member/mndrk) Reply

2 years ago
Where can I find the third party s/w for BLE for app inventor2?

Flag

JacobB4 (/member/JacobB4) . eshwar2014 (/member/eshwar2014) Reply

2 years ago
https://groups.google.com/forum/#!topic/app­inventor­open­
source­dev/QVo4K4smLpE

Flag

X seamster (/member/seamster) 2 years ago Reply


|
8 Interesting. Thanks for sharing.

Flag

FEATURED CHANNELS

Woodworking Paper Kitchen Hacks Puzzles Space Ice Cream Homesteading 3D Printing Sewing
(/tag/type­ (/tag/type­ (/tag/type­ (/tag/type­ (/tag/type­ (/tag/type­ (/tag/type­ (/tag/type­ (/tag/type­
id/category­ id/category­ id/keyword­ id/category­ id/keyword­ id/keyword­ id/category­ id/category­ id/category­
workshop/channel­craft/channel­ kitchen%20hacks/?play/channel­ astronomy/? ice%20cream/? home/channel­ technology/channel­
craft/channel­
woodworking/) paper/) sort=FAVORITES) puzzles/) sort=FAVORITES)sort=FAVORITES)homesteading/) 3D­Printing/) sewing/)
Newsletter
Kino App Inventor 1.2 and BLE (Bluetooth Low Energy) + Xadow by
Join 2 million + to receive instant
fabiodagnano (/member/fabiodagnano/) in technology (/tag/type­id/category­technology/)Earduino (/tag/type­id/category­technology/channel­arduino/)
DIY inspiration in your inbox.
Download h (/id/Kino­App­Inventor­12­and­BLE­Bluetooth­Low­Energy­/)
enter email I'm in!
8 Steps .
 Collection I Made it!  Favorite  Share 
Mobile
Download our apps!

Android » (https://play.google.com/store/apps/details?id=com.adsk.instructables)
iOS » (https://itunes.apple.com/app/instructables/id586765571)
Windows » (http://apps.microsoft.com/windows/en­us/app/7afc8194­c771­441a­9590­54250d6a8300)
About Us Find Us
Who We Are (/about/) Facebook (http://www.facebook.com/instructables)
Advertise (/advertise/) Youtube (http://www.youtube.com/user/instructablestv)
Contact (/about/contact.jsp) Twitter (http://www.twitter.com/instructables)
Jobs (/community/Positions­available­at­Instructables/)
Pinterest (http://www.pinterest.com/instructables)
Help (/id/how­to­write­a­great­instructable/)
Google+ (https://plus.google.com/+instructables)
Resources
For Teachers (/teachers/)
Artists in Residence (/air)
Gift Premium Account (/account/give?sourcea=footer)
Forums (/community/)
Answers (/tag/type­question/?sort=RECENT)
Sitemap (/sitemap/)

Terms of Service (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21959721) |


Privacy Statement (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21292079) |
Legal Notices & Trademarks (http://usa.autodesk.com/legal­notices­trademarks/) | Mobile Site (http://www.instructables.com)
(http://usa.autodesk.com/adsk/servlet/pc/index?id=20781545&siteID=123112)
© 2016 Autodesk, Inc.

Kino App Inventor 1.2 and BLE (Bluetooth Low Energy) + Xadow by
fabiodagnano (/member/fabiodagnano/) in technology (/tag/type­id/category­technology/)Earduino (/tag/type­id/category­technology/channel­arduino/)

Download h (/id/Kino­App­Inventor­12­and­BLE­Bluetooth­Low­Energy­/) 8 Steps .


 Collection I Made it!  Favorite  Share 

You might also like