How to connect ESP8266 and HC05 ?

Hi, I want to make an iot project using Bluetooth module (HC05) and wifi module (esp8266) connected to an arduino uno , the project wait for a mobile to connect with one of the two module ( Bluetooth or wifi ) then it runs the part of the program to control a led using the module that is connected with the mobile

For that i need the code to do this and how to connect the two models

aymannox:
iot project using Bluetooth module (HC05) and wifi module (esp8266) connected to an arduino uno

This sounds like the Uno is not only redundant, but also makes things more difficult.
An ESP 32 will do it all and has a display as well.
If you don't want local display, there is probably something similar that has just WiFi and Bluetooth.

I think in the esp32 you can't run the wifi and Bluetooth model at the same time

By the way i need the code to do this and how to connect the two models

WiFi and BT uses the same 2.4Ghz band, so you can't use them 'at the same time' anyway.
Leo..

aymannox:
I think in the esp32 you can't run the wifi and Bluetooth model at the same time

I submit "at the same time" is a relative term. It appears that you have options to use them, and therefore options not to, i.e. their use is programmable. Having said that, no code, I'm afraid. I haven't used at all mine yet, as I'm still working on my NodeMCU, and incidentally, I realise ESP32 is actually a side issue, and, since there is already an HC-05 to hand, retiring the Uno and just using ESP8266 is surely another option for OP. .

Wawa:
WiFi and BT uses the same 2.4Ghz band, so you can't use them 'at the same time' anyway.
Leo..

So i can't connect the ESP8266 with hc05

There should be nothing to stop you from using ESP8266 with HC-05. There is a swag of ESP8266 modules out there. The only one I have is a NodeMCU, which is an obvious choice for this sort of thing, but I understand you already have an ESP8266, so you just need to ensure that it has sufficient pins available for serial connection - in addition to whatever else you want to do..

If you don't already have it, here is the boys' wonder book

https://tttapa.github.io/ESP8266/Chap01%20-%20ESP8266.html

I already have a nodemcu and a hc05 , the question is how to connect and code them to solve my problem

Your "problem" is actually far from clear - particularly as far as your intended use of Bluetooth is concerned, not to mention the Uno. Now that, for the first time, we find you have a NodeMCU, it might be a good time for you to re-state what you want to do.

As for connecting HC-05 thereto, NodeMCU has serial Rx/Tx pins pretty well just like any other Arduino. The only thing faintly unusual is that you might need to find 5v power for HC-05.

My guess is that you want to aquire data from some device via bluetooth and regurgitate to IoT via WiFi.
Data in
Bluetooth background and also
IoT
and more

Nick_Pyner:
My guess is that you want to aquire data from some device via bluetooth and regurgitate to IoT via WiFi.

No

The image is the best way to explain :slight_smile:

WiFi Terminal
Bluetooth terminal
HC-05 to D3,D4 on NodeMCU.
You may want to do this as an intellectual exercise, but it is rather pointless.
Arduino is redundant

I need to use the Arduino because i want to use an LCD 16x2 , two stepper motor drivers and some leds .

I need to use the Arduino because i want to use an LCD 16x2 , two stepper motor drivers and some leds .
You still did not help me in my problem :frowning: , because this project is my final year project

Really? And there's me, and probably everybody else, thinking you were a complete beginner just playing around for no real purpose, and waiting to be spoon-fed...

aymannox:
I need to use the Arduino because i want to use an LCD 16x2 , two stepper motor drivers and some leds .
You still did not help me in my problem :frowning: , because this project is my final year project

Rather pathetic that this person has no clue on how to complete his final year project.

.

He is probably lying, or is in this position because he has been spoon-fed all along - quite likely the former, and expecting the latter. I have long suspected that, if all these clueless and barely coherent "final-year students" and "engineering PHDs" we see around here are actually what they claim to be, the world of our grandchildren is already in deep, deep shit.

I'm here to learn and strengthen my knowledge, is not it right for a beginner to ask for help !

By the way , what do you think if i connect the HC05 to an arduino uno and the nodemcu to another arduino uno and then connect the two arduino using i2c

Nick_Pyner:
He is probably lying, or is in this position because he has been spoon-fed all along - quite likely the former, and expecting the latter. I have long suspected that if all these incompetent and barely coherent "final-year students" and "engineering PHDs" we see around here are actually what they claim to be, the world of our grandchildren is already in deep, deep shit.

Our grandchildren are already in deep, deep shit because work has gone overseas to India, China etc. because it is "cheaper".
And we are helping these people do the work!

I refuse to do that anymore!

.