Robot wifi arduino

Собираем Wi-Fi робота

Давно мечтал сделать Wi-Fi робота, которым можно было бы управлять удаленно. И вот наконец настал тот день когда я смог управлять роботом через интернет, видеть и слышать все что происходит вокруг него.
Заинтересовавшихся приглашаю под кат

Для создания робота использовались следующие комплектующие:

Вот так выглядит собранный мной робот, без верхней крышки.

Теперь все по порядку:

Сборка платформы робота:

Расположение компонентов на материнской плате. Я установил только Arduino Nano, драйвер двигателей и звуковой излучатель HC:

Роутер wr703N прикрепил к нижней части платформы робота на двухсторонний скотч:

Веб камера прикреплена на мебельный уголок, к штатным отверстиям платформы, предусмотренных для сервомоторов:

СyberWrt — это прошивка собранная на базе OpenWrt и предназначенная в первую очередь для роботов, умного дома и других устройств построенных на базе популярных моделей роутеров Tp-Link mr3020 b Wr703N. У СyberWrt максимально возможный объем свободного места для инсталляции пакетов — 1.25Мб. По умолчанию установлен веб сервер и все операции можно проводить через встроенный веб интерфейс. Сразу после перепрошивки, роутер доступен в сети по кабелю и по WiFi, как точка доступа. Через веб-интерфейс можно работать в режиме «командной строки» — через веб терминал и в файловом менеджере, в котором можно редактировать, загружать, удалять, создавать, копировать файлы и многое другое.

После прошивки роутера, он доступен как WiFi точка доступа с именем «CyberBot», подключаемся к нему заходим на главную страницу роутера. Вот так выглядит веб интерфейс сразу после прошивки.

Устанавливаем модули Драйвер FTDI, Драйвер video и CyberBot-2.

Прошиваем контроллер ардуино.

Код программы робота получился достаточно простым, но его достаточно для того что бы удаленно управлять роботом через локальную сеть или интернет.
Код адаптирован под контроллеры Arduino с ATmega168/328 на борту и использует библиотеку CyberLib.
Эта библиотека помогает из контроллера выжать максимум его возможностей и уменьшить объем конечного кода
В коде используется WDT, для того что бы робот не смог зависнуть.
Так же код поддерживает управление камерой по осям X и Y, но у меня не было свободных сервомоторов и я не смог воспользоваться этой функцией:

Все собрано и прошито, теперь включаем робота и управляем им удаленно.
На PC кроме экранных кнопок можно управлять еще с клавиатуры, клавишами W, A, D, S, X

В дальнейшем планирую научить робота ориентироваться в пространстве и рисовать карту помещения.

Источник

Make a Wi-Fi Controlled Simple Robot Using Arduino © Apache-2.0

This project guide to make Wi-Fi controlled robot with simple functionalities. Follow steps and make your own robot as you wish.

Arduino UNO
× 1
Texas Instruments Motor Drivers
× 1
Chassis
× 1
Gear Motor, Car Tire
× 1
Espressif ESP8266 ESP-01
× 1
Jumper wires (generic)
× 1
Android device
× 1
Battery
× 1

This project guide to make Wi-Fi controlled robot with simple functionalities. Follow steps and make your own robot as you wish. So you can extend your own project by learning this basics (e.g., home automation system). If you want to download PDF file of this post click on button below.

Motor Driver (L298N)

Gear Motor, Car Tire

Let’s start building

First start with motor connection, then connect motor driver to Arduino. After that, configure Arduino and ESP8266. It’s pretty easy and go through following steps.

Connect two gear motors to Motor Driver and check it.

