New original projects on Arduino. What is Arduino and what can you do with it?

Today we will talk about traffic light on on DigiSpark and WS2812 addressable LEDs . This is the second version traffic light. I talked about the first one here. The first version turned out to be quite convenient and consisted of fewer parts. Why did I decide to make a second version? The fact is that the box holds the batteries that I used in the first version traffic light on Arduino, has become very expensive. Some sellers sell it for $5 on . More expensive than all other electronics. So I decided to change the box to a cheaper one. And once I had to redo the body. I decided to change the size of the traffic light itself and make it larger than the first version. Also in the leg traffic light added a metal rod to increase rigidity.

Alarm clock on Arduino. The body is made from LEGO construction kits. LEGO Arduino

My 5-year-old child came from kindergarten and said that he was asked to make a project for smart devices in the house. The body can be made from any available construction kit. Can be made from LEGO designer. After some thought, my son and I decided to do alarm clock on Digispark And 7 segment indicator on TM1637 With real time clock DS3231.

New Arduino projects and Projects made on a CNC machine

Summer is over. And time to develop Arduino projects become bigger. And today I plan to talk about my new projects which I do on Arduino and yours homemade CNC machine. Projects are still in the development stage and do not have a final finished form. But still, I decided to talk about them so that I could hear an outside opinion.

Traffic light on Digispark and addressable LEDs WS2812 - Arduino traffic light

In the previous article: " » I already talked about the development traffic light and that I was unable to make it fully functional and operational. After a couple of weeks I finalized it and now I'm ready to present it homemade traffic light using Arduino and WS2812 addressable LEDs.

I cut all the blanks for the body on my own homemade CNC machine.

Unsuccessful Arduino lamp and traffic light projects

Any development leads to unsuccessful and intermediate models. Which do not satisfy all needs and expectations.

Good day, Habr. I am launching a series of articles that will help you get acquainted with Arduino. But this does not mean that if you are not new to this business, you will not find anything interesting for yourself.

Introduction

It would be a good idea to start by getting acquainted with Arduino. Arduino – hardware and software for building automation and robotics systems. The main advantage is that the platform is aimed at non-professional users. That is, anyone can create their own robot, regardless of programming knowledge and their own skills.

Start

Creating a project on Arduino consists of 3 main stages: writing code, prototyping (breadboarding) and firmware. In order to write code and then flash the board, we need a development environment. In fact, there are quite a few of them, but we will program in the original environment - Arduino IDE. We will write the code itself in C++, adapted for Arduino. You can download it on the official website. A sketch is a program written on Arduino. Let's look at the code structure:


main())( void setup())( ) void loop())( ) )

It is important to note that the Arduino processor creates the main() function, which is required in C++. And the result of what the programmer sees is:


void setup() ( ) void loop() ( )

Let's look at the two required functions. The setup() function is called only once when the microcontroller starts. It is she who sets all the basic settings. The loop() function is cyclic. It is called in an endless loop throughout the entire operating time of the microcontroller.

First program

In order to better understand the operating principle of the platform, let's write the first program. We will execute this simple program (Blink) in two versions. The only difference between them is the assembly.


int Led = 13; // declare the Led variable on pin 13 (output) void setup() ( pinMode(Led, OUTPUT); // define the variable ) void loop() ( digitalWrite(Led, HIGH); // apply voltage to pin 13 delay(1000 ); // wait 1 second digitalWrite(Led, LOW); // do not apply voltage to pin 13 delay(1000); // wait 1 second)

The operating principle of this program is quite simple: the LED lights up for 1 second and goes out for 1 second. For the first option, we do not need to assemble a layout. Since the Arduino platform has a built-in LED connected to pin 13.

Arduino firmware

In order to upload a sketch to Arduino, we first need to simply save it. Next, to avoid problems when loading, you need to check the programmer settings. To do this, select the “Tools” tab on the top panel. In the “Payment” section, select your payment. It could be Arduino Uno, Arduino Nano, Arduino Mega, Arduino Leonardo or others. Also in the “Port” section you need to select your connection port (the port to which you connected your platform). After these steps, you can upload the sketch. To do this, click on the arrow or select “Download” in the “Sketch” tab (you can also use the keyboard shortcut “Ctrl + U”). The board firmware has been completed successfully.

Prototyping/layout

