PREPARATION FOR THE BASIC COURSE ABOUT ARDUINO

TOPICS INDEX

The STEM disciplines and the Be Maker Basic Course Plan

The Be Maker Course that I wanted to create fits perfectly into that new teaching area that is spreading lately, especially at an international level, and we are at the beginning in Italy. More and more resources are invested in this which has now even become a course of study that starts from elementary schools up to leading students to graduate. This new area that encompasses multiple disciplines is called STEM.

STEM is an acronym and stands for Science, Technology, Engineering and Mathematics. This acronym, of course, should be read in the broadest sense of its meaning, in fact, although the basic subjects are of a scientific nature, in this multidisciplinary area also Art can easily find space, so much so that, always at an international level, it has spread the new acronym STEAM. Consequently, with the introduction of Art, all those associated humanistic disciplines are also involved (History, Literature, Philosophy, etc …).

The Be Maker Course represents, trying to do my best, the perfect synthesis of the new study model, where all the STEM disciplines are involved and recalled in a homogeneous and coordinated way. Obviously this is a first step …

The Course has been divided into Modules, the first Module which is the one we are about to start, is the Basic Course. With this course the foundations are created to face the subsequent courses that will have more specialized characteristics.

The Study Plan of the Basic Course is rich and varied and is based on four main science topics: ELECTRICITY, LIGHT, SOUND and MAGNETISM.

All the projects, which are also born for recreational purposes (in fact, if there is no fun there is not even interest), are nothing more than didactic applications of the theoretical parts covered.

The recommended minimum age is 12, but it depends a lot on the student’s desire to learn new things. As far as the maximum age is concerned, there is no limit … in fact the Course creates the knowledge bases of the use of the development platform …. what will then limit the realization of the projects, will be only the imagination and the desire to commit in learning new things … so there is no upper age limit for Course students.

Warnings

Regarding the safety aspects, since the projects are based on a very low voltage power supply supplied by the USB port of the PC or by backup batteries or power supplies with a maximum of 9V output, there are no particular risks of an electrical nature. It is however necessary to specify that any short circuits caused during the exercise could cause damage to the PC, to the furnishings and in extreme cases even to burns, for this reason every time a circuit is assembled, or modifications are made on it, it will be necessary to do it in power failure and at the end of the exercise it will be necessary to disconnect the circuit by removing both the USB cable for connection to the PC and any batteries from the appropriate compartments or external power connectors. Furthermore, again for safety reasons, it is strongly recommended to carry out the projects on insulating and heat resistant mats that can be purchased in any electronics store or even on specialized websites.

At the end of the exercises it is advisable to wash your hands, as the electronic components could have processing residues that could cause damage if swallowed or if in contact with eyes, mouth, skin, etc. Although the individual projects have been tested and safe, those who decide to follow what is reported in this document assume full responsibility for what could happen in the execution of the exercises provided for in it. For younger children and / or for their first experiences in the field of electronics, it is advisable to perform the exercises with the help and in the presence of an adult.

Roberto Francavilla

Preparation of our Electronics and Robotics Laboratory

As the first activity of the Course, it is necessary to prepare our Laboratory and to do this, all the material of our Starter Kit must be taken out of the packaging.

We check that all the material that will be used in the various projects is present:

We also need a PC (desktop or notebook is indifferent, but I suggest with Windows 10 installation):

It is also necessary to have a set of screwdrivers with magnetic cross and flat head (preferably of different sizes):

and for the more adventurous a digital Tester:

Installing the software on the PC

The whole Basic Course is based (excuse the pun) on the use of the Arduino UNO R3 development board. Arduino is actually a real open source platform, but it is also possible to use the numerous compatible versions of development boards made by various manufacturers that use the same platform.

Let’s now pass to the software installations on our PC.

There are two software to install:

  • The development board USB communication port chipset driver
  • The development environment of the “sketches” called IDE

As for the driver, if not installed you will notice it immediately as the first time you load the sketch (the program you need to make Arduino work), it will give you an error. Normally the most popular development boards, even the compatible ones, make the drivers available on the internet, so just do a search and download the driver and then launch the executable.

Since I cannot predict which cards you will buy, I tell you that for the original card the driver is already included in the development environment, so no particular configuration is required, while for compatible cards, the most common one (also because it is very cheap) is the one that has the chipset in SMD format and normally in this case the driver to be installed is called CH341SER.zip

