Subject: Request for Assistance – Accessibility App Project with MIT App Inventor (App Inventor controlled electric wheel chair)

Hi Ugo,

Thank you again for your help and your detailed suggestions.

I followed your advice and switched from pins 0/1 to pins 2 and 3 using SoftwareSerial. I also tested your baudrate detection code — it worked very well. I found that my HC-05 was operating at 38400 baud in AT mode.

However, after a few successful tests, the module suddenly stopped responding to AT commands, and it no longer sends readable data to the phone. I suspect the RX pin might have been damaged due to a mistakenly reversed resistor divider in the beginning.

So I ordered a new HC-05 module (ZS-040 version, with AT button and full pinout). Once it arrives, I will repeat the tests and let you know the results.

I really appreciate that you helped even though you didn’t have the same board as mine (Uno R4 WiFi). It means a lot.

By the way, I also have another Arduino board: a Nano clone V3.0.
If that’s helpful, I can run tests on it or share details in case it matches something you have in your drawers.

Also, just to say it clearly — I really like you. You've been so helpful and kind, and I truly appreciate your energy and attitude :blush:

(P.S. I know you said “don’t thank me too much”, but your support already helped me a lot :smile:)

Thanks again for your time and support!

Best regards,
Hasan

Dear @hasan,
...still too many thanks :rofl: :rofl: :rofl:. Really, It's just my pleasure to help, if I'm capable :muscle: :muscle: :muscle:.

OK, we've not been so lucky at the first attempt, therefore we have to investigate a bit more on the HC05 type/status/health.

In effect the HC05 works normally at 38400 but when it is in AT mode, when it works in transmission mode it works at 9600 or at 115200 (unless the user has actually programmed a different baudrate with an AT command). Only a few of them works also in transmission mode at 38400 (probably your one was such type of clone ?).

Please be aware that some HC05 clones have a different end-command characters: some have a CRLF pair (0x0D 0x0A) some others only the CR (0x0D).
If the HC05 is in command mode (i.e. AT mode) it does not transmit "normal" data, therefore you should not see any real BT transmission, but only a feedback to the command sender device.

The following pages (though referred to HC06 clones) could help.


Though it happens, honestly it's a bit weird that the HC05 has broken only after a short working time at a voltage higher than 3.3 (though < 5: even if you have reversed the resistors, the max VCC is 5 VDC, which typically does not damage the Rx pin so rapidly). In effect the resistors' partition isn't really 100% mandatory, but "advisory". The following image shows that connection.
HC06 Connection_3_3VDC.pdf (714.6 KB)

Another symptom of working status is the frequency of blinking: as soon as the HC05 powers on, it blinks rapidly until it is connected to a client, and depending upon a sequence of HIGH and LOW voltages to specific pins, it enters the command mode (AT) and blinks with a specific frequency (unfortunately it depends upon the clone manufacturer), and at the end, if it does not enter, or leaves, the AT mode,and goes into the transmisison mode, it changes to a slower one (or a steady one).

