Velleman VMM501 User manual

VMM501
V. 01 –17/01/2019 2 ©Velleman nv
USER MANUAL
1. Introduction
To all residents of the European Union
Important environmental information about this product
This symbol on the device or the package indicates that disposal of the device after its lifecycle could
harm the environment. Do not dispose of the unit (or batteries) as unsorted municipal waste; it
should be taken to a specialized company for recycling. This device should be returned to your
distributor or to a local recycling service. Respect the local environmental rules.
If in doubt, contact your local waste disposal authorities.
Thank you for choosing Velleman®! Please read the manual thoroughly before bringing this device into service.
If the device was damaged in transit, do not install or use it and contact your dealer.
2. Safety Instructions
This device can be used by children aged from 8 years and above, and persons with
reduced physical, sensory or mental capabilities or lack of experience and knowledge if
they have been given supervision or instruction concerning the use of the device in a
safe way and understand the hazards involved. Children shall not play with the device.
Cleaning and user maintenance shall not be made by children without supervision.
Indoor use only.
Keep away from rain, moisture, splashing and dripping liquids.
3. General Guidelines
Refer to the Velleman®Service and Quality Warranty on the last pages of this manual.
Familiarise yourself with the functions of the device before actually using it.
All modifications of the device are forbidden for safety reasons. Damage caused by user
modifications to the device is not covered by the warranty.
Only use the device for its intended purpose. Using the device in an unauthorised way
will void the warranty.
Damage caused by disregard of certain guidelines in this manual is not covered by the
warranty and the dealer will not accept responsibility for any ensuing defects or
problems.
Nor Velleman nv nor its dealers can be held responsible for any damage (extraordinary,
incidental or indirect) –of any nature (financial, physical…) arising from the possession,
use or failure of this product.
Due to constant product improvements, the actual product appearance might differ from
the shown images.
Product images are for illustrative purposes only.
Do not switch the device on immediately after it has been exposed to changes in
temperature. Protect the device against damage by leaving it switched off until it has
reached room temperature.
Keep this manual for future reference.

VMM501
V. 01 –17/01/2019 3 ©Velleman nv
4. Description
This starter kit is an educational kit based on micro:bit. It comes with basic electronic components, a
breadboard, connection wires and a micro:bit.
5. Examples
5.1 LED
1x micro:bit board
1x micro:bit breadboard adapter
1x breadboard
2x red LED (polarisation: anode (+) = long leg,
cathode (-) = short leg)
2x 100 Ωresistor (brown/black/brown/gold)
In this course, we are going to use micro:bit to make two LEDs
twinkle alternatively.
Place the necessary components on the breadboard as shown.
The programme is written in code blocks, online in the web browser. Open the website www.makecode.com or
https://www.microsoft.com/en-us/makecode?rtc=1, click the micro:bit icon and click Start Project.
The micro:bit code block opens in a new window. Now, we can start composing the code with code blocks,
which we drag and drop from a code drawer to a code editor.
Read below how this works…

VMM501
V. 01 –17/01/2019 4 ©Velleman nv
What is MakeCode?
Formerly PXT –Programming eXperience Toolkit Editor to write code for the micro:bit.
A graphical, beginner-friendly drag-and-drop code editor similar to Scratch. It works online, in the browser.
You can see the editor is made up of different sections. You make your code in the Code Area, dragging out
blocks from the Code Drawer. You can immediately see your code results in the micro:bit simulator. At the
bottom is where you download and save your project.
Next, we will take a closer look at how to use the Options Bar for doing other things.

VMM501
V. 01 –17/01/2019 5 ©Velleman nv
Options Bar
Click to create or add a new project.
Import your projects here.
Open up the Blocks interface to write your scripts with the Block editor.
Open up the Javascript interface to type out your script in the Javascript
language.
Handy reference when you are unsure about how the various blocks and functions
work.
Shortcuts to changing project properties. Rename and delete your projects here.
Reset deletes all the projects that you have saved, so be very careful. Most of
the time, you will just want to stick to Delete Project.
Using the LED Bar
We start by writing some code! Each time you select from the Code Drawer, it will list all the codes available to
you. Drag out the show string block and click inside the box to edit.