It can be downloaded from the internet, unpacked and then by launching the executable, the driver will be installed.

We said that our development board is based on the Arduino open source platform, and therefore we can use all the tools that the platform makes available to us.

Let’s go to the Arduino website by writing the following address on our browser or clicking on the following link: https://www.arduino.cc

The initial window appears, click on “SOFTWARE”:

then a page will appear where you can download the latest version of the IDE.

Depending on your operating system, on the right side you need to choose the relative DOWNLOAD link:

As you can see from the photo on the web page above, there are different versions of the IDE for: Windows, Mac, Linux, …

The one illustrated below is the procedure for Windows, for the other systems, the procedure is almost identical.

There are two ways of installing the IDE, the automatic one, by clicking on “Windows Win 7 and never” and the manual one, where you must first download the ZIP package and then, once unpacked, click twice on the executable.

By clicking one of the two options, in both cases the donations window appears:

There are two ways of installing the IDE, the automatic one, by clicking on “Windows Win 7 and never” and the manual one, where you must first download the ZIP package and then, once unpacked, click twice on the executable.

By clicking on one of the two options, in both cases the donation window appears: and in this regard, I strongly suggest, given the immense work that the Arduino guys do, to make it, even a small sum.

If you decide not to make the donation, you can proceed with “JUST DOWNLOAD”.

Once the installation program has been launched (by double clicking on the executable file .EXE), following the instructions that are requested on the screen through dialog boxes, proceed with the complete installation of both the IDE development environment and the driver for the control board. Arduino development. The windows that appear will be:

If the following dialog appears, you need to choose “Install”.

At the end of the installation process, an icon will appear on our Desktop:

 

At this point we connect the Development Board to the PC using the USB cable supplied with the same board ..

If all went well, the PC, after a few seconds (necessary for installing the driver), should be able to recognize the new connected device.

It is possible to verify the correctness of the installation process by going to the START windows window located at the bottom left of the desktop:

Click Device Manager:

Look under Ports (COM and LPT) or other devices.

A yellow exclamation point indicates that the driver installation failed. In this case it is necessary to proceed with the manual installation of the driver.

Configure the Arduino IDE

After installing the driver correctly, it is time to configure the IDE, this is because the IDE can be used for different devices, but we want to use it for our Arduino or compatible Development Board.

For both the original and compatible Arduino Development board, you need to go to Tools —> Board —-> and select Arduino Uno (as shown below).

So let’s move on to selecting the correct COM port.

Once the Development Board is connected, go to Windows START and click on it with the right mouse button, then with the left button on Device Manager

Clicking on Ports (COM & LPT) shows which COM port the device is connected to.

At this point we return to the Arduino IDE, go to Tools -> COM Ports and select the port to which our device is connected.

We have finished the most boring part, do not worry from now on we will have to learn many new things and have fun.

Whoever gets off to a good start is half the battle

Our ambitious goal is to become a Maker!

That is, realizers of our electronic and robotic projects, and I’m sure we will succeed.

The following lessons, based on practical projects, are set up in such a way that the theoretical topics are explained several times, even on different practical projects. In this way, even if a topic might be confusing at first or particularly difficult to understand, don’t worry…. GO ON!!

In fact, you will certainly find the same topic in another application, perhaps easier to learn…. And then you will find yourself saying…. ahhh! .. so it works like this … that thing that I didn’t understand at project n. …….

I also want to remind you that through the email you will have the opportunity to get in touch with me, indeed I would be happy, so do not delay when you need clarification, or even give me suggestions (which will always be welcome) and also to deepen some topic that needs clearer explanations….

Finally, since I don’t want to bore you with all these premises, the last message concerns the methodology for explaining the lessons; it is my intention to avoid using technical terms other than those strictly necessary, trying to explain their meaning. Also for the theoretical parts, I will try to avoid going into details of physics and chemistry and I will keep a level of explanation suitable and congruous with school basics for children aged 12 and over.

At this point we begin to know the tools that we will use for our training as a Maker.

What is Arduino