L298 Motor Driver module can handle two motors. OUT1, OUT2 control one motor and OUT3, OUT4 control another motor(there is no order for this. turning direction is decide IN pins). So power supply is simple, as Figure-01. +12v pin is commonly use with GND, for power up module. Also you can use +5v pin to give 5v to module and take out 5v from module. When using 12v battery and Arduino together, you can use +12v pin to connect with battery and +5v pin to give power to Arduino. That is the advantage of this +5v pin. There are four IN pins for control turning direction. As a example, by giving +5v to IN1 pin and 0v(GND) to other three pins, the motor rotate which is connected to OUT1 and OUT2. If you give +5v to both IN1 and IN2 it doesn’t work, because motor try to rotate both direction. Therefore carefully handle IN pins and identify what are the turning directions handled by IN pins.

Connect Motor driver to Arduino and check whether is it work or not.

The wiring diagram showing in Figure-02. You can make it without any effort. So, if you want you can use this

Program ESP8266 module as needed.

This module is use to connect with Android device and communicate with Arduino. For more details about ESP8266 module

. The program for ESP8266 is depend on programming plan. I use client server architecture for implement this system. The Android device is the server of this system and ESP8266, Arduino both are client. So, ESP8266 can program by using Arduino IDE and the program code can be differ according to the functionalities. I use few simple functions such as speed control, turning, bi-direction. However, you can use this

to program ESP8266.

Connect ESP8266 module to Arduino.

The connection is very simple as shown in Figure-03. I use only one connection among ESP8266 and Arduino. And ESP8266 send server data to Arduino through in that connection (ESP8266 Tx –> Arduino Rx (Pin 10)). So the connection is serial connection. Next program Arduino, for read serial data which are coming from ESP8266. Here is

Make sure ESP8266 Vcc connect to 3.3V on Arduino.

Establish communication among ESP8266 and Android mobile.

In this scenario Android device behave as a server. Deploy local server by using portable Wi-Fi hotspot in Android device. Here is

for Android device. If you want you can edit code as preference. So, there is .apk file as well.

Those are the main steps, so the summary is shown below. More details about code is included in each sample code.

Android device – Install android app

That’s all. Feel free to ask any question, regarding to this project.

Источник

From BT To WiFi: Creating WiFi Controlled Arduino Robot Car © GPL3+

NodeMCU ESP8266 in access point mode: the simplest way to make Wi-Fi controlled Robot Car from Bluetooth Arduino Robot Car + Android App.

NodeMCU ESP8266 Breakout Board
× 1
Arduino UNO
× 1
Breadboard (generic)
× 2
SparkFun Dual H-Bridge motor drivers L298
× 2
4WD Smart Robot Car Chassis Kit
× 1
LED (generic)
× 2
Resistor 221 ohm
× 2
Jumper wires (generic)
× 1
battery holder
× 1
18650 Li-ion Battery
× 2
Soldering iron (generic)

In my project Smartphone Controlled Arduino 4WD Robot Car https://www.hackster.io/andriy-baranov/smartphone-controlled-arduino-4wd-robot-car-14d239 I presented a smartphone-controlled Arduino 4WD robot car or Bluetooth Arduino robot. Then I decided to make a Wi-Fi controlled robot car from a Bluetooth controlled one. For this purpose I simply removed Bluetooth module and added NodeMCU with the same wire connections (appropriate Andriod App was already created).

The NodeMCU ESP8266 works in acsess point mode in order to control robot car in open air, where there is not working Wi-Fi network.

How it works. At first we have to make connection to Wi-Fi Robot network and open Wi-Fi Robot Andriod App. When Forward button is touched down smartphone sends get request http://192.168.4.1/?State=F . Then, as we can see in sketch for the NodeMCU:

NodeMCU sends «F» to serial port. When Arduino Uno board recieves «F» via serial port it starts void goAhead():

When Forward button is touched up Robot stops. Basic steps for remaking Bluetooth Robot Car into Wi-Fi one:

  • Remove Bluetooth module
  • Install NodeMCU ESP-12E Development Kit board
  • Upload sketches for Arduino Uno board and NodeMCU board in Arduino IDE
  • Connect wires Tx, Rx, +5v and GND to NodeMCU
  • Install and open Android App
  • Connect your smartphone to WiFi Robot network (without password) and enjoy driving Robot Car!

