@@BytesNBitshi, I have a problem, when I open mit app inventor companion and click ,,scan for device", there is nothing there and I connected my phone to bluetooth module as you said. Can you please help?
@@BytesNBitshi, I managed to overcome this problem where no devices were found, but unfortunately another one came across, when I click on hc 05 it says error 507:unable to connect. Is the device turned on. Any help?
I echo the comments below: As a career software developer, this message management is both elegant and very solid, not to mention expertly explained. I'm brand new to Arduino world as well as just starting to think about Android App development so this tutorial was excellent to find. Definitely subscribed!
You might want to replicate the way the NEO-6M handles NMEA serial messages and add a checksum to the end of your messages. If you use the same message format, you could use the same code between other serial devices. I'm currently working on a GPS speedometer for my Yamaha Virago but taking a break to work on my smoker. This video has been very educational as I want to use BT to control the temperature of the smoker from my smartphone. I should be able to use my GPS sketch with slight modifications for the BT interface.
This was a very helpful tutorial. Thanks! Question, does the MIT App Inventor app run off-line (without a Cellular connection)? I have a use case in mind which involves being out of cell coverage. It shouldn't need it but you never know with some apps...
I meant to add, for timed interrupts or events, I use the Watchdog timer say set to 250mS. You could count 4 interrupt events for 1S. ,or any combination to suit your project. I have never used millis().
Thanks for the video sir... Plz make a video on how to store the data received from Arduino (analog read data) to a text file and store the text file in a shared folder like Documents of internal storage... I am trying for this but not successful...
This video is a great tutorial! I am new to arduino and android app design. I'm trying to get the value of the slider and pass it to arduino as character. I'm using the slider as a speed control to my arduino bluetooth controlled car. When the slider is slide to the right it increases the speed and when it is slide back it decreases the speed. Hoping for a suggestion or idea. Thank you! By the way i like the way you code. You use naming conventions and it is helpful in tracing or tracking the components.
Hi. The sliders in the video should show you how to get a value passed over Bluetooth. After that it's a matter of using that value to control the motor speed. What sort of motor control are you using?
Thanks for the great video!! Always wanted to learn how to create a data protocol. Is there a suggestion on data protocol if there are 2 slave nodes trying to transmit data to 1 master node?
Hi. I guess the main issue here is working out a way of controlling who has access to the main node. You'll need some sort of polling scheme to allow a slave to request the comms channel. After it's got control of the comms the protocol can be whatever you want.
I had written software back in the late 80's that communicated in grocery stores to managed FM-based price checking devices. Multiple terminals communicated with my master app to query a database. Part of the message stream included a 1-character poll ID and a 1-digit message counter 0-9. The master app and each device kept track of which message counter number was expected per Polling device so we could ensure we stayed in sync.
Thank you so much for the video sir. I would like to also produce 1sec sounds when pressing a button on the screen. Which components do you advise me to get?
You've got a choice. The easiest is to use a simple on/off buzzer or tone generator. You simply turn on an output connected to the device and you get a sound, but you can't control what it sounds like. If you want to play sound samples or controllable tones you'll need a speaker which you'll have to drive with a voltage signal from the Arduino. There are a number of ways to this so your best bet is to look for a tutorial. I haven't made one for the Arduino. I hope this helps.
Hi Guys. I'm just grateful that you're all taking the time to watch them. The channel is growing quite well now so I'll be keeping up with the videos as more people find it. See you in the next one!
This is great! Hope you make other projects like this. I'm trying to modify the app to send a command by using a list picker to make the LEDs blink but it seems that the arduino doesn't recognize or receive the command. I replicated the format of the command by using the same start and end token like this "?e=1;" and print it on the serial monitor but it doesn't even print the "message start". Please help :/
@@BytesNBits I did. I just copied the code for decoding messages and edited some parts. But the main problem i think is the serial comms. The text message from the app is not printing on the serial monitor. I added a list picker to the app which will send a code "?e=" + selection + ";" but the serial monitor doesn't even print "message start". What do you think is the error? I am new to coding and I am out of ideas.
@@EmCarloJacob Can you get the arduino to simply print out everything it receives. Then get the app to send some characters on a button press and your list picker. This should confirm of the list picker is actually sending any characters. If none are being sent have a look at the app documentation on how to use the list pickers. Usually there will be an event or trigger when the list value changes. You'll need to use that to send the message, or use a button press to read the list picker value and send that.
Hello and thanks for your effort. In my case this application only works if I have AI Companion open. If I run app alone from my Samsung phone does not work. Can you help? I made only the part with Bluetooth connection and I try to connect to my Bose speaker. Does not work, app does not find anything when I click on Scan for Devices.
The code in the video works at a very basic level. Various Bluetooth devices identify themselves and their functions and I don't think the Arduino code can recognise all of them, just the basic device type. You should be able to upgrade the code to handle more complex devices but I haven't tried that myself.
@@BytesNBits In order to be able to detect HC05 Bluetooth, after installing the application in the phone, we must navigate in the phone settings and find our application in the Application list. Then tap on our application and then in Permissions we must grant access to nearby devices.
Hi. I tens to have a project page for each video - link in the description. You'll find the code there. bytesnbits.co.uk/arduino-bluetooth-control-mit-app-inventor/
i have tried the block "Bluetooth connectivity" but when I connect it through AI2 companion, open Bluetooth on the app and there's only black screen ( I have connected to HC-05 before and tested it on some applications and it worked), can you help me pleaseeee
@@BytesNBits thank you for replying me :)) i solved it, still dont know what the propblem is, but now i can select and connect to HC_05, thank you for clear tutorial, Sir.
The String class is just a standard data type in the Arduino system. You shouldn't have any issues with using it. www.arduino.cc/reference/en/language/variables/data-types/stringobject/
Thanks for the prompt reply. So I am wrong to assume that the text needs to turn green if it is being recognized by Arduino IDE as a reserved word with a specific purpose. I am certainly OK with that. I was just concerned that my later version of Arduino IDE meant something had changed.
Hi. You can buy NFC readers that use the SPIO channel to talk to the Arduino. This will let you read the id card so you can lock / unlock. e.g. www.ebay.co.uk/itm/354109727290
Hi. You basically need to get the Arduino to compile the sensor data into some sort of formatted text stream (usually people use JSON or XML). This gets sent to the phone as in the video and then gets decoded.
Sir ,i try to do an application but i needed more one screen in Bluetooth app. So i do what you do in my first screen . But in other screens the module doest response the ordes .but just from the first one.what is the problem?
Hi Eric. I haven't used the Adafuit device. Usually they use the same libraries as other Arduinos so the communications link should work the same. It's then down to you to create a mini language to describe the servo positions and other data that the app and feather wrong can use to talk to each other. I hope this helps.
Hi. The app on your phone is really an input device to your code on the Arduino. Use some of the selector objects on the app to create a date / time selector and then have that data sent down to the Arduino. Your code will have to interpret this data and then take the appropriate timing actions. Remember the basic Arduino doesn't have access to real world time so you'll need to build that into your code as well.
@@thiensuutv1286 I don't have any examples to show you. The video shows you how to use the app creator tools to create a control and then how to send a message to the arduino. You need to have a look at the other controls in the app maker and then expand upon the message system to send the data you need. Have a look at the documentation on the various controls. Send a time value with the message so the arduino knows what time the message was sent. You can then use one of the in built timer functions to keep track of time from there. Not a very accurate solution but gets you started.
Hello! I commented on your other video where you redirected me to this one. My idea is simple because all the output I have from my phone is a 0 or a 1, so how would I go about making my arduino code? Would it be something simple like: if digitalread(rxPin) == 1: myServo.write(90); else: myServo.write(0) Do you think this should work?
Did you want the phone to talk to the Arduino so that you press a button on the phone which tells the Arduino to start the motor? If so you'll need to modify the project in the tutorial to get the button press passed over Bluetooth to the Arduino. Once you've got the signal on the Arduino you can then test the value and do the appropriate action. I hope this helps.