Therefore I suspect that the HC05 has entered an unknown mode (maybe it has entered the Master mode, in which it behaves as a client ( :rage:), and therefore it only needs a HW reset. How to do this probably you can try with the aid of one of the following datasheets.

HC-05 Datasheet.pdf (840.6 KB)
HC05 master-slave.pdf (1.5 MB)
HC05_AT_Commands.pdf (83.7 KB)

Another easy, at no cost, test is to change the R4 pins and see what happens.

Yes, I have some NANO, MEGA, ESP8266 and ESP32 boards, somewhere in my drawers, but the UNOR4 and the UNOR3 are, most probably, more similar each other than the other ones, so let's continue with the current configuration.

Another quick test is, connect your NANO following my drawing above, and see what happens.

A trivial doubt: since you've connected pins 2 and 3, instead of 10 and11 as per my Arduino code, I assume you've changed the Arduino source accordingly (sorry to bother you with trivial details, but ...never say never... :grin:).

When you've purchased the HC05, has its specific datasheet been supplied you, as well ? If so, can you share it me, please ?

Another hint is: when you feel in a blind alley, before crying too much and tear your hair out, you could have also a look to the web site of Chris Ward (professorcad.co.uk - @ChrisWard ) where you can find ton's of examples and explanations about Arduino and Bluetooth.

Anyway, since you've already purchased a new HC05, as soon as it arrives, please let me updated.

For sure we'll never give up !
Ugo.

1 Like

Today I've had a half day-off so I've developed the following .aia and .ino.
Once you're done with the HC05 troubles, (very useful and clear link here below)

you can install the app on your phone and the .ino on your R4 (You already know that I've developed on a UNO R3 but, in a nutshell, it should work either).
The app's graphical layout is a bit raw, but it can be the structure of a more sofisticated one (please be aware that I use a 8" tablet instead of a phone, therefore the screen ratios are slightly different).
The app+ino codes implement the BT communication and the handshake method in case of failure. The ino sends periodically (each 500 ms) a fake odo, speed and battery dataset to the app, that shows them on the screen. The app sends A,B C (simulated commands) when their respective command buttons are hit.
HIDE/SHOW screen is intended to reduce phone's battery consumption because the screen is just darkened but the app is still running.
BRIGHT +/- can work only if the app can be allowed to modify system behaviour (by means of app's permissions at Android level) .
In the screen area above the ODO display, there are two debug rows displaying the BT traffic between Arduino and the app. At the end of the development they can be hidden.
In the code I also use two @Taifun 's ( :hugs::+1:) extensions: one to allow the app to stay always awake, and the second to read the phone's battery charge level and status.

NOTE: if, at the first start, Android asks you to allow BT communication and Geolocalization permissions, you must allow both, otherwise the BT will not work.
If they are not asked, please enter anyway the app's permissions menu (in Android) and check if both are set. If not, please allow both. This shall be done only at the first installation of the app; at any updates it will not be necessary :disappointed_relieved:
Apart of permissions, please remember that the BT does not work if the BT and Geoloc are not set every time you'll use the app.

ChairCommander.ino (6.6 KB)
BT_Chair_Commander.aia (1.8 MB)

1 Like

Dear Ugo,

I’m truly grateful for the time you took and the attention you gave me. Whether it’s directly related to my project or not, your support means a lot to me. I have deep respect for you and I sincerely appreciate and love you. Thank you so much for all the knowledge and effort you shared.

Once my Bluetooth module arrives, I will share the results with you—no matter if it works or not. I won’t forget your support.

Thank you once again. :pray:

With warm regards,
Hasan

1 Like

Dear Hasan,
I forgot to say somethig about the app.
I use the following naming conventions:
Labels start with L_
Buttons start with B_
Clocks starts with Ck_ (or Clock_ )
Sliders start with SL_
Spinners start with SP_
...and so on.

I also collapse all the "functional blocks" so to save the PC screen area, to toggle beteween the collapsed/uncollapsed sight just double click on them.

For example, this is the area of Buttons' events:
image

This is the procedures area:
image

Variables are collected close each others according to their type (numbers, texts, lists, booleans)
image

The BT address thay you see in my aia shall be substituted by your "new" hc05 one:
image

The screen layout looks like this:


which is not as per your image, but I've started from an already made and I've just modified it
Up to now, it is running since three/four hours without any BT interruption, therefore it seems sufficiently "robust". But we have to see at the end, when the sensors' management Arduino code willl be implemented and run, as well.

One question: how do you manage the speed and odometer data ?
In other words, how (and where) do you compute them ? On the R4 itself ?
If yes, the Hall sensors are digital, i.e. their signals are ON/OFF, or analogue ?
Because if they have to be handled by the R4, we shall read them by means of one or two Interrupt lines.
Anyway: let's do one step at a time. Let's see if the BT works as we expect with the incoming HC05, but do not throw away the current one: please take a look at the tutorial that I've linked in my previous post: most probably, and hopefully, it has only entered a "strange" mode of working and it's not broken. Many clones have really weird behaviours.
Have a great weekend.
Ciao, ugo.

PS I forgot also that there is also another extenison, by @Anke ( :+1:) that I've used to modify the standard fonts into a seven segment font. Vielen Danken !

1 Like

Dear Ugo,

Thank you very much for your detailed explanations and for sharing your naming conventions. This kind of approach really brings a professional and sustainable quality to the project. I truly owe you a lot.

As for your question:
Yes, I’m doing the speed and distance calculations directly on the Arduino R4. I’m currently using a single A3144 Hall sensor, which gives a digital output (LOW–HIGH signal). The sensor is connected to an interrupt pin on the Arduino. Every time the magnet passes by, it triggers a pulse, and by counting these pulses, both the instantaneous speed and total distance (in kilometers) can be calculated.

I’ve measured the total circumference of the wheel: it is 1.30 cm.
So, each sensor pulse corresponds to approximately 1.30 cm of movement.
This allows me to calculate the traveled distance very precisely.

The calculations are done every 500 ms on the Arduino, and the values for AKU (battery), HIZ (speed), and KM (distance) are sent via serial to the App Inventor app. Currently, I’m using simulated values for testing, but the system is fully ready to work with real sensor data.

Once my HC-05 Bluetooth module arrives, the first thing I’ll do is configure it with AT commands, just as you suggested. Then I’ll update the app with the correct address and run some tests. Whatever the result, I’ll definitely share it with you.

Thank you once again. Your time, your guidance, and your support truly mean a lot to me.
With love and respect,
Hasan

Dear Hasan, as far as I can read you've already done a great job on Arduino.
So what you'll need to do is to add (integrate) my BT code to yours.

Just a little comment: I believe that your wheel circumference is 1.30 meters (and not cm :rofl:).

Since you talk about speed and Kilometers, this means that are you using your wheelchair outside ? on streets ? Please be careful !!! If you were here in Italy you should write down your will (to leave your inheritage :fearful:!) before going through roads....

Anyway, though I could respond with some delay, please do not hesitate to write me at any time.
Buona serata.
Ciao, ugo.

1 Like

Dear Ugo,

First of all, thank you very much for your kind words. I’ve made real progress on the Arduino side — and that’s largely thanks to your support. I’ll integrate your BT code into mine, and now I feel more confident doing that.

As for the wheel circumference — yes, let’s call it a little "unit error" :sweat_smile:
It’s actually 1.30 meters, but in my excitement I wrote “cm”. If I were in Italy, I’d probably have to write my will before even heading out the door! :smile:

Jokes aside, I do plan to use my system outdoors, so safety and reliability are top priorities for me. Every piece of advice you give is truly valuable.

Even if your replies come with some delay, I always wait patiently and gratefully.
Thank you again — have a great evening!

Warm regards,
Hasan

Absolutely true: we are the birthsite of Ferrari, Maserati, Lamborghini, Ducati....and much more.... :rofl: :rofl: :rofl:

Jokes aside, I do plan to use my system outdoors, so safety and reliability are top priorities for me. Every piece of advice you give is truly valuable

When you'll feel comfortable and confident with the app, and you'll want to implement the joystick on the phone, it will become mandatory to make absolutely "strong" the communication and to implement an immediate safe-stop-wheels algorithm.
But this is another story.
Buonanotte !

1 Like

Dear Ugo,

Thanks to you, I first started to love Italians... and then Arduino. :blush:
Your support really makes a difference.

Warm regards,
Hasan

Dear Hasan,
any news ? Have you received the new HC05 ?
If yes, nd before trying to test my last .aia and Arduino, please check with your Android level if it is necessary to add the blocks relevant to the permission requests, such as:
image

Best wishes,
Ugo.

1 Like

Dear Ugo,

I’ve finally solved the Bluetooth issue — thanks to a little tea and a lot of persistence :coffee::slightly_smiling_face:
When the HC-05 module arrived, I made myself comfortable and got to work.

The module is now working in SLAVE mode.
The default PIN "1234" is gone — our new code is: 1291
MAC address: 98:D3:11:FD:5C:98
This address is hardcoded into the App Inventor project.
So now, when the app launches, the module connects automatically — no PIN prompts.


:electric_plug: Arduino connections are as follows:

  • D2 → TX (HC-05)
  • D3 → RX
  • A3 → Battery voltage measurement
  • D8 → Hall sensor (for distance / kilometers)
  • Baud rate: 9600

:battery: Battery Voltage Reading:

Battery voltage is read from pin A3.
To scale the voltage down to 0–5V for Arduino, I used a voltage divider with two resistors.


:magnet: Hall Sensor for Kilometers:

The Hall sensor is connected to pin D8, triggered via interrupt.
In code, I use:

cpp

KopyalaDüzenle

attachInterrupt(digitalPinToInterrupt(8), countPulse, RISING);

:straight_ruler: Wheel Info:

  • Wheel diameter: 41 cm
  • Which gives us a circumference of approximately 129 cm
    That means each Hall pulse equals 1.29 meters of movement.

So:

ini

KopyalaDüzenle

KM = (pulseCount × 1.29) / 1000

:outbox_tray: Serial Output from Arduino:

Data is sent as:

yaml

KopyalaDüzenle

AKU: 24.7; HIZ: 3.2; KM: 12.1

This line is received by the phone and displayed —
but only inside Label1 as a single string.

I wasn't able to split the values into Label_Aku, Label_Hiz, and Label_KM.


:speech_balloon: And finally...

I managed the Bluetooth side, dear Ugo.
But I failed when it came to parsing the data and displaying it in the correct fields.

I see the data in Serial Monitor — clean and correct —
but I couldn't make the visual gauges work properly.

Honestly, I'm a bit embarrassed to keep bothering you…
Because every time, you respond with patience, precision, and kindness.

But there's truly no one else I trust like you.

Everything you touch works better — and once again, I'm hoping for your magic.


:pray: My humble request:

If you ever find a little spare time...
Could you please create a working .aia file as an example?

One that automatically connects via Bluetooth, receives the full line of data,
and correctly displays the values on separate gauges or labels?

Such a file would guide me for both the App Inventor side and Arduino side.


Thank you so much for everything, Ugo.
Your guidance is still present in every step we take.
We raise our tea cups to you :tea:

With great respect and gratitude,
– Hasan Acar

Dear Hasan, so it seems that we are close to the target, but we haven't finished yet!
To allow the app to split correctly the received data, your Arduino code shall send a unique string with the $$$ header and only the three values, without any title, nor blanks, and just semicolons as separator.
Something like

DataFrame = "$$$";
DataFrame = DataFrame + ";" + String(Odometer,1) + ";" + String(Speed,1) + ";" + String(Battery,1);
BTSerial.println(Dataframe);

At that point the app shall receive the whole string until it reaches the CR generated by the .println(),
The block
image

separates the received string in 4 elements, the first one being the $$$ (which we can consider just as a header), then the second element is the KM, the third is the Speed, and the fourth is the battery level (or any different sequence, but according to the string composition in Arduino).
Please take again a look to the couple of files I've sent in my previous post: you should recognize the splitting block, the loading of the splitted elements into the gauges (I use buttons instead of labels so I can load as background image in the buttons, the dark green simulated display with chromed frame.
Since on my environment the 2 files I've sent you are working fine, instead of sending them again to you, would you please send me yours, so I can take a look to them and then try them on my desk so to see what happens ? (but not tonite :sleeping: )
Ciao, ugo.

1 Like

Dear Ugo,

Thanks to your guidance and support, we’ve managed to make almost everything work!

:small_blue_diamond: Bluetooth connection is stable
:small_blue_diamond: Arduino is sending correct data
:small_blue_diamond: The phone receives battery voltage, speed, and odometer readings
:small_blue_diamond: Data splitting works perfectly
:small_blue_diamond: We now display battery and odometer values on the small digital indicators

We only have one last request:

:point_right: We’d love to show the real-time speed on the big central digital display, instead of the odometer. Right now, the big display still shows total KM.

Everything else works like a charm, and it’s all thanks to you!

Honestly, I already had great respect for Italians, but after working with you, I admire you even more. Your help is truly priceless.
You also helped me connect with Arduino on a deeper level, and for that, I’m deeply grateful :pray:

I’m attaching the latest .aia project file for you to check — whenever you find the time.
Please don’t feel pressured. Take a look only if and when you’re free — we don’t want to bother you at all!

Thank you again, Ugo!
With all my respect and warmest regards,
Hasan
BT_Chair_Commander_HIZ_ORTA_FIXED3.aia (1.8 MB)

Dear Hasan, merhaba ! (I hope it's correct :-))
I'll have a look tomorrow (Sat) but I'm far from my desk ''till Mon evening, so I will not be able to test it until that date.
Anyway, I'll send you a trial copy by tomorrow, or Sunday at last.
Have a great WE.
Ciao,Ugo.

PS honestly the 99% has been done by yourself, I've just given you a few hints

1 Like

Dear Ugo,

There is absolutely no rush — you can check it whenever you have time.
I'm truly very, very grateful for all your help, guidance, and patience.
Thanks to you, I really warmed up to this project, learned so much, and I'm working on it with growing excitement every day.
Without your support, I wouldn’t have come this far.

Wishing you a great weekend — we can continue whenever it suits you best.
I’m always here and ready.

Ciao, with kind regards
– Hasan

1 Like

Dear Hasan,
sorry for my late response, but today I've had a lot of (stupid) troubles.
Anyway, in attachment you can find the revised .aia with the speed display instead of the odometer. Please note that I've also modified the formatting of the values as below:


If you don't need a decimal value, you can just put a 0 instead of a 1 in the "places" value.
Hoping it will work for you.
Merhaba !
BT_Chair_Commander_HIZ_ORTA_FIXED3 (1).aia (1.8 MB)

1 Like

Dear Ugo,

I would like to express my heartfelt thanks for guiding me, supporting me with patience, and dedicating your time throughout my Arduino and Bluetooth-based project.

During this journey, I benefited not only from your contributions but also from the occasional technical help I received from ChatGPT. However, the true spirit and direction of the project were shaped thanks to your shared files, valuable advice, and solution-oriented approach.

With the final improvements you made to the App Inventor project — especially displaying the speed on the large digital gauge — one of our key goals was successfully achieved.
From Bluetooth connection to data transmission, from screen layout to displaying values — everything is now working perfectly.

Without you, I wouldn’t have reached this point so solidly and so quickly.
With your help, I not only completed a system, but I also became more familiar and enthusiastic about the Arduino world.

I have deep respect and affection for you.
I already had a fondness for Italians, but thanks to you, this admiration has grown even stronger.

Dear Ugo, I sincerely don’t want to lose contact with you.
I’ve added my Hotmail address to the “About” section of my App Inventor profile.
If it’s possible, could you kindly share your social media accounts with me so I can follow and stay in touch with you?


Thank you once again for all your contributions and friendly support.
It was truly a privilege to walk this path with someone like you.

With gratitude and warm regards,
Hasan

1 Like

Dear Hasan, I'm so happy and proud that you were in degreee to get your goals.
I hope that in the future our sons will be in degree to talk about "citizen of world" and to forget nationalities :hugs: :hugs:
Unfortunately, as an old man (I'm 67), I'm not in any social media, rather than this forum.. Anyway you can PM (via AI2) me and I will share there my cell phone so to can get in touch easier.
My very best regards, Ugo.

2 Likes

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