Need help with ESP32 Servo control app

You might be able to use a couple of solenoids, if you copy the internal toggle mechanism of a wall mounted light switch.

image

Thought about that option indeed...
But first want to try it out with servo cause they are cheap...

Greetz

So its possible to help me out?
I am thinking the only things i need.for making the app is how to make the servo connect to the esp and make it work with bluetooth?
Then i need to make the app working so help with both is much appreciated

Thanks

I mean something like this... Only then with out the blue tooth module and in place there for a Esp32

Yes, there is no need for stepper motor precision, I think the same. I haven't used the bluetooth yet neither on the esp32 or the appinventor, so I cannot help on that, but if you choose the WiFi route I can. Although, indeed the BT would be the easier one.

Dear @martijn_vd_brakel and son ( :grin:), the annexed .aia works for me with an ESP32 and a Xiaomi phone (Android 9).
It operates on classic BT.
The app has 3 buttons and sends accordingly 'A' 'B' 'C' to the ESP via BT.
The .ino file is the ESP32 counterpart.
The ESP shows on the Serial Monitor of PC the received character and sends it back to the app (closed loop). The app shows the feedback character received.
To make it working, first of all you have to "pair" your phone to the ESP32 (in phone's BT settings).
In my app's code the IP address of my ESP32 is fixed as a text constant, you shall substitute this address with the one of your ESP. If you dont know it, you can download the Serial Bluetooth Terminal app from google playstore (free).

Therein, by selecting the menu "devices", you have to find ESP32_BT in the shown list and annotate the address, that you have to copy into the app code instead of my address.
Then recompile the app's code, download the apk to your phone and launch it.
Of course your ESP shall still be connected to your PC with the option Serial Monitor active (baudrate 115200).
That's all !
BT_to_ESP32.aia (24.9 KB)
BT_Send_Monitor.ino (1.8 KB)

Note: whether your Android is (most probably) a newer version, i.e.>= 12, you shall ask for permissions into the initialization event. You can get info about this requirement here:


or here:

About ESP32 and servo, you might have a look at:

Credits: @Taifun for his "TaifunTools" extension used to maintain active the screen and don't allow it to go to sleep, until you exit the app.

Best wishes for your project.

1 Like

found this and here you see the HC-05 in the beginning....
going to read if there is some explanation about how to use the ESP32 instead.

sadly your code for arduino does not work and the app stops working on my phone...

is this code for the HC-05 module ? cause its looking there is some comment in the code about that module...?
greetz

Start from the beginning.
About the hardware.
How many servo do you want to controll with the ESP32?
Do you already have the circuit (for example: which pins do you use on the ESP32)? The ESP32 is a 3.3V device. The S90 servo is a 5V device. Not sure if the servo works without level shifter.

First, try to build @Juan_Antonio Wifi example:
https://community.appinventor.mit.edu/t/esp32-wifi-webserver-led-on-off-static-ip-soft-access-point/9323/3
Tell us if you need help with this.

ESP32_BT_Monitor.ino (1.4 KB)

OMG I've annexed the wrong file.
This one is for ESP32... :grimacing:
Apologise.....

Will take a look at that....
Thanks
I am going to use the ESP32-C super mini that can handle 5V.
I see this board has a TX and RX pin onboard, maybe its possible to use the code for the HC-05 module ?in the tutorials that i can find about using MIT with esp32 Bluetooth the HC-05 is attachted to that pins ...

hope to hear

Found a simpler solution i hope

This might be a way to try out and see if it works...
Only the thing is i need.to.find.room.in my project to get the module in but for testing learning and playing with MIT app it will be a good way i hope...
Ill keep u posted

GreetZ

Martijn

Yep, that tutorial seems pretty good.
Just let me highlight that the Tx pin of HC05 shall be connected to the Rx Pin of ESP (and Rx to Tx).
If you use the Super Mini ESP that has I/O at 5 V instead of 3.3, please be careful to connect the HC05 Rx pin with a voltage divider:
image
(don't care if in the image you see a Nano and a HC06: the same applies to HC05 and any Arduino board featuring a 5V I/O). This requirement is NOT mandatory, but the Rx pin of HC05 will appreciate your care :grin:
Cheers, Ugo.

Where is that came from? I suggest you to read that datasheet again.
BUT if you use the HC05 it does not matter, because that work with 3.3 too.

5v is on left top connector on the esp32c3 see picture above in this post

Greetz

Yes. But that is a power rail pin. There is a voltage regulator on that board that regulate the 5V to 3.3V because the ESP32 is 3.3V device. So the output pins also provide only 3.3V.
Do you see that 5 pin IC?


That is the regulator:

ME66211 3V3
Not sure it is the same type on every manufacturers board but it is a 3V3 regulator.

1 Like

I agree with @Usane,
typically the 5 V is the input supply to the board, then the voltage regulator "creates" the 3.3 which is also supplied on the relevant pin, and therefore used to supply an external device @3.3 Vdc.
Furthermore, for sake of my own knowledge, I've searched on the web a data-sheet of the Super Mini, and I've not been able to find a confirmation regarding the 5 Vdc I/O capability. To solve this doubt, if you have on your desk a Super Mini, you can supply it with a +5Vdc, then write a HIGH to a digital output (i.e. GPIO0) and measure the output voltage with a DVM: you shall then read or 3.3 or 5 Vdc.
Therefore, if the output voltage is 3.3V, for a better space utilization and less wiring, you can forget the Super Mini and use a Mini ESP in which the BT is included,
The chunks of code (Arduino and AI2) that I've sent you are working fine for me, I've tested them before posting, so if you have an ESP32 and a phone, or pad, you should be in degree to use them (once Android >=12 permisions granted).

1 Like

Thanks both for your input..
I will try out the Hc-05 way first cause therefore is enough tutorials.to find (good for me as " slow" arduino C learner, and then will go on trying out other ways.
Hopefully this week my new Esp32 boards will come in cause the last 2 Chinese boards things dont work...
@uskiara What esp mini do you mean ?

Thanks again
Greetz
Nb i made an example app following a tutorial for MiT servo to try out

Dear @martijn, for example this one:

(Amazon Italy 'cause I'm Italian :grimacing:).
Ciao !

Thanks Us,

I know this ones, even think i have them lying around somewhere...
Question the esp32-C3 supermini has bluetooth onboard i think ?

greetz