Step 1. The NodeMCU

This development board for the ESP8266 SoC inside the ESP-12E module is out-of-the-box ready for you to connect it to your computer, install USB drivers, and start writing programs that connect to your Wi-Fi network!

Step 2. Installing the NodeMCU board at Arduino IDE

  • In the Arduino IDE open the Preferences window and enter the URL: http://arduino.esp8266.com/stable/package_esp8266com_index.json into the Additional Boards Manager URLs field, and click OK .
  • In the MENU select: Tools → Board → Boards Manager and scroll down and to choose esp8266 by ESP8266 Community and click INSTALL . Installing takes about 3 minutes.
  • Install the USB Driver (in my case CH340).
  • Restart the Arduino IDE and select our board from the menu option: Tools → Board → NodeMCU 1.0 (ESP-12E Module).
  • Then, we specify the correct CPU Frequency ( Tools → CPU Frequency→ 80MHz) and Upload Speed ( Tools → Upload Speed → 115200 ).
  • Select the correct option for the Port ( Tools → Port → COM5 ).

And now we are ready to upload our sketch for NodeMCU!

Step 3. Uploading sketches for Arduino Uno board and NodeMCU board

Before uploading do not forget to change selection of our board from the menu option:

  • Tools → Board → NodeMCU 1.0 (ESP-12E Module) or
  • Tools → Board → Arduino/Genuino Uno

Step 4. Wire connections

After uploading sketches we can connect Tx, Rx wires to NodeMCU board and +5v and GND wires.

Источник

Робот wifi arduino

ESP8266 Wifi Controlled Robot

Introduction: ESP8266 Wifi Controlled Robot

If you have seen my previous instructable then you know that I built a raspberry pi wifi controlled video streaming robot. Well, it was nice project but if you are just a beginner then you might find it difficult and expensive but for me I already had most of the parts lying around. This is a very cheap wifi controlled robot but it does not stream video. It is built on the ESP8266 platform.

Step 1: Materials Required

1. ESP8266 Board

2. L293D IC or L298 Motor driver board

3. Robot Chassis with Motors (I used 500 rpm motors)

4. Breadboard or PCB (If you prefer to solder)

5. 6v AA Battery Pack or a 9v Battery (To power the ESP8266)

5. A battery (To power the motors)[Which one to choose in step 3]

Step 2: ESP8266 Board — Which One to Pick ?

1. Adafruit Feather Huzzah — It is made by adafruit thus it has easily available instructions and support. It doesn’t come with soldered header pins so you will need a soldering iron to solder them. It has li-po battery charger on the board itself, so it will come really handy in portable projects. It costs $16

2. NodeMCU ESP8266 — It is just the basic board with no extra features but it is open source and has excellent documentation so it will be very easy to get started. But the best part is that you can buy it for less than $4.

3. Sparkfun ESP8266 — It is like the huzzah with the addition of a power switch and an external antenna for a longer Wifi range and it also costs $16

4. Wemos D1 Mini — It is the smallest of all the boards but this doesn’t have any effect on the performance. It has nice documentation and it only costs $4. If you want a longer range and the same form factor then you could buy the Wemos D1 Mini Pro which has a external antenna

Finally, the one I would recommend is the NodeMCU ESP8266 because it has excellent documentation and how cheap it is. If you are building a portable project then I would recommend the sparkfun board because of the external antenna and the built-in li-po charger and sparkfun makes good quality products.

Step 3: Battery — Which One to Choose ?

There are many different kinds of batteries to choose from, you have to select the right one for you.

1. AA Battery Pack — They are the most common type of batteries and are very cheap. Each cell has a voltage of 1.5 volts, we need at least 9 volts, so we would need to wire 6 — 8 cells in series to get 9 -12 volts.

2. 9v Battery — This is also a very common type of battery and also cheap. It has a voltage of 9 volts but the maximum current and capacity is pretty low, so it wouldn’t last long and the motors will spin quite slow.