VMM501
V. 01 –17/01/2019 6 ©Velleman nv
1
Select
3
Click to edit
2
Drag
See what happens in the micro:bit simulator!
Say Hello!
The text you have been displaying are called strings.
You can show any integer in the LED screen using show number or any 5x5 pixel image using show leds.
You can also plot one point LED at the time using co-ordinates. Co-ordinate (0,0) is the top left corner.
Joining Blocks
Click and hold the block you would like to join. Drag the block to the target block until a side of the target block
is highlighted. Release and the two blocks are now joined!
Clicking on the first block will move the second; clicking on the second will detach it from the first.

VMM501
V. 01 –17/01/2019 7 ©Velleman nv
Testing on micro:bit
Connect the micro;bit to your computer using a micro-USB cable.
It will go through a default sequence, asking you to press buttons and play a game. Try it out!
Click Download to translate your script to a hex file and to download it.
If you set Chrome up properly, you will not need this next step. Drag the downloaded hex file to the micro:bit
drive, or right-click and Send To in Windows®.
You have just programmed your very own device!
Have a look at the code below.
1.
Drag and drop the code blocks to form the code as shown.
You can find the digital write pin P0 to 0block in Advanced Pins in
the Code Drawer. You can find the forever and pause (ms) 100 in Basic
in the Code Drawer.
2.
Set value for P0 to 0. LED0 off = low voltage = 0 V = digital 0. Set value
for P1 to 1. LED1 on = high voltage = 5 V = digital 1.
3.
Set the pause to 500 ms.
4.
Set value for P0 to 1. LED0 on = high voltage = 5 V = digital 1. Set value
for P1 to 0. LED1 off = low voltage = 0 V = digital 0.
5.
Set the pause to 500 ms.
6.
When complete, we compile the programme and generate a hex. file. Click
on the download button and save the hex. file to the Downloads folder
C:\downloads. This hex. file is ready to upload to the micro:bit.
Plug the micro:bit into a USB port. The, drag and drop the hex. file onto the
micro:bit removable device to upload the programme.
You will see the two LEDs flash alternatively. Now, why not make an RGB traffic light?

VMM501
V. 01 –17/01/2019 8 ©Velleman nv
5.2 Button
1x micro:bit board
1x micro:bit breadboard adapter
1x breadboard
2x red LED (polarisation: anode (+) = long leg,
cathode (-) = short leg)
2x 100 Ω resistor (brown/black/brown/gold)
1x momentary push button
We use a button to control the LED flash. Press the button to
make the LED flash in turns. Release to switch off the LED.
Place the necessary components on the breadboard as shown.
Have a look at the code below.
1.
Drag and drop the code blocks to form the code as shown.
You can find the digital read pin P0 and digital write pin P0 to 0blocks
in Advanced Pins in the Code Drawer. You can find the forever and
pause (ms) 100 in Basic in the Code Drawer. You can find the if then
and logic equal function blocks in Logic in the Code Drawer.
Drag the logic equal function block and drop it over the true block.
The two blocks will snap together.
Drag the digital read pin P0 block and drop it over the 0of the logic
equal function block as shown.

