3 Joy-Pi
Joy-Pi TABLE OF CONTENTS 1. Overview 2. Details 3. Changing modules and using the GPIOs 4. Using Python and Linux 5. Lessons 5.1 Lesson 1: Using the buzzer for warning sounds 5.2 Lesson 2: Controlling the buzzer with key inputs 5.3 Lesson 3: How a relay works and how to control it 5.4 Lesson 4: Sending a vibration signal 5.5 Lesson 5: Detecting noises with the sound sensor 5.6 Lesson 6: Detecting brightness with the light sensor 5.7 Lesson 7: Detecting the temperature and the humidity 5.
Joy-Pi The login data is: Username: pi Password: 12345 1. OVERVIEW Dear customer, Thank you very much for choosing our product. In the following we will show you what has to be observed during commissioning and use. Should you encounter any unexpected problems during use, please feel free to contact us. The following lessons are designed so that, regardless of how much prior knowledge you already have, you can complete all lessons without any problems.
Joy-Pi 1 Raspberry Pi 2 GPIO LED Display 3 Breadboard - for creating custom curciuts with external modules 4 16x2 LCD Module (MCP23008) 5 Power supply 6 8x8 LED Matrix (MAX7219) 7 7 Segment LED display (HT16K33) 8 Vibration module 9 Light sensor - to measure the light intensity (BH1750) 10 Buzzer - to generate alarm tones 11 Sound sensor 12 Motion sensor (LH1778) 13 Ultrasonic sensor - Used for distance measurement 14 / 15 Servo interfaces - for connecting servo motors 16 Stepp
Joy-Pi 3. CHANGING MODULES AND USING THE GPIOS CHANGING MODULES The Joy-Pi board contains 2 switching units. Each unit contains 8 switches. The switches make it possible to switch between the use of sensors and modules. Since the Raspberry Pi has only a limited number of GPIO pins, we need the switches to be able to use more sensors.
Joy-Pi USING THE GPIOS In the following we will explain in more detail what GPIO's are, how they work and how they are controlled. GPIO stands for: "General-purpose input / output" (universal input / output). GPIO pins have no specific purpose. They can be configured as either input or output and have a general purpose. This depends on what you want to achieve.
Joy-Pi There are 2 possible Raspberry Pi GPIO schemes: GPIO-BOARD and GPIO-BCM The GPIO-BOARD option indicates that you are referring to the pins by the pin number. This means that the pin numbers listed below will be used. The GPIO.BCM option means that you refer to the pins of the "Broadcom SOC Channel". These are the numbers after "GPIO" . GPIO-Board Number: GPIO-Board Number: 1 3.
Joy-Pi ASSIGNMENT OF THE GPIO PINS ACCORDING TO GPIO.BOARD SCHEME GPIO-Board Number: 1 Used sensors and modules: 3.3V 2 5.0V 3 I2C, SDA1 (Licht Sensor, LCD Display, 7 Segment Display) 4 5.0V 5 I2C, SCL1 (Light Sensor, LCD Display, 7 Segment Display) 6 Ground 7 DHT11 Sensor 8 TXD0 9 Ground 10 RXD0 11 Touch Sensor 12 Buzzer 13 Button matrix (ROW1), Vibration motor 14 Ground 15 Button matrix (ROW2), Tilt sensor 16 Motion sensor 17 3.
Joy-Pi In our examples we use Python language to control the GPIO pins. In Python there is a library called "RPi.GPIO". This is a library that helps to control the pins programmatically with Python. Take a look at the following example and the comments in the code to better understand how it works. The first step will be to import the library by typing the command "RPi.GPIO as GPIO", then the "time" library comes with the command "import time". Then we set the GPIO mode to GPIO.BOARD.
Joy-Pi GETTING THE PREINSTALLED OPERATING SYSTEM For the First Step you have to Download the image file with the Joy-Pi operating system. You can find the file on our website at https://joy-pi.net/downloads/. 1. Load the .Zip file onto your computer and unzip it to any folder you like. You should receive a .ISO file 2. Connect a MicroSD card to your computer with the attached MicroSD card reader. 3. Now format the MicroSD card with the program „SD Formatter“ 4.
Joy-Pi 4. USE OF PYTHON AND LINUX This step is optional, but makes it easier to execute scripts without having to create them individually. The scripts used in this guide can be downloaded directly from a package. Simply follow the instructions below: 1. Open the "Terminal". We use this to run most of our Python scripts and download extensions and scripts. Published: 20.02.
Joy-Pi 2. After successfully opening the terminal, we need to download the script archive to the desktop with the following commands: cd Desktop/ wget http://anleitung.joy-it.net/wp-content/uploads/2019/01/Joy-Pi.zip 3. Press "Enter" on your keyboard. Now all you have to do is unpack the archive: unzip JoyPi.zip 4. Press "Enter" and wait until the process is completed. 5.
Joy-Pi EXECUTING PYTHON SCRIPTS After we successfully downloaded our script, we would like to execute it. Open the terminal again and follow the instructions below to run the script: Write the command "sudo python