VMP502 BASIC LEARNING KIT FOR RASPBERRY PI ® USER MANUAL
VMP502 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.
VMP502 4. Contents • 830 points solderless breadbord • 5 x 10K resistors (RA10K0) • 5 x 2K resistors • 5 x 220R resistors (RA220E0) • 1 x 1602 LCD module (LCD1602BLC) • 1 x T-shape GPIO expansion board • 1 x ribbon cable for GPIO board • 1 x infrared receiver VS1838 • 1 x mini remote control for VMA317 • 1 x 50K potentiometer (K047AM) • 4 x button with round cap 4-pin 12 x 12 mm • 1 x 40 pin 2.
VMP502 6. Operation 6.1 A Blinking LED Learn how to programme the Raspberry Pi® to make an LED burn. Required Hardware • 1 x Raspberry Pi® • 1 x breadboard • 1 x LED • 1 x 220 Ω resistor • jumper wires as needed A semiconductor LED is a type of component, which can turn electric energy into light energy via PN junctions. By wavelength, it can be categorized into a laser diode, an IR LED and a visible LED.
VMP502 C Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_C_code_for_RaspberryPi/01_LED 2. Compile: gcc led.c –o led –lwiringPi 3. Run: sudo ./led Python Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_Python_code_for_RaspberryPi/ 2. Run: sudo python 01_led.py The LED should be blinking. Change the delay time if you want the LED to blink faster. Programming C Programming V.
VMP502 Python Programming 6.2 Controlling an LED by a Button Required Hardware • 1 x Raspberry Pi® • 1 x breadboard • 1 x LED • 1 x 220 Ω resistor • 1 x button • jumper wires as needed V.
VMP502 Use a NO button as the Raspberry Pi® input. When the button is pressed, the GPIO connected to the button will turn into low level (0 V). We can detect the state of the GPIO connected to the button through programming. You can run the corresponding code when the button is pressed, and the LED will light. Experiment C Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_C_code_for_RaspberryPi/02_BtnAndLED/ 2. Compile: gcc BtnAndLed.c –o BtnAndLed –lwiringPi 3. Run: sudo .
VMP502 Programming C Programming Python Programming V.
VMP502 6.3 Flowing LEDs We will see how to make eight LEDs blink in various effects. Required Hardware • 1 x Raspberry Pi® • 1 x breadboard • 8 x LED • 8 x 220 Ω resistor • jumper wires as needed V.
VMP502 Set the GPIO to a low level in turn by programming and LEDs 0 to 7 will light in turn. Control the delay and order to make the LEDs blink in different effects. Experiment C Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_C_code_for_RaspberryPi/03_8Led/ 2. Compile: gcc 8Led.c –o 8Led –lwiringPi 3. Run: sudo ./8Led Python Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_Python_code_for_RaspberryPi/ 2. Run: sudo python 03_8Led.
VMP502 Programming C Programming V.
VMP502 Python Programming 6.4 Breathing LED We will gradually increase and decrease the luminance of an LED with PWM. Required Hardware • 1 x Raspberry Pi® • 1 x breadboard • 1 x LED • 1 x 220 Ω resistor • jumper wires as needed Pulse Width Modulation – or PWM – is a technique for getting analogue results with digital means. Digital control is used to create a square wave, a signal switched between on and off. This on-off pattern can simulate voltages between full on (3.
VMP502 A 60 % duty cycle means the signal is on 60 % of the time but off for 40 % of the time. The “on time” for a 60 % duty cycle could be a fraction of a second, a day, or even week, depending on the length of the period. Experiment V.
VMP502 C Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_C_code_for_RaspberryPi/04_PwmLed 2. Compile: gcc PwmLed.c –o PwmLed –lwiringPi 3. Run: sudo ./PwmLed Python Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_Python_code_for_RaspberryPi/ 2. Run: sudo python 04_PwmLed.py Press ENTER and you will see a gradual change of the LED luminance. Through this experiment, you should have mastered the principle of PWM and how to programme the Raspberry Pi® with PWM.
VMP502 Python Programming 6.5 RGB LED We will gradually increase and decrease the luminance of an LED with PWM. Required Hardware • 1 x Raspberry Pi® • 1 x breadboard • 1 x RGB LED • 3 x 220 Ω resistor • jumper wires as needed RGB LEDs emit light in various colours. They package three LEDs of red, green and blue into a transparent or semi-transparent plastic shell, and have four pins. The three primary colours can be mixed into various colours by brightness.
VMP502 hardware PWM output, but it needs three channels to control the RGB LED, which means it is diffeicult to control the RGB LED with the hardware PWM of the Raspberry Pi®. Fortunately, the softPwm library simulates PWM (softPwm) by programming. RGB LEDs can be categorized into common anode type and common cathode type. In this experiment, the latter is used. Experiment C Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_C_code_for_RaspberryPi/05_RGB 2. Compile: gcc rgb.
VMP502 Programming C Programming V.
VMP502 Python Programming V.
VMP502 6.6 Buzzer Required Hardware • 1 x Raspberry Pi® • 1 x breadboard • 1 x buzzer (active) • 1 x PNP transistor (8550) • 3 x 1 kΩ resistor • jumper wires as needed An electronic buzzer is widely used in computers, alarms, electronic toys, etc. Buzzers can be categorized as active or passive. An active buzzer has a built-in oscillating source, so it will make sounds when electrified. A passive buzzer does not have an oscillating source and will not buzz if DC signals are used.
VMP502 Experiment C Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_C_code_for_RaspberryPi/06_Beep/ 2. Compile: gcc beep.c –o beep –lwiringPi 3. Run: sudo ./beep Python Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_Python_code_for_RaspberryPi/ 2. Run: sudo python 06_beep.py You should the buzzer make a sound. Using a passive buzzer, you can make it sound “do re mi fa sol la si do” with some basic programming knowledge. V.
VMP502 Programming C Programming Python Programming V.
VMP502 6.7 IR Receiver Module An IR receiver is a component which receives IR signals and can independently receive IR rays and output signals compatible with TLL level.
VMP502 Experiment The LED on the module will be blinking. Programming C Programming V.
VMP502 Python Programming 6.8 555 Timer Required Hardware • 1 x Raspberry Pi® • 1 x breadboard • 1 x NE555 • 3 x resistor (1 x 1 kΩ, 2 x 10 kΩ) • 2 x 100 nF capacitor • jumper wires as needed V.
VMP502 A 555 timer is a medium-sized IC device which combines analogue and digital functions. The 555 timer can work under three modes. Here, the astable mode is used to generate square waves. Under the astable mode, the frequency of the output waveform of the 555 timer is defined by R1, R2 and: In the above circuit, R1=R2=10 kΩ=Ω; =100 nF=F. Frequency: After connecting the circuit, use an oscilloscope to observe the frequency of the output waveform. It is consistent with the above calculated result. V.
VMP502 Experiment C Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_C_code_for_RaspberryPi/09_Timer555/ 2. Compile: gcc timer555.c –o timer555 –lwiringPi 3. Run: sudo ./timer555 Python Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_Python_code_for_RaspberryPi/ 2. Run: sudo python 09_timer555.py You should see data on the display, which are square waves generated by the 555 timer. The programme counts pulses by interrupt as we have learned previously.
VMP502 Programming C Programming Python Programming V.
VMP502 6.9 Driving LEDs by 74HC595 We will use the 74HC595 to make eight LEDs blink regularly. Required Hardware • 1 x Raspberry Pi® • 1 x breadboard • 1 x 74HC595 • 8 x LED • 3 x 220 Ω resistor • jumper wires as needed The 74HC595 is a silicon CMOS device, which has an 8-bit shift register and a memory with three-state output function. Compatible with low voltage TTL circuit, the 74HC595 can transform the serial input of 8-bit data into parallel output of 8-bit data.
VMP502 Experiment C Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_C_code_for_RaspberryPi/10_74HC595_LED/ 2. Compile: gcc 74HC595_LED.c –o 74HC595_LED –lwiringPi 3. Run: sudo ./74HC595_LED Python Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_Python_code_for_RaspberryPi/ 2. Run: sudo python 10_74HC595_LED.py You should see eight LEDs blinking regularly. Here, three Raspberry Pi® GPIOs are used to separately control eight LEDs based on the 74HC595.
VMP502 V.
VMP502 Python Programming V.
VMP502 V.
VMP502 6.10 Driving a 7-Segment Display by 74HC595 We will learn to use the 74HC595 to drive a 7-segment display to cycle a figure from 0 to 9. Required Hardware • 1 x Raspberry Pi® • 1 x breadboard • 1 x 74HC595 • 1 x 7-segment display • 3 x 1 kΩ resistor • jumper wires as needed 7-segment displays can be categorized into two types: a common cathode and a common anode, depending on the different light-emitting diode connections.
VMP502 Experiment C Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_C_code_for_RaspberryPi/11_Segment/ 2. Compile: gcc segment1.c –o segment1 –lwiringPi 3. Run: sudo ./segment1 Python Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_Python_code_for_RaspberryPi/ 2. Run: sudo python 11_segment.py You should see the 7-segment display cycle from 0 to 9, and from A to F. You can slightly modify the hardware and software based on the basic configuration to make a dice.
VMP502 1. Change directory: gcc dice.c –o dice –lwiringPi 2. Run: sudo ./dice You should see numbers between 0 and 6 flashing quickly. Press the button on the breadboard and the display will display a random number between 0 and 6 for 2 seconds, and then circularly display random numbers between 0 and 6. Programming C Programming V.
VMP502 Python Programming V.
VMP502 6.11 Driving a Dot Matrix by 74HC595 Required Hardware • 1 x Raspberry Pi® • 1 x breadboard • 2 x 74HC595 • 1 x dot matrix • jumper wires as needed V.
VMP502 Pin number corresponding to rows and columns: COL Pin No. 1 2 3 4 5 6 7 8 13 3 4 10 6 11 15 16 ROW 1 2 3 4 5 6 7 8 Pin No. 9 14 8 12 1 7 2 5 The 8 x 8 dot matrix is made up of 64 LEDs, each LED is placed at the cross point of a row and a column. When the electrical level of a certain row is high and the electrical level of a certain column is low, then the corresponding LED will light.
VMP502 C Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_C_code_for_RaspberryPi/12_DotMatrix/ 2. Compile: gcc dotMatrix.c –o dotMatrix –lwiringPi 3. Run: sudo ./dotMatrix Python Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_Python_code_for_RaspberryPi/ 2. Run: sudo python 12_DotMatrix.py You should the LEDs light. Programming C Programming V.
VMP502 V.
VMP502 Python Programming V.
VMP502 6.12 LCD1602 Module We will see how to use the LCD1602 to display character strings. Required Hardware • 1 x Raspberry Pi® • 1 x breadboard • 1 x LCD1602 • 1 x potentiometer • jumper wires as needed The LCD1602 is a dot matrix used to display characters, symbols, etc. It uses the standard 16-pin port: Pin 1 (GND) Connect to ground. Pin 2 (Vcc) Connect to 5 V positive power supply. Pin 3 (Vo) Used to adjust the contrast of the LCD1602.
VMP502 Experiment C Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_C_code_for_RaspberryPi/13_LCD1602/ 2. Compile: gcc lcd1602_2.c –o lcd1602_2 –lwiringPi 3. Run: sudo ./lcd1602_2 Python Programming 1. Change directory: cd/home/pi/IDUINO_SuperKit_Python_code_for_RaspberryPi/ 2. Run: sudo python 13_lcd1602.py You should see two lines of characters displayed on the LCD1602. Programming C Programming V.
VMP502 V.
VMP502 Python Programming V.
VMP502 V.
VMP502 V.
VMP502 V.
VMP502 V.
VMP502 Use this device with original accessories only. Velleman nv cannot be held responsible in the event of damage or injury resulting from (incorrect) use of this device. For more info concerning this product and the latest version of this manual, please visit our website www.velleman.eu. The information in this manual is subject to change without prior notice. © COPYRIGHT NOTICE The copyright to this manual is owned by Velleman nv. All worldwide rights reserved.
Velleman® Service and Quality Warranty Since its foundation in 1972, Velleman® acquired extensive experience in the electronics world and currently distributes its products in over 85 countries. All our products fulfil strict quality requirements and legal stipulations in the EU. In order to ensure the quality, our products regularly go through an extra quality check, both by an internal quality department and by specialized external organisations.