An overview of the Strela robotic platform or a do-it-yourself simple bluetooth bot
Recently, we received a gift for our workshop from one of the leading manufacturers of electronic training kits in Russia - from Ampery . The Strela board is a new development of the company and they suggested that we try to apply it in real conditions.
The main idea of ​​the Strela platform is the rejection of the modular principle of building a robotic Arduino project. Instead of a set of shields, Ampere offers to use one universal board, which implements the functionality of many shields.
')
In the article, I offer you my view on what came out of it, and tell you how we built our bluetooth-controlled robot from an Android smartphone. I tried to be as impartial as possible, but a certain amount of subjectivity, of course, is present.
Prehistory
I teach special disciplines in the radio engineering college and in my spare time I work with students on project activities. This can not be called a circle in the usual sense of the word. I just have a group of young people who, individually or in very small groups, work on what they like. Someone is engaged in 3D printing, someone copters, someone programming, etc. That is, I have an idea about teaching people how to practice electronics.
At the main place of work, I professionally develop electronics and have extensive experience working on real iron projects. I can express my impressions not only as a teacher, but also as an engineer. When I was offered to try to use the Arrow in my work and share my experience, I, of course, immediately agreed. Everything Amperka gave us, I handed over to one of my students, who became interested in the task, and this is what he did:
So, we proceed to the description of the components.
Strela
The Strela platform is an Arduino-compatible board, fully prepared for building robots. It was developed by Amperka and combines almost everything that may be needed to quickly build a robot. Built on the basis of the controller Atmega32u4 and work with it is necessary, as with the Arduino Leonardo. She came to us in such a box:
In general, Amperka is attentive to packaging. All their products are neatly packaged in specially designed boxes. First of all, they are guided by a rather young audience and, I think, it is pleasant for the guys to receive their purchases in this form, and not wrapped in a bubble film.
In the box, the board itself:
At first glance, I was surprised that there was nothing in the box except for the board. Later, when I started working with the board, I returned to this thought more than once, but I couldn’t think what else could be in it. There is really a lot of stuff already installed on the board, but getting some cheap bonus bonus is always very nice.
The board itself with the front ...
... and from the back:
Here are the main characteristics of the board: Nutrition
Input voltage: 7-24V. From the same voltage, the motor driver is powered;
Built-in pulse stabilizer for 5V, 3A. The board itself consumes very little, that is, all this can be used to power the connected elements (sensors, servo drives, etc.);
3.3V Linear Stabilizer for powering communication modules;
Powered by USB. Strela is equipped with a comparator, which, when the main power is disconnected, automatically switches to power from the USB port. The load capacity of the 5 volt channel will drop to 500mA and the power outputs to the engines will stop working.
Board Mounted Peripherals
Engine Driver L298P;
Piezo emitter without built-in generator. Can be used to play an arbitrary melody.
RESET switch. That is exactly the switch. It essentially serves as a circuit breaker. You can turn off the board if you put an external power switch on the power supply, or you can simply “turn off” the microcontroller with the RESET switch;
Four user buttons without latching;
Four custom LEDs;
Ten indicator LEDs for engine, power and transmission lines status.
Connectors for external elements
Two terminal blocks for connecting two DC motors for 2A, or one powerful for 4A, or one stepper motor;
12 standard three-pin PLS-connectors (GND, 5V, SIG). They can connect a variety of sensors, servos, etc. Eight of them can work as analog inputs and 4 as PWM outputs;
Connector for installation of communication modules. All the necessary binding is already on the board - all that remains is to install the necessary module of the XBee format;
Connector for connecting an IR receiver for remote control via an optical channel;
Connector for connecting liquid crystal displays;
Interfaces TWI / I2C, SPI, UART.
I hope the reader will forgive me for a free retelling. All specifications can be found on the wiki . Today, robot builders most often use the modular principle. That is, they have to buy individually almost all of these functions, and then combine them together.
Approximately our robot made on shild would look like this:
Strela includes several devices that are usually bought separately - Arduino, engine driver, voltage converter and breadboard for prototyping. This is the main idea of ​​the board and it has two sides. On the one hand, if you try to buy all these functions in the form of separate shields, you will get much more expensive and larger in size. That is, if, for example, to plan the purchase of equipment for the class of robotics, then Strela becomes profitable even from an economic point of view.
On the other hand, if there is a specific project that is conceived on Arduino and all components of the system are known in advance, then most likely it will be possible to get by with one or two shields and get a gain in both cost and size. It seems to me that the use of the platform will be justified in the framework of the circle of robotics. You can constantly rearrange it on different robots, quickly add features, etc. In the video review from Amperka, they generally built a robot in which they implemented almost all the functionality at the same time. Strela may also be of interest to people who are knowledgeable in programming, who needed relatively simple hardware in their project. Strela fits perfectly as a performer of the telepresence robot teams or will help breathe new life into a broken RC model.
Summing up this part, I want to list the pros and cons of the board. So, here is what I consider the virtues:
Outwardly, one board looks better than a set of shields. At a minimum, it will stand out from other robots;
Fewer connections will have to be done by mounting. Easier assembly, higher reliability;
The mounting holes on the board repeat the hole pattern on the Arduino Uno and there are four additional holes;
Detailed documentation with a huge number of examples (I will add the main links at the end of the article);
Library to work with the board. We will talk about it later on separately;
The box.
But the fact that I personally did not like:
Very often, the circuitry is made without a margin of safety. But is extreme reliability in home robotics necessary?
I do not like white mask. I understand that with her the boards look more interesting, but nothing is visible under it!
The 5-volt part of the board is powered from a single power source. I would make separate stabilizers for the digital and power parts;
Still, the board according to my standards is large - 100x80mm. Big and all;
Strela is incompatible with the Arduino shields. There is no standard seat for this;
On the configuration I have already said.
That's how much this board is worth now. It is difficult to say a lot or a little. It may well turn out that it is cheaper to build a robot from scratch than to assemble shields. In my experience, the price is fair. This is exactly the cost of electronics, if you develop it in Russia, sell it officially and organize large-scale technical support.
It is quite large and is suitable for Strela in terms of engine power and the number of batteries in the built-in battery holder. It already has attachments for popular sensors and sensors.
Bluetooth module, sensors and indicator
In addition to the controller and the wheel platform, we were presented with many more useful pieces:
The Bluetooth Bee module is platform compatible and very easy to use. It is connected to the controller via the UART, and the operating systems see it as a COM port. Probably the easiest way to connect something to a PC / smartphone without wires;
8x2 text screen . It is very convenient if the robot can show some status messages, especially since this display also supports the Russian alphabet;
Two analog line sensors for building a line-tracer. Included with them are the usual three-core cables for connection;
Two infrared obstacle sensors . At its output, either zero or one, depending on the set trigger threshold and the measured distance.
Build a bluetooth bot
To quickly check the capabilities of the system, we decided to assemble a robot controlled via bluetooth. For a basis, we took an example from the wiki by Strela .
For this, the Strela platform itself, as a controller, communication module, wheel platform and battery, will suffice. We decided not to use the battery compartment. Instead, we connected a 11.1V, 3A / h LiPo battery. Additionally, we also connected an indicator.
Here's what we got in the end:
As you can see, the entire assembly comes down to assembling the chassis , fastening and connecting the boards, and connecting a dozen wires.
This is where the whole build ends and programming begins.
Arrow Programming
The attentive reader might have noticed that the number of “legs” that Strela manages is significantly greater than that of the Arduino Leonardo. For only one LCD, they need eight pieces. All this is implemented and works simultaneously through the use of port extenders, managed through I2C. Using the capabilities of these extenders would be quite difficult for a beginner if it were not for the ready-made Strela library.
Electronics developers often neglect packaging, documentation, and software. But this does not apply to Ampere. There are lots of ready-made examples for the Strela board and an excellent library. It has only a few functions for working with digital outputs, but without them it would be very difficult to make all possible peripherals work simultaneously. They are as simple as the standard Arduino functions. Their use allows not to go into the details of using the I2C bus, otherwise it took much longer to start working with it. On Strela changed the designation of the conclusions in relation to the Arduino, but there is no confusion. If you plan to use an LCD display, then it is better to download a guaranteed working library from the wiki by Strela. And there you will find examples of working with her.
To control from the phone, as in the example, we used a ready-made Bluetooth RC car application from the Play Market. My student already had a little experience in C programming of microcontrollers and writing programs for operating systems. With the development of Arrows he had no problems. Adding an indicator was his initiative, from which I concluded that he really liked it. On the indicator, he derived the speed set in the application (or rather, the relative duty cycle of the PWM signal).
I will lay out his code in its original form, just to show what it is and what it was written by a person with little experience. You can look under the spoiler, but you won't find the perfect code or anything new there.
The code is almost entirely borrowed from ready-made examples.
Results
Strela is a fairly convenient platform for use in various robotic projects. It seems to me, when training or in projects of the day off, the routine work on rolling boards with LUT or mounting should be reduced to a minimum. Otherwise, losing enthusiasm is very easy.
We had a lot of ideas for using the Arrow. In the near future we want to print a new frame for it, install a line sensor and make a robot moving along the line, with the possibility of manual control via bluetooth. I am sure that our team will look decent at the competitions. The guys have already started working on the robot:
I myself like to program C microcontrollers and with all my might I promote the tools for flashing Arduino-compatible hardware with good software, so for advanced users I will add a description of the flashing of an arbitrary hex file to Atmega32u4 using a bootloader. According to the engineer Amperki:
Option 1:
We open the terminal, we write there: C: \ Program Files (x86) \ Arduino / hardware / tools / avr / bin / avrdude -CC: \ Program Files (x86) \ Arduino / hardware / tools / avr / etc / avrdude.conf - v -v -v -v -patmega32u4 -cavr109 -PCOM19 -b57600 -D -Uflash: w: C: \ Your_C_FIRMWA.hex: i, where C: \ Your_C_FIRMWA.hex is your firmware file, COM19 - instead of 19 - COM number -arrow port in bootloader mode (different from the usual);
Reboot MK;
Within 8 seconds, we have time to execute the command from point 1 on the computer (to put it simply - press Enter);