To assemble the breadboard, we need the following elements: LED, resistor, wiring (jumpers), breadboard. In order not to burn anything, and in order for everything to work successfully, you need to deal with the LED. It has two "legs". Short is a minus, long is a plus. We will connect the ground (GND) and a resistor to the short one (in order to reduce the current supplied to the LED so as not to burn it), and we will supply power to the long one (connect to pin 13). After connecting, upload the sketch to the board if you have not done so previously. The code remains the same.


This is the end of the first part. Thank you for your attention.

Arduino is a hardware computing platform that is used to design and create electronic devices of various levels of complexity.

This electronic designer is based on a hardware platform for input and output, which is programmed in the Processing/Wiring language, based on C++. What components does Arduino consist of, what can you do with it, and how can you learn to use this smart chip?

Arduino is one of the most common miniature controllers with a set of inputs and outputs that works according to a pre-written program. This versatile controller is very convenient for creating prototypes of electronic devices, making it popular not only among students and hobbyists from around the world, but also among advanced designers and inventors.

Arduino impresses with its versatility. Using special expansion boards, this controller can interact with other devices via Bluetooth, Wi-Fi, GPRS, make and receive phone calls and SMS.

The controller is not a simple chip, but a board with a ready-made power supply circuit and interfaces for connecting to a PC, input and output connectors.

Thanks to a wide range of protocol libraries, it is possible to organize the interaction of Arduino with sensors and servos used in modern robotics.

And the open architecture makes it possible to customize Arduino for any purpose. And thanks to the simplified programming language, it will be easy even for beginners to master working with the controller. It is especially convenient to work with Arduino thanks to the platform, which provides an almost instant response to programmed commands.

What can you do with Arduino? A programmer, designer or engineer can turn almost any original idea into a working prototype - you just need to purchase a controller and additional radio components. Also, programming and circuit design enthusiasts are captivated by the low cost of Arduino, which makes the controller accessible to the masses.

Arduino projects: what you can do

Let's look at a few original ideas that can be implemented on Arduino. In addition to the diagram itself, you may need additional parts, which are most profitable to purchase on AliExpress.

Home temperature regulator

You can implement such a project using several Arduino Nano boards and one Arduino Uno/Mega, which will act as a base. Communication between modules can be realized using NRF24L01, a radio communication module that makes it possible to combine up to 6 boards.

In one case it is necessary to assemble an Arduino Nano connected to DHT22 humidity and temperature sensors, as well as an NRF24L01 module. The power source can be a regular battery. Several of these devices must be placed throughout all rooms in the house.

Indicators from the Arduino Nano will be transmitted to the base, which will be the Arduino Mega or Uno. It is also necessary to attach the NRF24L01 signal receiver, power supply and LCD display to display text information. The “base” must be located in close proximity to the heating system. Receiving and processing incoming data on humidity and temperature, the base will transmit commands to the heating system to increase or decrease the temperature.

CNC machine

This idea is one of the most difficult to implement. With Arduino Mega you can implement not only a CNC machine, but also a 3D printer. In addition to the board itself, you will need L298N motor drivers, as well as the motors themselves. The rest of the work is frame and code development.

Smart greenhouse

All owners of a vegetable garden or personal plot know how much attention a greenhouse and the seedlings grown in it require. It is necessary to constantly monitor soil moisture, open and close doors in time, etc. With the help of Arduino, all these routine processes can be automated.

Using just one Arduino Mega board and a DHT22 controller, you can record and display information about the temperature in the greenhouse, as well as transmit commands to start irrigation, control motors to open and close doors.

Robots

Robots are the best toy not only for children, but also for adults, especially when it is possible to control them. Using Arduino and various available materials, you can make a robot in any configuration: from the most primitive to complex models.

For example, with the help of the HC-SR04 ultrasonic rangefinder, your robot will be able to record the distance to obstacles and avoid them as it moves. By using the L293D motor driver, you will have 3 servos and 4 motors at your disposal. Using the HC-06 module, you will be able to control your creation via Bluetooth via a smartphone.

Of course, this is not the end of the list of Arduino projects that you can do yourself - the possibilities here are limited only by your imagination and skills.

