Conrad 10213 Operation Manual

Arduino Advent Calendar 2016
The programming of microcontrollers was previously only something for engineers and computer scientists. Thanks to clear hardware and easy­to-understand software, Arduino suddenly makes it possible for anyone to get into microcontroller technology.
The Name Arduino
Arduino comes from Italy and was named after the Italian King Arduino, who ruled until the year 1005 in Ivrea, where the Arduino manufacturer has its headquarters. Today, the favourite bar of Arduino developers Massimo Banzi and David Cuartielles there is named after King Arduino.
The Arduino platform now offers a wide variety of boards for various uses. The Arduino Uno is the board best suited for beginners and also one of the most high-performance Arduino boards.
This Advent calendar contains a hardware experiment every day for the Arduino Uno or compatible boards of another manufacturer. Some of the compatible boards have the advantage over the original Arduino Uno that they use a micro-USB connection and thus standard smartphone cables can be used. The original Arduino Uno, by contrast, has a USB Type B connection.
The experiments on this Advent calendar are programmed with Snap!. This programming language is based on Scratch, one of the easiest programming languages to learn ever.
Downloads for the Advent Calendar
You can find the programmes used at http://www.buch.cd for download. For this product, enter the code 10213-1 in the input field.
Breadboard
For the fast construction of electronic circuits without having to weld, a breadboard is on the Advent calendar on the first day. With it, electronic components can be plugged directly into a hole matrix.
On this breadboard, the outer long rows are all connected to each other via contacts (X and Y). These contact rows are often used as positive and negative terminal for power supply for the circuits. In the other contact rows, five contacts each (A through E and F through J) are connected across to each other, whereby there is a gap in the centre of the board. Thus, larger components can be plugged into the centre and wired in from outside.
LEDs
LEDs (LED = Light Emitting Diode) can be connected at the digital pins for light signals and light effects. For this purpose, a 220-ohm series resistor (red­red-brown) must be installed between the pin used and the anode of the LED, in order to limit the current flowing through and thereby prevent the LED from burning through. Plus, the series resistor also protects the digital output of the Arduino, because the LED offers almost no resistance in the flow direction and thus the pin could quickly be overloaded upon connection with earth. Connect the cathode of the LED to the earth wire of the Arduino.
In which direction do I connect the LED?
The two connection wires of an LED are of different lengths. The longer one is the positive terminal, the anode; the shorter is the cathode. Easy to see: The plus sign has one line more than the minus sign and thereby makes the wire visibly somewhat longer. Beyond that, most LEDs are flattened on the negative side, like a minus sign. Easy to remember: Cathode = short = edge.
RGB LEDs
A normal LED always lights up in only one colour. The RGB LEDs contained on the Advent calendar can selectively light up in multiple colours. They are, in principle, three LEDs with different colours installed in a transparent housing. Each of these three LEDs has its own anode, through which it is connected to a digital output. The cathode, which is connected to the earth wire, is present only once. Therefore an RGB LED has four connection wires.
The connection wires of the RGB LED are different lengths so that they can be clearly recognised. Unlike with normal LEDs, the cathode is the longest wire here.
RGB LEDs function like three individual LEDs and therefore also require three series resistors.
Resistors and their colour codes
Resistors are used to limit current to sensitive electronic components and also as series resistors for LEDs. The unit of measurement for resistors is the ohm. 1,000 Ohm equals one kilo-ohm, abbreviated kOhm. 1,000 kOhm equals one mega-ohm, abbreviated MOhm. The letter omega is
also frequently used for the unit ohm.
The coloured rings on the resistors indicate the resistance value. With some practice, they are much easier to recognise than teeny tiny numbers that one can still find on very old resistors.
Most resistors have four such coloured rings. The first two coloured rings indicate the digits, the third a multiplier and the fourth the tolerance. This tolerance ring is usually in gold or silver, colours that do not appear on the first rings. Thus, the reading direction is always clear. The tolerance value itself plays hardly any role in digital electronics. The table shows the meanings of the coloured rings on resistors.
The direction in which a resistor is installed does not matter. With LEDs, on the other hand, the installation direction plays an important role.
Connection cables and jumper wire
The coloured connection cables have a thin wire plug on each end, with which they can be plugged into the socket strips of the Arduino and on the breadboard.
Later on, a jumper wire is included on the Advent calendar. With this wire, you create short connection bridges, with which contact strips on the breadboard are connected. Cut the wire with a small pair of side-cutting pliers to the suitable length depending on the experiment. In order to be better able to plug the wires into the breadboard, we recommend cutting them off at a slight angle so that a sort of wedge results. Strip the insulation from both ends to a length of about half a centimetre.
Precautions Never connect any random Arduino pins to each other and wait to see what happens. Not all Arduino pins can be freely programmed. Some are permanently set up for the power supply and other purposes. Some Arduino pins are directly connected to connections of the microcontroller; a short circuit can completely destroy the Arduino – at least theoretically. The Arduino boards are astonishingly stable against circuit faults. If one connects two pins together through an LED, a protective resistor must always be placed between them. Always use the 3.3 V pin for logical signals. The 5 V pin is used to supply power to external hardware. Here (almost) as much current can be drawn as the connected mains adapter supplies. However, this pin must not be connected to a digital input.
Day 1
Today on the Advent calendar
• Breadboard (SYB 46)
• Red LED
• 220-ohm resistor (red-red-brown)
• 2xconnection cables
Preparing the Arduino
In order to put the Arduino into operation, one needs:
• PC with Windows
• USB cable (Type B)
• Arduino IDE
The connection between the PC and Arduino occurs via a USB cable with the almost square Type B plug on one side. You do not need to buy this type of cable separately; virtually all modern printers use this plug type, and while you are experimenting with the Arduino, you are hardly going to print at the same time.
Don't connect the Arduino yet Do not connect the Arduino to the PC right away; rather, install the Arduino software first. Otherwise, there could be problems later with the driver installation.
Software installation in brief
For programming the Arduino, the manufacturer delivers a very clear development environment in which one can write the programmes, which
are designated as Sketch by Arduino, in a programming language similar to C. This Arduino IDE also creates the connection between the PC and Arduino.
For everyone who does not have the Arduino ready to operate, here is the system installation in seven steps:
1 Download the Windows installer for the current Arduino IDE at www.arduino.cc/en/Main/Software or simply use the file arduino-1.6.8-
windows.exe from the downloads for the Advent calendar.
2 Install the Arduino IDE before you connect the Arduino to the PC for the first time. The necessary drivers are thereby automatically installed
with it and the Arduino is later recognised automatically. In doing so, make sure that in the dialogue field Installation Options , all check boxes are checked. Depending on your Windows configuration, a confirmation of the user account control is required.
3 After the installation, start the Arduino IDE and then connect the Arduino using a USB cable. The driver is now automatically installed and
simulates via USB a serial port to which the Arduino is connected.
4 After the driver is installed and not before, go to the menu of the Arduino IDE and select Tools/Port. In most cases, only a single serial port is
shown. Select the check box here.
5 Then, via the menu option Tools/Board, select the Arduino/Genuino Uno, if this was not automatically recognised.
6 In the menu, select File/Examples/Firmata/StandardFirmata. A new window of the Arduino IDE opens with the StandardFirmata sketch.
7 Click on the Upload icon in the top toolbar (the round symbol with the arrow pointing to the right). The software is now compiled and
transferred to the connected Arduino.
If you use Linux or Mac OS X: On the website www.arduino.cc/en/Guide/HomePage you will find installation notes for the Arduino IDE for these operating systems.
Lighting the LED
No separate program is needed for the first experiment. The Firmata test program switches an LED on and off and at the same time, thereby also tests whether StandardFirmata is functioning.
Components: 1xbreadboard, 1xred LED, 1x220-ohm resistor (red-red-brown), 2xconnection cable
Connect the LED as shown in the figure via a series resistor to Pin 5 of the Arduino.
Now start the programme firmata_test.exe from the Downloads for the Advent Calendar. In the Port menu, select the port used by the Arduino. Control elements for the pins of the Arduino will then appear.
The Firmata test programme causes the LED to light up.
Click on the Low button in the Pin 5 line; the LED switches on and the button switches to High. Click on it again; the LED switches off again.
For status indicators without additional hardware, the Arduino also has its own LED. This can be controlled via Pin 13. Click on the Low button in the Pin 13 line; this LED switches on off.
Switching off the Arduino The Arduino does not have an off switch. You need only pull the plug, and it switches off. The next time you switch it on, the last stored program starts automatically – thus in our case the StandardFirmata. The same thing happens when one presses the Reset button.
Day 2
Today on the Advent calendar
• Green LED
• 220-ohm resistor (red-red-brown)
• Connection cable
Alternating flashing light
A simple programme allows two LEDs to flash alternately.
Components: 1xbreadboard, 1xred LED, 1x green LED, 2x220-ohm resistor (red-red-brown), 3xconnection cable
The programme
For the projects on the Advent calendar, we use the easy-to-learn programming language Snap4Arduino. Download the current version at
s4a.cat/snap or simply use the file Snap4Arduino-aktuell.exe from the Downloads for the Advent Calendar.
In Snap4Arduino, click on the Settings icon and select Language in the menu.
The Settings menu in Snap4Arduino
Select "English" in the list.
Before you can begin with the programming, a connection to the Arduino must be created. To do this, click on Arduino in the top left in the block palette and then on Connect to Arduino. When you open a new programme in Snap4Arduino, the connection to the Arduino will often be lost. Should an error occur when you start a new programme, reconnect the PC to the Arduino as described.
Snap4Arduino supports multiple Arduinos on one PC. As long as only one Arduino is connected, it is recognised immediately and the connection is created.
The connection to the Arduino was successfully created.
The programmes for the Advent calendar
You can download the programmes for the Advent calendar at www.buch.cd or simply put them together yourself each day using the figure. Unzip the ZIP file from the download in a folder on the hard drive. Then click on the Files icon at the top left in Snap4Arduino and select Import to import the programmes, which are in XML format, into Snap4Arduino. After the import, click once in the menu on Save. After that, the programme is available in the software's own library, which can be reached through the Open menu item.
In Snap4Arduino, one does not need to type in any programme code when programming. The blocks are connected to each other simply via drag-and-drop. The block palette in the left side of the window contains the available blocks, organised by themes.
The first programme uses the most important blocks:
When green flag clicked on from the Control palette forms the start for most of the programmes.
continuing from the Control palette is an infinite loop that is constantly repeated.
wait... sec from the Control palette causes the program to wait a certain amount of time before the next step.
Set digital pin... to... from the Arduino palette sets one of the digital pins of the Arduino to a logical value true or false. These two values can be
found as blocks on the Operators palette.
The programme starts when the user clicks on the green flag at the top right.
A continuing loop ensures that the two LEDs flash alternately indefinitely – until the user clicks on the red Stop icon at the top right in Snap4Arduino.
After the LED at Pin 5 is switched on, 0.1 seconds elapses so that StandardFirmata does not "swallow" a command. A minimum wait time should always be built in between the setting of two pins. After that, the LED at Pin 8 is switched off. Now the programme waits half a second.
Note: Decimal point
Snap4Arduino, like many American programmes, uses the point as the decimal separator, not the comma that is usual in Germany.
After that, in the same way, the LED at Pin 8 is switched on and the one at Pin 5 is switched off. After another half second, the cycle repeats from the beginning.
Day 3
Today on the Advent calendar
• Yellow LED
• 220-ohm resistor (red-red-brown)
• Connection cable
Stop light
The experiment of the third day switches a traffic light made of three LEDs in their typical cycle of red through red-yellow to green and through yellow back to red.
Components: 1xbreadboard, 1xred LED, 1x yellow LED, 1x green LED, 3x220-ohm resistor (red-red-brown), 4xconnection cable
The programme
The programme functions similarly to the one from yesterday. Here, too, various combinations of LEDs are switched on and off in sequence in an infinite loop. In the intermediate phases red-yellow and yellow, the traffic light lights up for 0.5 seconds each time, in the red and green phases 3 seconds each. These times can also be set differently in the wait...sec blocks.
The delay time between the apparently simultaneous switching of multiple LEDs was reduced to 0.01 seconds, which is technically sufficient and is practically no longer recognisable by the observer.
The programme 03ampel01 causes the LEDs to flash alternately.
Day 4
Today on the Advent calendar
• RGB LED
RGB LED flashes colourfully
The experiment for the fourth day causes an RGB LED to flash in a series of different colours.
Components: 1xbreadboard, 1xRGB LED, 3x220-ohm resistor (red-red-brown), 4xconnection cable
The programme
The programme functions similarly to the one from yesterday. Here, too, various digital pins are switched on and off in sequence in an infinite loop. In this case, the three colour components of the RGB LED are involved.
Additive colour mixing
RGB LEDs use the so-called additive colour mixing. The three light colours red, green and blue are added and give pure white at the end. A colour printer, by contrast, uses the subtractive colour mixing. Each colour acts as a filter on a white page that removes (= subtracts) a portion of the white reflected light. If one prints all three printer colours over one another, the result is black, which no longer reflects any light at all.
In the programme, through alternating switches on and off, the LED alternates constantly between having one colour component lit and having two lit. The RGB LED thereby alternates back and forth between six different colours.
The programme 04rgb01 causes the LEDs to flash alternately.
The speed of the colour change is controlled through a variable z, which is set to a specific value at the beginning of the programme and then applies for each colour change.
Variables in Snap4Arduino
Variables are small memory spaces in which one can mark a number or anything else during a programme. When the programme is ended, this variable memory is automatically cleared again. Variables must first be set once in Snap4Arduino before one can use them.
Day 5
Today on the Advent calendar
• Red LED
Dimming the LED
Components: 1xbreadboard, 2xred LED, 2x220-ohm resistor (red-red-brown), 3xconnection cable
LEDs are typical components for the output of signals in digital electronics. They can take on two different states: on and off, 0 and 1 or false and true. The same is true for the digital pins defined as outputs. Thus, in theory, it would not be possible to dim an LED.
However, it is possible to use a trick to regulate the brightness of an LED at a digital pin. If one allows an LED to flash fast enough, the human eye no longer perceives it as flashing. The technology known as pulse width modulation (PMW) generates a pulsing signal that switches on and off in very short intervals. The voltage of the signal always remains constant; only the ratio between the false level (0V) and true level (+3.3V) is changed. The duty cycle determines the ratio of the length of the switched-on state to the total duration of a switch cycle.
The smaller the duty cycle, the shorter the time is that the LED is lit within a switch cycle. The LED thus appears darker than an LED that stays switched on.
Pins for PWM signals
Pins 3, 5, 6, 9, 10, 11 are marked on the Arduino with a "~" symbol. These pins can be used for pulse width modulation.
The programme
The programme 05pwm01 dims the two LEDs brighter and darker in a cycle. At the beginning, two variables are defined for this purpose: bright designates the PMW value for the brightness of the LED and step gives the step width for dimming. The current values of both variables are shown in real time at the top right of the platform.
Now an infinite loop begins. As the first step in every pass, the current value of the variable bright is outputted as the PWM value at Pin5 and then after a short delay also at Pin6. Then the value of the variable bright is increased by the value step.
In the next step, the programme checks whether the value of bright has reached the limits 0 or 100. In this case, an or block is inserted, which in turn has space for two further queries. If at least one of these two is true, the or block returns the value true and the content of the if block is executed.
Two equals queries check whether the variable bright has reached the value 0 or 100. If this is the case, the variable step is set to a new value. Because Snap4Arduino does not offer the option to reverse the sign of a variable, we use the operator '-' and subtract the value of the variable from 0, which gives the same result.
At the end, the program waits 0.025 seconds. Then the infinite loop begins again and delivers the LEDs a new PWM value.
Day 6
Today on the Advent calendar
• 2xconnection cables
These connection cables will not be needed until the next few days.
Mixing colours with PWM
Components: 1xbreadboard, 1xRGB LED, 3x220-ohm resistor (red-red-brown), 4xconnection cable
The programme
The programme 06pwm02 dims the colour components of an RGB LED brighter and darker in a cycle. Various mixed colours are thereby generated. The current values of all variables are shown in real time at the top right of the platform.
Loading...
+ 11 hidden pages