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.
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.
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.
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.
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.
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?