Arduino is a small electronic device consisting of a single printed circuit board that is capable of controlling various sensors, electric motors, lighting, transmitting and receiving data... Arduino is a whole family of devices of different sizes and capabilities. And also this is a whole zoo of Arduino clones and a world of Arduino-compatible devices. But let's talk about everything in order.

1 "Brain" Arduino

The "brain" of Arduino is microcontroller families Atmega. A microcontroller is a microprocessor with memory and various peripheral devices, implemented on a single chip. In fact, it is a single-chip microcomputer that is capable of performing relatively simple tasks. Different models from the Arduino family are equipped with different microcontrollers.

Atmega328 - the brain of the Arduino UNO

The photo shows a microcontroller Atmega328. Such microcontrollers cost Arduino UNO And Arduino Nano(but in a different building).

2 "Hands" Arduino

But what good is a brain if it has no hands? In this case, the hands are electrical terminals, placed around the perimeter of the Arduino board. There are boards with more pins, and some with fewer. For example, the largest board in the Arduino family is Arduino Mega- has more than 70 independent outputs, and the smallest - Arduino Pro Mini- 22 pins in total.


The photo shows a comparison of Arduino Mega and Arduino Pro Mini. Can you imagine what a person could do with as many hands as there are Arduino Mega pins?

3 Digital and analog conclusions

Not all Arduino pins are the same. There are conclusions digital, is there analog. The fundamental difference between them is that the digital pins can have only two values: either logical “1” (TRUE, from 3 to 5 volts) or logical “0” (FALSE, from 0 to 1.5 volts), and On the analog pins, the range from logical “1” to “0” is divided into many small sections.

Why is this needed? Let's look at such a clear example. If you connect an LED to the Arduino digital pin and apply a logical “1” to the output, the LED will light up with maximum brightness; If you apply "0" the LED will go out. There are no intermediate options. If the LED is connected to an analog output, then the brightness of the LED can be controlled smoothly. In practice, some kind of analog sensors are most often connected to the analog outputs.

4 What can it control? Arduino

As a result, such a number of “arms” of Arduino allows you to connect a huge number of different peripheral devices to it. Among them, for example:

  • buttons, reed switches and joysticks,
  • LEDs and photodiodes,
  • microphones and speakers,
  • electric motors and servos,
  • LCD displays,
  • radio tag readers (RFID and NFC),
  • bluetooth, WiFi and Ethernet modules,
  • SD card readers,
  • radio receivers and radio transmitters,
  • GPS and GSM modules...

And also dozens of different sensors:

  • illumination,
  • magnetic field,
  • ultrasonic and laser rangefinders,
  • gyroscopes and accelerometers,
  • smoke and air composition sensors,
  • pressure, temperature and humidity sensors...

And much, much more

All this turns Arduino into a universal system core that can be configured in a completely variety of ways. Want to make a radio-controlled pet feeder? Please! Do you want the window on your loggia to close when it starts to rain? Please! Do you want to control the brightness of the lighting in your room from your smartphone? Easily! Would you like to receive email notifications if your houseplants' soil becomes too dry? And this is possible!


The photo shows only a tiny part of the peripherals that can be connected to the Arduino. In fact, there are many, many more.

5 Communication with Arduino

How does the processor know what exactly it should do? You should tell him this. Writing messages for Arduino is called programming. There is a language for communicating with a microcontroller, simplified and adapted specifically for Arduino. Mastering this language is not at all difficult if you have the desire and some persistence, even if you have never programmed before.

And to simplify this process, a special software environment has been developed - Arduino IDE. It includes dozens of examples of good, working programs. After studying them, you will very quickly learn a lot about the language of communication with Arduino.

Arduino will allow your programs to move out of the virtual world and into the real world. You'll be able to see how the programs you write make an LED blink or a motor rotate, and then do more complex and useful things. Arduino will allow you to learn a lot of new and interesting things in both electronics and programming. In the end, this can serve as an excellent hobby for you, a fun activity with children, and a wonderful and useful pastime.

You can order Arduino and a wide variety of sensors for it in the Chinese online store Ali-Express. Here prices are lower, but delivery takes from 3 weeks to 1.5 months. You can order Arduino at the Voltiq.ru electronics store. The prices here are slightly higher than in Chinese online stores, but you don’t have to wait a whole month. Another good electronics and robotics store is FastNVR.ru.

And finally, look at what different and wonderful projects can be implemented using Arduino!