Help for beginner: Sensor display on Android phone

I'm currently doing a project where I'm using a capacitive sensor (DFRobot Gravity Non-contact liquid level sensor) to detect when water/fluid fills past a certain level in a container. The sensor is located outside of the container and an LED will light up when water has filled past the sensor. The coding for this part is as follows:

/***************************************************
* Liquid Level Sensor-XKC-Y25-T12V
* ****************************************************
* This example is to get liquid level

* u/author jackli(Jack.li@dfrobot.com)
* u/version  V1.0
* u/date  2016-1-30

* GNU Lesser General Public License.
* See <http://www.gnu.org/licenses/> for details.
* All above must be included in any redistribution
* ****************************************************/
int Liquid_level=0;
void setup() {
 Serial.begin(9600);
 pinMode(5,INPUT);
}

void loop() {
Liquid_level=digitalRead(5);
Serial.print("Liquid_level= ");
Serial.println(Liquid_level,DEC);
delay(500);
}

However, I also intend to use an android app (open to any suggested app) along with the HC-05 Bluetooth transceiver to display this sensor LED status on my phone. Can I get help for the coding with regards to this part? I'm completely new to Arduino coding.

Kai Morich's [Serial Bluetooth Terminal] is a good phone app.
(https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal&hl=en_US&gl=US)

Any program you write to send information to the Serial Monitor can be used to send information to the HC05 BT module.

After your program is loaded to the Arduino, you can connect the HC05 to the hardware serial pins 0/1 and the message from the Arduino will be sent to the monitor and the phone. Serial Input to the Arduino(which you may not require) will only be available from the phone.

1 Like

Hi thanks for the reply! Will look into this and update u if it works

Further to Cattledog's comprehensive post, I submit that, if you are serious about a half second loop and view it live, you may be better of using a graphic terminal instead of Morich. I use that by CETIN. It also logs plain-vanilla text.

1 Like

Hi axlecky.
Are you interested in building your own Android phone app?

A very small app would achieve what you want to do. All it has to do is make the BT connection then continually read any data arriving via BT and display some symbol to indicate the level sensor status. There are lots of examples to guide you.

Most people use MIT App Inventor to build apps.

1 Like

Hi thanks for the reply! Do you have any links to these examples?:slight_smile: Thanks in advance!

Thanks! Will look into it as well:)

I did a quick search on "Arduino App Inventor Bluetooth app". The examples I found were more complicate than you need.

Take a look at this one:
BT app example

You could also search the Arduino forum as other people have discussed Arduino,BT & apps.

Your main task would be to learn MIT App Inventor. The app itself for your needs would be quite simple. That said, you still need to learn App Inventor.

Maybe follow Nick's & cattledog's advice first might be the best way to go.

1 Like

It might save you from reinventing the wheel(!)

1 Like

thanks!

I've built an app to do what you want. It's simple enough. The screen at startup and the blocks are posted below.

But I must admit, I've been using App Inventor for over 12 months and when I started the concepts and terminology were confusing. Can be enjoyable though.

I haven't tested it. There'll probably be a bug or two. Can you make sense of any of it? Does it encourage you to dip into App Inventor?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.