3. Lead Acid Battery — It is also pretty common as it is used every car out there. It has a voltage of 12 volts, it has the perfect voltage for our needs. It’s current capability is good and has a large capacity. The only part where it isn’t good is the size and weight, it is big and heavy.

4. Li-Ion (Lithium Ion) — It is the type of battery that is used in power banks. It comes in different sizes but the most popular is the 18650 cell. The maximum voltage is 4.2 volts and minimum is 3.7 volts. If you charge or discharge it more than those parameters then the battery would be damaged. A special type of charger is needed to charge these batteries. It has a high current capability and a large capacity and is also very small, only a little bigger than AA battery. But it doesn’t come as pre-built battery packs, so you would have to buy individual cells and create a battery pack.

5. Li-Po (Lithium Polymer) — It is mostly used in quadcopters and drones and in hobby rc vehicles. The maximum and minimum voltage is same as an Li-Ion battery. A special charger is also needed to charge them. It has the highest current capability out of all these and also has a large capacity and is also small. But is dangerous, if you don’t handle them properly they could catch on fire.

For beginners I would recommend a AA battery pack or a Lead acid battery and for advanced users a Li-Po battery. If you want to learn more about comparison between different types of batteries then watch this video made by Great Scott.

Step 4: Assembling the Chassis

I used 4 motors to make it a 4 wheel drive but you can make it a 2 wheel drive by removing the front two motors and replace them with dummy wheels or add a castor wheel. To assemble the chassis solder wires onto the motors and mount the motors on the chassis. If you don’t have a soldering iron then you can twist the wires and attach them with electrical tape but it is not recommended as it will be quite a weak joint. I have mounted the 6v AA battery pack where the castor wheel is supposed to be attached The assembly will be different for every different chassis but is a very easy process.

Step 5: Adding ESP8266 in Arduino IDE

The esp8266 boards don’t come installed in the arduino IDE. To install follow these instructions —

1. Start Arduino and open Preferences window

2. Enter «http://arduino.esp8266.com/stable/package_esp8266com_index.jsoninto» into Additional Board Manager URLs field

3. Open Boards Manager from Tools > Board menu and find esp8266 platform

4. Select the latest version from a drop-down box and click the install button

5. Don’t forget to select your ESP8266 board from Tools > Board menu after installation

Step 6: Finding the IP Address of the ESP8266

1. Open the give code in the Arduino IDE

2. Find where it says «YOUR SSID» and erase it and write your wifi’s SSID (Between the inverted commas) which is the name of your wifi network.

2. Below it, it will say «YOUR PASSWORD» erase it and write the password of your wifi network (Between the inverted commas)

3. After you have made the changes upload the code to your ESP8266 Board

4. Unplug the board from your computer and plug it again

5. Open the serial monitor and set the baud rate to 115200 and choose «Both NL and CR». It will say «wifi connected» and will also show the IP address. Note down the IP address because we will need it later.

Attachments

Step 7: Circuit

The circuit is very simple. Instead of the AA battery pack you can use any other type of battery.

Gnd — Battery Negative

Both the AA battery pack and 9v battery should have a common ground connection.

Step 8: Programming

Open the given code in the arduino IDE and write you wifi network’s SSID and password like I shown you before then upload the code to your ESP8266 Board.

Attachments

Step 9: Installing the Control App

This robot is controlled through an app, download the ESP8266_robot.apk file and install it on your smartphone.

There is also the .aia file if you want to make any changes to the app.

Attachments

Step 10: Controlling the Robot

Open the app and write the IP address of your ESP8266 Board and now you will be able to control it .

If the motors are spinning in the wrong direction then just interchange their connections to the L293D or interchange the control pins. The ESP8266 connects to wifi through DHCP, meaning that almost every time you connect it will have a different IP address, so you will need to check the IP address every time.

Step 11: Some Pictures and Videos