VMM501
V. 01 –17/01/2019 9 ©Velleman nv
2.
Set P2 to be a pull-up.
3.
Set the digital read pin to P2.
4.
Set the digital write pin P0 to 0(active low (0 V)).
Set the digital write pin P1 to 1(active high (5 V)).
5.
Set the pause to 500 ms.
6.
Set the digital write pin P0 to 1(active high (5 V)).
Set the digital write pin P1 to 0(active low (0 V)).
7.
Set the pause to 500 ms.
8.
When complete, we compile the programme and generate a hex. file. Click
on the download button and save the hex. file to the Downloads folder
C:\downloads. This hex. file is ready to upload to the micro:bit.
Plug the micro:bit into a USB port. The, drag and drop the hex. file onto the
micro:bit removable device to upload the programme.
Press the button and you will see the LED flash alternatively. Now, how to light the red LED with the button
pressed and light the green LED with the button released?
5.3 Trimpot
1x micro:bit board
1x micro:bit breadboard adapter
1x breadboard
1x 10 kΩ trimmer
We are going to read the output voltage of the trimpot and
display it on the micro:bit screen with a bar graph.
Place the necessary components on the breadboard as shown.

VMM501
V. 01 –17/01/2019 10 ©Velleman nv
Have a look at the code below.
1.
Drag and drop the code blocks to form the code as shown.
You can find the plot bar graph of 0up to 0block in LED in the Code
Drawer.
2.
Set analog read pin to P0. You can find this block in Pins in the Code
Drawer. Set the value up to 1023.
3.
When complete, we compile the programme and generate a hex. file. Click
on the download button and save the hex. file to the Downloads folder
C:\downloads. This hex. file is ready to upload to the micro:bit.
Plug the micro:bit into a USB port. The, drag and drop the hex. file onto the
micro:bit removable device to upload the programme.
Rotate the trimmer. The voltage will be displayed on the micro:bit screen through a bar graph. When the
voltage is 0, the LED screen displays a pixel spot only. When it is 3.3 V, the whole screen will be illuminated.
Now, how would you use the trimmer to adjust the LED’s brightness?
5.4 Photocell
1x micro:bit board
1x micro:bit breadboard adapter
1x breadboard
1x photocell
1x 10 kΩ resistor
(brown/black/black/red/bruin)
Short leg = collector
Positive anode
Long leg = emitter
Negative cathode
We are going to use a photocell to control the brightness of the
micro:bit screen.
Place the necessary components on the breadboard as shown.

VMM501
V. 01 –17/01/2019 11 ©Velleman nv
Have a look at the code below.
1.
First, we make two variables. Go to Variables in the Code Drawer and click
on Make a Variable.
Enter CalVal in the window and click Ok. Enter PhoVal in the window and
click Ok.
You will see two new variables under Variables in the Code Drawer.
We will need these variables later to save the data in a register.
You can find the logic smaller than function and the if then else blocks
in Logic in the Code Drawer. You can find the mathematical function
minus block in Math in the Code Drawer. You can find the show icon
block in Basic in the Code Drawer. You can find the clear screen block in
Basic More in the Code Drawer. You can find the set item to 0block in
Variables in the Code Drawer. Click on the arrow and select CalVal or
PhoVal.
2.
Select the CalVal variable and set the analog read pin to P0.

VMM501
V. 01 –17/01/2019 12 ©Velleman nv
3.
In the forever block, select the PhoVal variable and set the analog read
pin to P0.
4.
Drag the logic smaller than function next to the if block and drop it over
the true block.
Next, we drag and drop the PhoVal variable (from Variables in the Code
Drawer) and drop it over the first 0 of the logic smaller than function.
Drag the mathematical function minus block and drop it over the second
0 of the logic smaller than function.
Next, we drag and drop the CalVal variable (from Variables in the Code
Drawer) and drop it over the first 0 of the mathematical function minus
block. Set the second 0 of the mathematical function minus block to 2.
5.
Drag and drop the show icon block next to the then block. Drag and drop
the clear screen block next to the else block.
6.
When the PhoVal is smaller than CalVal - 2, the display will show a heart.
Else, it will switch off.