Arduino is a sort of small PC, it has a processor (to be exact a microcontroller), memory (such as RAM and the Hard Disk of a PC), a motherboard and connectors for the inputs and outputs of the signals that they go to external peripherals that can be sensors, actuator modules such as electric motors, etc .. There are different types of cards, depending on certain characteristics, for example there are cards that already have the integrated WiFi module, those that have GPS , etc .. among the most popular is the Arduino UNO R.3, a basic development board that can be integrated with any type of module. Since the Arduino project is open source, many other manufacturers have made their own UNO R.3 board:

Some manufacturers, given the potential of this card, have also developed it further by adding functionality and making it even easier to use.

With this development board for Maker it is possible to create many projects, the only limit is our imagination.

Using the supplied USB cable, it is possible to connect the Development Board to the USB port of the PC from which the same board draws the power necessary for its operation and interfaces with the PC to be programmed.

What is the Arduino IDE

First of all, let’s start from the name: IDE which is an acronym and stands for Integrated Development Environment that is “Integrated Development Environment”, ie a series of applications that aggregate common development tools in a single graphical user interface. The IDE is an environment essentially consisting of:

  • Editor: a text editor that facilitates writing software code which is called a sketch. The programming language used is based on C ++.
  • Serial monitor and plotter: where numeric or textual variables can be represented, but also graphically and is also useful for the debugger (search for errors in sketches)
  • Libraries: are a collection of functions and instructions that simplify the use of certain devices (sensors, modules, etc.)

Clicking on the Arduino icon opens the window below:

What are the icons shown?

A – It is used to check written sketches by pre-compiling them and identifying any errors.

B – Upload the sketch to our Arduino or Board.

C – It is a shortcut to create a new editor window for a new sketch.

D – It is used to directly open an example sketch.

E – Used to save the sketch.

F – It is used to send data from the card to the serial monitor.

IMPORTANT: ALL PROJECTS SHOWN CAN BE REPRODUCED WITH ANY ARDUINO UNO R.3 or COMPATIBLE BOARD.

What is a Library and how to add it to the IDE

Internet, as you well know…. even better than me !, it’s a vast world where you can find everything. Also for the Arduino world…. surely there was someone, in the vast global world, who has already solved technical problems and made his knowledge available to humble mortals so that they could improve (or even improve what had been created!) by making things complicated became simple to understand and apply. The creators of knowledge in the field of electronics and robotics are called … MAKERS! (pronounced: meikers) and I hope that one day you will become one thanks to my little help!

Well! The concept of “Library” is basically this…. It is an archive containing instructions that simplify and make it easier to use things that would otherwise require complex and difficult to apply operations.

Let’s take a practical example: the DHT11 sensor.

The DHT11 sensor is a device that, thanks to the amount of water present in the air or the ambient temperature, measures the electrical resistance variations of some elements. Basically, the DHT11 sensor is as if it were in turn a mini Arduino to which elements whose resistance varies according to the more or less presence of water in the environment and its temperature are connected.

Risultati immagini per dht11
Risultati immagini per dht11

This means that the sensor, by itself, has a mini computer (you can see it in the photo above) which would already require software for its operation that should be written before the real software that we would have had to develop for its use.

Then the creator of this sensor gave us a gift !, he has already developed all the software necessary for the internal functioning of the sensor and created a LIBRARY, that is a series of simple instructions made available to us so that the DHT11 sensor is already correctly programmed to return the values ​​we need.

There are several ways to insert a library into the Arduino IDE, the one we will use is the simplest and fastest, but know that it will not always be possible to use this method … but don’t worry we will see them all if necessary!

Let’s go back to us: insert a new library in the Arduino IDE and then allow the IDE itself to load the correct instructions necessary for the operation of Arduino and the additional components that connect to it onto the Arduino.

First we open the software, click twice on the Arduino icon on the Desktop and the IDE opens:

Since when you open the IDE it usually loads the last written sketch, we start with a clean sketch so as not to create confusion. To do this, click on “File” and then on “New”:

as shown above. At this point we can close the initial window where the previous sketch was.

Now click on “sketch” then on “#include library” and then on “Library manager …”.

After a few seconds the following window appears and let’s write in the text box “DHT11”

A list of libraries comes out, we select the one produced by Adafruit …

… And click on “Install”.

After a few seconds the window with the message “INSTALLED” appears. The library is now usable and the IDE will not give an error when compiling the sketch for Arduino.

This procedure is valid for any new sensor that requires the installation of a library, you just need to change the name of the sensor.

If you found the lesson interesting, make a donation you will help me realize many others.