Conrad 10217 Operation Manual

Before we start ...
... a few more important announcements and notes for successful and stress-free work with the calendar.
This manual is supported by the website www.iot.fkainka.de, where you'll also find the necessary software. The manual gives an initial overview of the individual tests. Because the Internet of Things is a complex subject, you'll find supplemental information on the Internet that makes the path to success easier.
More pictures and some additional articles could be included on the website that are useful for the development and design of your own projects.
Another advantage of the website is the element of surprise. The appeal of an Advent calendar is really that you don't know what's behind the next door. With a manual, most of the time, you already see the test on the next page. On the website, only the chapter for the respective day appears each day. So here's what I recommend: After this chapter, just put the manual in the corner and don't take it out anymore for now. Instead, go to www.iot.fkainka.de and bookmark it in your browser. Then you can read the chapter of the day wherever you are, and later, when you get home, you can experiment with the practical part of the day's project.
All fans of a classic manual, of course, hang on to the book. It can be completely comfortable not to have to hold a digital device in your hands when you're getting an initial overview of the current test. But a visit to the website is inevitable because you still have to download the associated programme. You'll find it in each article under the heading "The programme."
I hope you have fun and have a joyful and exciting Advent!
Fabian Kainka
Day 1: The NanoESP board
It's the first of December and thus time to open the first door. Behind it is arguably the most important element of the calendar: the NanoESP
board1. This Arduino-compatible controller with WLAN function is at the centre of the 24 tests.
To s briefly, it can be said that the board is most likely a cross between a board similar to an Arduino Nano and a WLAN module with the name ESP8266. The communication between the two elements runs through a serial port generated via software, which is connected to Pins D11 and D12. You should thus avoid these pins with your own projects.
So that you can successfully program your board, you first need to install the driver. You'll find it on the page http://iot.fkainka.de/driver. There are versions for different operating systems there. In the Windows version, there is a setup.exe file in the ZIP folder that you have to execute. In the window that then appears, simply click on "Install."
After the installation, you can now connect the board to the PC for the first time. The PC should automatically find the driver, while the two Power LEDS (D6 and D2) light up on the board. The third LED (D3) flashes first. If the LEDs light up but the PC does not recognise any new hardware, check whether you're actually using a USB data cable. You see, there are also cables that are intended only for charging devices like smartphones but don't enable data communication. You can also look in Device Manager to see whether the device has been correctly recognised and installed.
The driver is now installed, and in the meantime the third LED should also have stopped flashing and remain constantly lit. That's the sign that the initialisation of the board was successful. Now you should also be able to spot something else, namely that a new open WLAN exists within your reach. The WLAN bears the name NanoESP. In today's practical test, you should connect to this WLAN. If the PC asks about the type of connection, you should select the option "Home network." In this way, the communication with other devices isn't blocked. When you are connected to the WLAN, you can open a browser of your choice and enter the following in the address bar:
192.168.4.1
This is the IP address of your board. The page that now loads for you to see is a small website that is sent from the board to your PC. This is an Easter egg, which is a hidden function. The first test is a function test and at the same time offers a glance at a potential use of the board as a web server. But more on that later.
Day 2: The Arduino IDE
This time there's a breadboard behind the door. On it, you can quickly and easily assemble the hardware layouts of the Advent calendar. Since only the NanoESP is available so far, we'll start with it.
It's best if you plug the controller into the breadboard as shown in the picture. That way, the greatest space remains free for experiments; the WLAN module sticks out behind past the breadboard. The micro-USB cable then hangs between the contact sides and is only a minimal disruption. The board needs to be pressed in gently until it touches the contacts.
Today we also want to deal with the software with which the board can be programmed. This is the Arduino development environment (Arduino IDE for short). You can download the latest version for your individual system at http://www.arduino.cc/en/Main/software and then install it. Please note that you should work with at least Arduino Version 1.6.5.
Programming occurs here in a somewhat simplified C/C++. You can now open an initial sample programme in the IDE by clicking File > Samples > 01.Basics > Blink. The programme causes the LED D3 on the board to flash in a one-second cycle. In order to execute it on the NanoESP, you first have to transfer it via the USB interface to the board. Before you do that, select the right board and the right communications port (COM for short) in the software:
1 Under Tools > Board select "Arduino Nano" 2 Under Tools > Processor select "ATmega328" 3 Under Tools > Serial Port select the corresponding COM port
Then click the Upload button. The programme is now compiled and transferred to the NanoESP. You can follow the progress in the status bar below. During the upload, you can also see the two centre LEDs (TX1 and RX1) flashing rapidly. If everything was successful, the LED D3 on the board begins to flash in a one-second cycle. You've just successfully uploaded your first Arduino programme.
This was only a test of whether the board functions correctly in principle. Now comes the IoT part of today's test. First, though, you still have to download something, namely the library, which will enormously simplify handling the board for you. You'll find the latest version at http://
iot.fkainka.de/library. Now you have to integrate this ZIP file into Arduino by selecting it under
Sketch > Integrate library > Add .ZIP library
. You may have to restart the Arduino IDE so that you can find the sample programme under
File > Samples > NanoESP > Basics > Wifi_Scanner
and open it. Now you have to upload this programme. Then open the serial monitor and set the baud rate 19200. After a short time, you will first see information about the firmware and finally a list of all WLAN networks in range of your NanoESP board.
Day 3: The NanoESP in access point mode
Behind the third door is the jumper wire, which is important for many tests. To prepare for later tests, you can place the supply lines GND and VCC on the outermost lanes. You'll thereby have better access to these important lines later.
The jumpers to GND and VCC
In the project for today, you now get around to changing something in a programme even on your own. The following sample programme serves as a basis:
File > Samples > NanoESP > Basics > AccessPoint
When you upload this programme, you won't see any change at first. There is still an open WLAN with the name NanoESP in range. However, if you now change line 16 in the programme with the configWifi command, the access point settings also change. You can replace the "NanoESP" in quotation marks with another WLAN name, or you can even define a password for the network by adjusting the last parameter of the function. The password must have at least eight characters. A possible example is:
nanoesp.configWifi(ACCESSPOINT, “MyNanoESP”, “MyPassword”);
Then you need to upload the programme again. If the configuration was successful, the LED D3 lights up for confirmation. If there is an error, the LED does not light up and you need to check the settings. It's never been easier to create your own WLAN.
Day 4: Setting up Internet connection
Behind today's door is a 1-kohm resistor. We're not going to do much with it today, but tomorrow it becomes important. In today's test, we want to set up an initial connection to your home WLAN network. For this purpose, you need, as you will on many days to come, to enter your WLAN
data in the programme.
But first you need to download today's programme from the website www.iot.fkainka.de. When you've opened the programme in the Arduino IDE, you will see at the very first two DEFINES. This is where you have to enter your WLAN name and the password. Only then can you upload the programme. You can now check the status of the WLAN connection on the serial monitor. In the ideal case, you'll see "WLAN Connected" there. The LED D3 also lights up. If you run into problems, you'll find help on the website.
After the connection, yet more messages appear on the serial monitor. First, the IP address of the board is given once. It was assigned to the NanoESP by the router and is the board's address in the local network. After that, the board pings a server on the Internet to test whether it is connected to the Internet. If everything functions, a suitable message appears on the serial monitor and the answer time in milliseconds that passed from the sending of the ping to reception of the answer. You may recognise this ping value from online games. The connection to the Internet now exists, and you are ready to take larger steps with the board.
Connection successfully created
Day 5: Blynk
You already established a first connection from the board to the Internet yesterday. In the coming days, this connection should be used effectively. So we're looking at the online platform Blynk, through which short commands, measurement data or messages can be exchanged between the NanoESP board and your smartphone.
Blynk enables the simple control of various IoT boards, e.g. the Raspberry Pi or our NanoESP, using an app. You can put the graphic interface together completely on your own, and programming is also extremely simple. As if that weren't enough, you can even control the board from anywhere in the world. So it's totally within the sense of the Internet of Things.
For your first test, you need the LED that's behind today's door and the resistor from yesterday. We want to switch the LED using the smartphone or tablet. Set up the circuit shown here on the breadboard. Pay attention to the correct polarity of the LED (small leg at GND).
In the next step, you need to install the Blynk library. You'll find a functioning version linked on the website (http://iot.fkainka.de/day5-2016) for today's test.
Integrating this library is somewhat more complicated, since there are multiple library files in the ZIP folder. That means: You have to install it manually. But that's not particularly hard. Simply open your Sketch file folder. If you don't know exactly where it is, look under File > Presets.
In the Sketch folder is a folder named libraries. You need to copy the folder contained in the ZIP file into this folder. These are basically the steps the Arduino IDE took automatically on Day 2 when installing the NanoESP library. That's why you'll also find a subfolder named NanoESP in the libraries folder. You should now likewise be able to find the folder from the downloaded archive here.
Now Blynk is integrated into your Arduino IDE, but you don't yet have the app that goes with it on your smartphone. To change that, download the app from your app store, depending on your operating system, or go to http://www.blynk.cc/getting-started/ and follow the link there.
Open the app. You are greeted with the two options Login and Create New Account. Create a new account. For this, you don't have to do anything more than enter an email address and a password. Then you can log in.
In order to get the interface for today on your smartphone, there's an exceptionally practical function in the app. Tap the icon at the top right that's between the plus and the i. A QR code scanner opens, which you simply have to hold on the following picture. The interface already appears on your device.
The QR code for today's project
Next, you have to tap the hexagonal icon at the top right and write down the code that's under AUTH TOKEN or, an option that's especially practical, have it sent to your email address. You see, this code belongs in the Arduino programme.
First you have to download today's Arduino programme from the website www.iot.fkainka.de and open it in the Arduino IDE. Then, just like yesterday, you have to enter the WLAN data at the top in the programme after "SSID" and "PASSWORD." You also have to enter the code referred to above after the keyword "token." Only then can you load the programme on the NanoESP. After the upload, you can follow a couple of messages on the serial monitor and thus make sure that the connection set-up has worked.
Now back to the smartphone or tablet. Start your interface by tapping on the Play button at the top right. You can now press the button in the middle of your interface, and whenever you touch the button, the LED lights up on the breadboard. As a test, you can change the button type; stop the programme by pressing the Stop button and tap briefly on the button. There change the button type from Push to Switch; then press Play
again in the interface view. Now a simple tap is enough to cause the LED to stay lit.
Day 6: The hardware button
In yesterday's test, you realised a simple control of an LED using the Blynk app. Today you'll see that the control works in both directions. The push-button switch behind today's door really comes in handy for this purpose. With it, you can expand yesterday's circuit as follows:
The new layout with push-button switch at D7
You can scan the interface for today here:
The QR code for Day 6
In the Blynk app, there is a virtual currency labelled Energy. It prevents you from using very extensive projects or many smaller projects in the app at the same time. For you, that means that you may have to delete old projects starting on Day 8. But you can save your adapted project by creating a QR code and saving it somewhere.
As always, you'll find today's programme on the website. Today, too, the WLAN data and the AUTH TOKEN of the project must be transferred into the programme. Each project has its own token, so you have to have the code re-sent or transfer it into the programme manually. After you start the interface with the Play button, you can again cause the LED on the breadboard to light up by tapping on the button. But you also see a change in the app if you push the button on the breadboard. Thus, the connection is possible in both directions.
Day 7: Analogue write
Behind today's door is a potentiometer. You can use it to transfer analogue messages to the Blynk app. To do this, you need to build the circuit according to the picture.
The potentiometer uses the lower wire for the connection to A0.
Things can get a bit tight when constructing with the MicroUSB cable. So that everything connects, you first have to disconnect the board from the cable and place the jumpers to be as flat as possible. You also need to be aware that this time the VCC is not applied to the track at the bottom of the image; instead, the track is intended for the connection at Pin A0.
You can import the Blynk interface as usual with the QR code. You'll find the programme on the website. Don't forget to enter the new token and your WLAN data before you upload the programme to the NanoESP board.
Today's interface
The measured data are now received approx. once a second and shown in the graph widget. You can affect the measured values by turning the potentiometer. Note that the maximum value is 1023. The reason is that the NanoESP reads the voltage with a resolution of 10 bits. These are formed from a voltage range between 0 and +5 V. The potentiometer acts as a voltage divider in this process, so that voltages between 0 and 5 V can be adjusted at the centre pin.
Day 8: Virtual LEDs
In the test for the sixth day, you saw how a push button on the hardware side can be mapped on a button in the app. However, another widget, namely the LED widget, is much simpler for this instance. In today's test, you'll see how to use it properly and what options it offers.
Behind today's door is another 1-kohm resistor that is important for later tests. Today the circuit from yesterday is expanded by a button.
The layout of today's project
You can insert the interface again via QR code. However, the Blynk app may then give you a notice that you don't have enough energy. As
Loading...
+ 9 hidden pages