VMM501
V. 01 –17/01/2019 13 ©Velleman nv
7.
When complete, we compile the programme and generate a hex. file. Click
on the download button and save the hex. file to the Downloads folder
C:\downloads. This hex. file is ready to upload to the micro:bit.
Plug the micro:bit into a USB port. The, drag and drop the hex. file onto the
micro:bit removable device to upload the programme.
Note: reset the micro:bit to calibrate the reference value according to the current brightness. To run the
programme properly, we must start with the light switched on.
When the light is switched on, nothing is displayed. When the light is switched off, the heart is displayed. Now,
how can we use a photocell to control an LED?
5.5 RGB LED
1x micro:bit board
1x micro:bit breadboard adapter
1x breadboard
1x RGB LED (common cathode)
3x 10 Ω resistor (brown/black/brown/gold)
1. Red (anode +)
2. Ground (cathode -) –longest leg
3. Green (anode +)
4. Blue (anode +)
We are going to make an RGB LED gradually shift its light among red, green and blue.
Place the necessary components on the breadboard as shown.

VMM501
V. 01 –17/01/2019 14 ©Velleman nv
Have a look at the code below.
1.
Drag and drop the code blocks to form the code as shown.
You can find the on button Apressed block in Input in the Code Drawer.
You can find the digital write pin P0 to 0block in Pins in the Code
Drawer.
Select the A option in the on button Apressed block.
Drag 3 digital write pin P0 to 0blocks and insert them in the on button
Apressed block.
Set pin P0 in the first digital write pin P0 to 0block, and set value 0 to 1
(red LED on).
Set pin P1 in the second digital write pin P0 to 0block, and set value to
0 (green LED off).
Set pin P2 in the third digital write pin P0 to 0block, and set value to 0
(blue LED off).

VMM501
V. 01 –17/01/2019 15 ©Velleman nv
2.
Similarly, compile the two on button B/A+B pressed blocks to form the
complete code.
3.
When complete, we compile the programme and generate a hex. file. Click
on the download button and save the hex. file to the Downloads folder
C:\downloads. This hex. file is ready to upload to the micro:bit.
Plug the micro:bit into a USB port. The, drag and drop the hex. file onto the
micro:bit removable device to upload the programme.
Press button A to light the red LED, press button B to light the green LED, press buttons A and B
simultaneously to light the blue LED. Now, how would you realize a soft gradient RGB light?
5.6 Self-Locking Switch
1x micro:bit board
1x micro:bit breadboard adapter
1x breadboard
1x 100 Ω resistor (brown/black/brown/gold)
1x red LED (polarisation: anode (+) = long leg,
cathode (-) = short leg)
1x self-locking or bi-stable switch
We are going to read out the ambient temperature (data) of
the analogue temperature sensor and display the data to the
micro:bit.
Place the necessary components on the breadboard as shown.
Have a look at the code below.

VMM501
V. 01 –17/01/2019 16 ©Velleman nv
1.
Drag and drop the code blocks to form the code as shown.
You can find the set pin P0 to emit edge events and set pull P0 to up
blocks in Pins More in the Code Drawer. You can find the on event
from MICROBIT…EVT_FALL/RISE blocks in Control in the Code
Drawer.
2.
Set the events type on edge. Set the pull pin to P0 and to up.
3.
Now, make a fall event block. Drag and drop the on event from
MICROBIT…EVT°FALL block below the on start block. Click on the first
arrow and select the MICROBIT_ID_IO_P0 option in the pull-down menu.
Click on the second arrow and select the MICROBIT_PIN_EVENT_FALL
option in the pull-down menu.
Drag and drop the digital write pin P0 to 0 block into the event block.
Set pin P0 to P2 and set 0 to 1. You can find the digital write pin P0 to 0
block in Pins in the Code Drawer.
4.
Do the same for the second event block. Instead, click on the second arrow
and select the MICROBIT_PIN_EVENT_RISE option in the pull-down
menu. Also, set pin P0 to P2 of the digital write pin P0 to 0 block and set
the value to 0.
5.
When complete, we compile the programme and generate a hex. file. Click
on the download button and save the hex. file to the Downloads folder
C:\downloads. This hex. file is ready to upload to the micro:bit.
Plug the micro:bit into a USB port. The, drag and drop the hex. file onto the
micro:bit removable device to upload the programme.
Press down the self-locking switch and the LED will switch on. Press again to switch off the LED. Now, how
would you control the micro:bit display with this self-locking switch?
5.7 Temperature Sensor
1x micro:bit board
1x micro:bit breadboard adapter
1x breadboard
1x TMP36 temperature sensor
We are going to read out the ambient temperature (data) of
the analogue temperature sensor and display the data to the
micro:bit.
Place the necessary components on the breadboard as shown.