It is very fast with a 12v battery, but if you think that it is too fast then you can lower the speed, first find the ENB pins in the code, you can write 0 to 250 instead of HIGH to set the speed. For example, «analogWrite (leftMotorENB, 170)»

If you liked this instructable please vote for it in the contests :)

Источник

From BT To WiFi: Creating WiFi Controlled Arduino Robot Car © GPL3+

NodeMCU ESP8266 in access point mode: the simplest way to make Wi-Fi controlled Robot Car from Bluetooth Arduino Robot Car + Android App.

NodeMCU ESP8266 Breakout Board
× 1
Arduino UNO
× 1
Breadboard (generic)
× 2
SparkFun Dual H-Bridge motor drivers L298
× 2
4WD Smart Robot Car Chassis Kit
× 1
LED (generic)
× 2
Resistor 221 ohm
× 2
Jumper wires (generic)
× 1
battery holder
× 1
18650 Li-ion Battery
× 2
Soldering iron (generic)

In my project Smartphone Controlled Arduino 4WD Robot Car https://www.hackster.io/andriy-baranov/smartphone-controlled-arduino-4wd-robot-car-14d239 I presented a smartphone-controlled Arduino 4WD robot car or Bluetooth Arduino robot. Then I decided to make a Wi-Fi controlled robot car from a Bluetooth controlled one. For this purpose I simply removed Bluetooth module and added NodeMCU with the same wire connections (appropriate Andriod App was already created).

The NodeMCU ESP8266 works in acsess point mode in order to control robot car in open air, where there is not working Wi-Fi network.

How it works. At first we have to make connection to Wi-Fi Robot network and open Wi-Fi Robot Andriod App. When Forward button is touched down smartphone sends get request http://192.168.4.1/?State=F . Then, as we can see in sketch for the NodeMCU:

NodeMCU sends «F» to serial port. When Arduino Uno board recieves «F» via serial port it starts void goAhead():

When Forward button is touched up Robot stops. Basic steps for remaking Bluetooth Robot Car into Wi-Fi one:

  • Remove Bluetooth module
  • Install NodeMCU ESP-12E Development Kit board
  • Upload sketches for Arduino Uno board and NodeMCU board in Arduino IDE
  • Connect wires Tx, Rx, +5v and GND to NodeMCU
  • Install and open Android App
  • Connect your smartphone to WiFi Robot network (without password) and enjoy driving Robot Car!

Step 1. The NodeMCU

This development board for the ESP8266 SoC inside the ESP-12E module is out-of-the-box ready for you to connect it to your computer, install USB drivers, and start writing programs that connect to your Wi-Fi network!

Step 2. Installing the NodeMCU board at Arduino IDE

  • In the Arduino IDE open the Preferences window and enter the URL: http://arduino.esp8266.com/stable/package_esp8266com_index.json into the Additional Boards Manager URLs field, and click OK .
  • In the MENU select: Tools → Board → Boards Manager and scroll down and to choose esp8266 by ESP8266 Community and click INSTALL . Installing takes about 3 minutes.
  • Install the USB Driver (in my case CH340).
  • Restart the Arduino IDE and select our board from the menu option: Tools → Board → NodeMCU 1.0 (ESP-12E Module).
  • Then, we specify the correct CPU Frequency ( Tools → CPU Frequency→ 80MHz) and Upload Speed ( Tools → Upload Speed → 115200 ).
  • Select the correct option for the Port ( Tools → Port → COM5 ).

And now we are ready to upload our sketch for NodeMCU!

Step 3. Uploading sketches for Arduino Uno board and NodeMCU board

Before uploading do not forget to change selection of our board from the menu option:

  • Tools → Board → NodeMCU 1.0 (ESP-12E Module) or
  • Tools → Board → Arduino/Genuino Uno

Step 4. Wire connections

After uploading sketches we can connect Tx, Rx wires to NodeMCU board and +5v and GND wires.

Источник

Adblock
detector