Skip to first unread message

Sujit Mishra

unread,
Nov 28, 2017, 12:30:01 AM11/28/17
to MIT App Inventor Forum
Hello everyone. I want to make an android app for water level indicator using bluetooth module. I also want to indicate water level with bar graph on my app. So can anyone give me some direction how can I do so? How can I use external hardware input to control my app functions?

CAnesia

unread,
Nov 28, 2017, 7:52:42 AM11/28/17
to MIT App Inventor Forum
Sujit,
My first app was a Bluetooth button to send a predefined SMS from a paired phone to a predefined number. Simple stuff.
Search on Google, there are enough examples so you can do it.
I vaguely remember that Arduino will send a number in a text form and the app will interpret that and act accordingly.

Look on google you will find it.
Regards!

Sujit Mishra

unread,
Nov 28, 2017, 8:25:06 AM11/28/17
to mitappinv...@googlegroups.com
Thanks a lot sir for your support. Sir I am just a starter in android app building. As of now I made just one app to control my home devices with bluetooth module. Sir I searched for my requirement but didn't found anything may b I am not using a proper keyword. I found one link similar to my issue but its too bulky for me to understand, here is a link for it http://www.martyncurrey.com/turning-a-led-on-and-off-with-an-arduino-bluetooth-and-android-part-ii-2-way-control/ . Can you please suggest me any such link.

Farzeen Harunani

unread,
Nov 28, 2017, 9:48:26 AM11/28/17
to MIT App Inventor Forum
Hi,
Have you checked previous forum posts? Lots of resources have been posted in the past. I'd start there. Also, are you using an Arduino? 
Farzeen

Sujit Mishra

unread,
Nov 28, 2017, 10:18:02 AM11/28/17
to MIT App Inventor Forum
I am using pic microcontroller.

Abraham Getzler

unread,
Nov 28, 2017, 10:48:36 AM11/28/17
to MIT App Inventor Forum
Search the Arduino and BlueTooth section
of this FAQ for samples ...

ABG

CAnesia

unread,
Nov 28, 2017, 6:25:05 PM11/28/17
to MIT App Inventor Forum
Sujit, I remembered something about my Bluetooth hardware app. I was using a HID (human interface device) unit from Adafruit; that units outputs characters (text) trough Bluetooth so my app listened for a specific character and acted based on that.
You said you already made home automation with android so all this should not be se complicated. The App Inventor side of your project must be simpler than all the hardware programming that you have to do.
Can you describe a bit more your general project aspects and functionality? What hardware you use and how to you expect to exchange data between them? Everything else that crosses your mind.

Sujit Mishra

unread,
Nov 29, 2017, 3:08:23 AM11/29/17
to MIT App Inventor Forum

Sir it was a simple home automation project based on 8051 uC. In this project I send a command from my app lets say for 1st device character "1" for 2nd device character "2" and so on. On uC programming side I just assingned these character for those devices and toggled it on every received data. Above is my block layout which I made in my app. And is a youtube link for my project: https://youtu.be/0T-xYI3KRiE

Cat

unread,
Nov 29, 2017, 10:00:52 AM11/29/17
to MIT App Inventor Forum
Sujit, I see that your Home Automation app is more or less what I was doing with my Bluetooth HID device button app (you have enough experience to make what you need).
Here is what you try to achieve: water level indicator using "Bluetooth module". I also want to indicate water level with "bar graph" on my app
How can I use external hardware input to "control my app" functions?

"Bluetooth module" - how do you monitor the water level on the hardware side? by a float device, a sensor of sort, a mechanical contraption ...
"bar graph" - simple one, can be addapted or here and this definitely is what you need to build upon (Youtube and AI2 sources)
"control my app" - easy, listen to the Bluetooth output and react to that (you made it in you home automation)

Now start working ...

Sujit Mishra

unread,
Nov 30, 2017, 2:15:14 AM11/30/17
to mitappinv...@googlegroups.com
Would like to thanks all of you since now I am able receive signal from my controller to app. I just needed to add some more blocks in my previous made home automation app. Now one of my doubt is that how can I provide toggle command in my blocks like we do in our programming suppose "PORTB =~ PORTB". I want to toggle function in my app.
Block.png

Sujit Mishra

unread,
Nov 30, 2017, 2:27:21 AM11/30/17
to MIT App Inventor Forum
And about the water level I want to display in this manner as in diagram. Now my question is how can I draw this type of image in my app and then control its colour according to input received.
download.png

Sujit Mishra

unread,
Nov 30, 2017, 6:59:23 AM11/30/17
to MIT App Inventor Forum

Feeling delighted, as I have solved toggle function as well. 

Cat

unread,
Nov 30, 2017, 9:46:48 AM11/30/17
to MIT App Inventor Forum
This would be my approach as a beginner in to this: I would think to draw all the variations (sprites) I want for my graph and use it as a picture object then keep changing that picture with the "one" corresponding to the input received.
Others more experience'd AI2 users might have other in depth approach like drawing pixels ...

Nice work you accomplished by yourself, keep at it!

Sujit Mishra

unread,
Dec 4, 2017, 6:51:14 AM12/4/17
to MIT App Inventor Forum
Thank you sir, your suggestion worked for me. I used different spirtes as a picture object and it corresponds according to my desired input. This group helped me a lot, Thanks to all.
Reply all
Reply to author
Forward
0 new messages