VMM501
V. 01 –17/01/2019 17 ©Velleman nv
Have a look at the code below.
1.
Drag and drop the code blocks to form the code as shown.
You can find the set item to block in Variables in the Code Drawer. You
can find the map/from low/from high/to low/to high and analog
read pin blocks in Pins in the Code Drawer. You can find the
mathematical function minus and divide in Math in the Code Drawer.
You can find the show number block in Basic in the Code Drawer.
2.
First, we make two variables. Go to Variables in the Code Drawer and click
on Make a Variable.
Enter vol in the window and click Ok. Enter tem in the window and click
Ok.
You will see two new variables under Variables in the Code Drawer.
We will need these variables later to save the data in a register.
Drag and drop the set item to block in the forever block and select the
vol option via the arrow.
Next, we drag and drop the map/from low/from high/to low/to high
block over the 0 next to the set item to block.

VMM501
V. 01 –17/01/2019 18 ©Velleman nv
Drag and drop the analog read pin block next to the map/from
low/from high/to low/to high block and set the to high value 4 to
3300.
Now, we drag and drop a set item to block under the first block. Change
the variable item to vol via the arrow.
The measured voltage in mV via analog read pin P0 is an 8-bit value of 0-
1023 (0-3.3 V) and is mapped from a low value (0 or 0 V) to a high value
(3300 mV or 3.3 V). The measured voltage (mV) is saved in the vol
variable.
Now, we write a formula to convert the measured voltage into a
temperature:
𝑇𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒 (°𝐶) = (Output voltage (mV)−500)
10
In this formula, the output voltage is the vol variable (measured through
the TMP36 sensor). The result of the formula will be saved in the tem
variable.
Let’s write the formula with blocks. Drag and drop the mathematical
function divide over the 0 value of the set vol to block.

VMM501
V. 01 –17/01/2019 19 ©Velleman nv
Drag and drop the mathematical function minus over the first 0 of the
mathematical function divide.
Now, set the second variable from vol to tem, and drag and drop the vol
variable over the first 0 of the mathematical function minus. The
variable vol can be found in Variables in the Code Drawer.
Set the value 0 of the mathematical function minus to 500. Also, Set
the value of the mathematical function divide to 10
Drag and drop the show number block under the set tem to block.

VMM501
V. 01 –17/01/2019 20 ©Velleman nv
Finally, drag and drop the tem variable over the value 0 of the show
number block.
You have written the code!
3.
When complete, we compile the programme and generate a hex. file. Click
on the download button and save the hex. file to the Downloads folder
C:\downloads. This hex. file is ready to upload to the micro:bit.
Plug the micro:bit into a USB port. The, drag and drop the hex. file onto the
micro:bit removable device to upload the programme.
You will see the LED beads flash alternatively. Now, how would you display the temperature in degrees
Fahrenheit?
5.8 Servo
1x micro:bit board
1x micro:bit breadboard adapter
1x breadboard
1x mini servo
1x battery holder with 2x AA 1.5 V battery
We are going to make a servo rotate continuously within a
travel range (0-180°).
Place the necessary components on the breadboard as shown.
Have a look at the code below.
Other manuals for VMM501
1
Table of contents
Languages:
Other Velleman 3D Printer manuals