Difference between revisions of "Raspberry Pi"

From Sketching with Hardware at LMU Wiki
Jump to navigation Jump to search
Line 29: Line 29:
 
<br/> CR: https://de.pinout.xyz/pinout/io_pi_zero
 
<br/> CR: https://de.pinout.xyz/pinout/io_pi_zero
 
<br/> HW: https://www.argon40.com/learn/index.php/2020/03/06/a-comprehensive-guide-on-raspberry-pi-3-and-raspberry-pi-zero-and-zero-w-gpio-pinout/
 
<br/> HW: https://www.argon40.com/learn/index.php/2020/03/06/a-comprehensive-guide-on-raspberry-pi-3-and-raspberry-pi-zero-and-zero-w-gpio-pinout/
<br/> SG: https://medium.com/@nikosmouroutis/how-to-use-atom-with-your-raspberry-pi-through-sftp-382c43176a9e
+
<br/> JW: https://www.raspberrypi.org/documentation/usage/gpio/
<br/> YS: https://pimylifeup.com/raspberry-pi-pinout/
 
  
 
=== Setting up Python ===
 
=== Setting up Python ===
Line 38: Line 37:
 
<br/> CR: https://learn.adafruit.com/setting-up-a-raspberry-pi-with-noobs/download-noobs
 
<br/> CR: https://learn.adafruit.com/setting-up-a-raspberry-pi-with-noobs/download-noobs
 
<br/> HW: https://www.raspberrypi.org/help/noobs-setup./
 
<br/> HW: https://www.raspberrypi.org/help/noobs-setup./
<br/> YS: https://pimylifeup.com/noobs-raspberry-pi/
+
<br/> JW: https://www.raspberrypi.org/documentation/installation/noobs.md
  
 
=== Access to GPIO ===
 
=== Access to GPIO ===
Line 44: Line 43:
 
<br/> CR: https://fedoramagazine.org/raspberry-pi-zero-gpio-fedora/
 
<br/> CR: https://fedoramagazine.org/raspberry-pi-zero-gpio-fedora/
 
<br/> HW: https://webnist.de/raspberry-pi-zero-gpio-pins-ueber-den-desktop-steuern/
 
<br/> HW: https://webnist.de/raspberry-pi-zero-gpio-pins-ueber-den-desktop-steuern/
<br/> SG: https://github.com/fivdi/onoff
 
<br/> YS: https://www.electronicwings.com/raspberry-pi/raspberry-pi-gpio-access
 
  
 
=== Blinking an LED ===
 
=== Blinking an LED ===
Line 51: Line 48:
 
<br/> CR: https://fedoramagazine.org/raspberry-pi-zero-gpio-fedora/
 
<br/> CR: https://fedoramagazine.org/raspberry-pi-zero-gpio-fedora/
 
<br/> HW: https://webnist.de/raspberry-pi-zero-gpio-pins-ueber-den-desktop-steuern/
 
<br/> HW: https://webnist.de/raspberry-pi-zero-gpio-pins-ueber-den-desktop-steuern/
<br/> SG: https://github.com/fivdi/onoff#blink-an-led-using-the-synchronous-api
+
<br/> JW: http://www.heidislab.com/tutorials/getting-started-with-raspberry-pi-led-blinking-on-raspberry-pi-zero
<br/> YS: https://electrosome.com/led-blinking-raspberry-pi/
 
  
 
=== Reading a Pin ===
 
=== Reading a Pin ===
Line 58: Line 54:
 
<br/> CR: https://learn.sparkfun.com/tutorials/raspberry-gpio/all
 
<br/> CR: https://learn.sparkfun.com/tutorials/raspberry-gpio/all
 
<br/> HW: https://mjrobot.org/rpi-gpiozero/
 
<br/> HW: https://mjrobot.org/rpi-gpiozero/
<br/> SG: https://tutorials-raspberrypi.de/raspberry-pi-gpio-erklaerung-beginner-programmierung-lernen/
 
<br/> YS: https://projects-raspberry.com/reading-and-writing-from-gpio-ports-from-python/
 
  
 
=== Runing a Webserver that access GPIO ===
 
=== Runing a Webserver that access GPIO ===
Line 65: Line 59:
 
<br/> CR: https://www.e-tinkers.com/2018/04/how-to-control-raspberry-pi-gpio-via-http-web-server/
 
<br/> CR: https://www.e-tinkers.com/2018/04/how-to-control-raspberry-pi-gpio-via-http-web-server/
 
<br/> HW: https://hackaday.io/project/173322-controlling-gpio-outputs-using-a-web-interface-wit
 
<br/> HW: https://hackaday.io/project/173322-controlling-gpio-outputs-using-a-web-interface-wit
<br/> SG: https://randomnerdtutorials.com/raspberry-pi-web-server-using-flask-to-control-gpios/
 
<br/> YS: https://www.hackster.io/leograba/creating-an-express-js-webserver-to-access-gpio-5f152f
 
  
 
=== Restful API ===
 
=== Restful API ===
Line 72: Line 64:
 
<br/> CR: https://docs.dataplicity.com/docs/control-gpios-using-rest-api
 
<br/> CR: https://docs.dataplicity.com/docs/control-gpios-using-rest-api
 
<br/> HW: https://www.youtube.com/watch?v=JZfevVG-VuA&list=PLLIDdNg0t5ceg3mI3vn0YJocJ4ndMtM98&index=4&t=0s
 
<br/> HW: https://www.youtube.com/watch?v=JZfevVG-VuA&list=PLLIDdNg0t5ceg3mI3vn0YJocJ4ndMtM98&index=4&t=0s
<br/> SG: https://tutorials-raspberrypi.de/raspberry-pi-nodejs-webserver-installieren-gpios-steuern/
 
<br/> YS: https://www.mulesoft.com/resources/api/restful-api
 
  
 
=== Description of the components ===
 
=== Description of the components ===
Line 79: Line 69:
 
<br/> CR: https://computer.howstuffworks.com/raspberry-pi2.htm
 
<br/> CR: https://computer.howstuffworks.com/raspberry-pi2.htm
 
<br/> HW: https://learn.adafruit.com/introducing-the-raspberry-pi-zero
 
<br/> HW: https://learn.adafruit.com/introducing-the-raspberry-pi-zero
<br/> SG: https://de.wikipedia.org/wiki/Raspberry_Pi  ;)
+
<br/> JW: https://www.youtube.com/watch?v=WJdQ4rknBX0
<br/> YS: https://tutorials-raspberrypi.com/raspberry-pi-sensors-overview-50-important-components/
 
  
 
== Project Ideas ==
 
== Project Ideas ==
  
 
=== SG ===
 
=== SG ===
<h3>mindSat</h3>
 
'''What is it?''': A small portable gadget. Which can record sensor data and give feedback to a user. Mind satisfaction for your offices days.
 
</br>'''How does it work?''': It comes with five sensors (humidity, haptic, temperature, acceleration & gyroscope) to analyze the users environment and helping him through exercises.
 
</br>'''Guided Exercises''': It’s hard to do small exercises, often we find excuses to not do it. Concentrated breathing can help your brain to relax, or focusing on small things can reduce stress. Using those informations to create short (~ 5min) exercises.
 
</br>'''Gamification?''': Reward users for doing exercises. Rewards should be connected with physical things
 
</br>'''Healthy life''':  According to Google:
 
Eat healthy, move your body, drink water, breathe, meditate (pray), take a walk and sleep well. Thats all it needs. With mindSat we try to satisfy your healthy needs.
 
  
 
=== JL ===
 
=== JL ===
Home Office Buddy:
 
<br/>A speaker communicating in a pleasant way with the target person in order to minimize a possible social isolation and encourage the keeping of important routines & daily structures in order to maintain a certain productivity during a working day.
 
<br/>For Example: Suggest unplanned short breaks if the target person is showing a lack of concentration measured by a certain level of body movement.
 
  
 
=== JP ===
 
=== JP ===
 
'''Problem''': too much sitting while working in the office
 
</br>'''Idea''': adjustable desk
 
</br>'''Sensors''': on the chair, to check, if the user is sitting and how long
 
</br>'''Notification''': User gets a message after a certain time, that the desk will rise for min. 30 minutes. After that time the desk can be lowerd again, if wished. The Sensor will messures again.
 
</br>'''Gamification''': a little "stand-up-figure" will be on the desk and will stand up, if the desk is rised. Will be collapse, if the desk is lowered.
 
  
 
=== CR ===
 
=== CR ===
Line 113: Line 86:
 
=== YS ===
 
=== YS ===
  
<b> Wall-E: your digital stress cleaner </b>
+
=== JW ===
<br/> <b> Motivation:</b>
+
Problem: ① Uncomfortable working environment in aspects of lighting and air quality; ② Avoidable disturbance by colleges, etc.; ③ Remaining stationary for too long
<br/>Have you ever checked your social media account every five minutes to see if someone has liked your new post? Are you really stressful after browsing Tik Tok for 3 hours and just find you can not finish your task for uni today but you can not stop yourself? Then you may need this robot to "clean" your digital stress!
+
 
<br/> <b> Features: </b>
+
Solution: ① Automatic adjustable light, automatic jalousie roller, automatic humidifier, LED as indicator next to windows; ② Display as door sign; ③ Speaker with a switch as indicator
<ul>
 
<li> The buggy has two “hands” and one trash can </li>
 
<li> Users’ stress detection: EDA/HRV </li>
 
<li> If stressful: The buggy will  </li>
 
<ul>
 
<li> search for the smartphone (RFID or GPS)</li>
 
<li> steal the smartphone </li>
 
<li> drop it into the trash can </li>
 
</ul>
 
<li> If user calms down: be allowed to use smartphone </li>
 
</ul>
 
  
=== JW ===
+
Sensor: Temperature and humidity sensor Bme280, light sensor Tsl2561, CO2 sensor, motion sensor
  
 
=== HW ===
 
=== HW ===

Revision as of 02:31, 20 November 2020

There are different version of the Raspberry Pi https://www.raspberrypi.org/, e.g.

  • Raspberry Pi 4 Model B
  • Raspberry Pi Zero W
  • Raspberry Pi Zero
  • Raspberry Pi 400
  • Raspberry Pi 3 Model B

The Raspberry Pi is a Linux computer that has a multitude of connectors and in particular, it provides GPIO pins. The connector (HAT) provides an easy way to add your own sensors and actuators and there are many boars that can be connected.

Audio input and output are not very good, hence we recommend using a USB Sound Adapter (the 5€ versions work very well).

For programming, we will use python.

For controlling the Pins on the Raspberry Pi, you may want to look at the following library


Web server on the Raspberry Pi

Resources

Pinout of Pi Zero

physical connections
JL: https://peppe8o.com/raspberry-pi-zero-pinout/
CR: https://de.pinout.xyz/pinout/io_pi_zero
HW: https://www.argon40.com/learn/index.php/2020/03/06/a-comprehensive-guide-on-raspberry-pi-3-and-raspberry-pi-zero-and-zero-w-gpio-pinout/
JW: https://www.raspberrypi.org/documentation/usage/gpio/

Setting up Python

NOOBS configure
JL: https://www.tutorialspoint.com/python/python_environment.htm
CR: https://learn.adafruit.com/setting-up-a-raspberry-pi-with-noobs/download-noobs
HW: https://www.raspberrypi.org/help/noobs-setup./
JW: https://www.raspberrypi.org/documentation/installation/noobs.md

Access to GPIO

JL: http://codefoster.com/pi-basicgpio/
CR: https://fedoramagazine.org/raspberry-pi-zero-gpio-fedora/
HW: https://webnist.de/raspberry-pi-zero-gpio-pins-ueber-den-desktop-steuern/

Blinking an LED

JL: https://raspberrypihq.com/making-a-led-blink-using-the-raspberry-pi-and-python/
CR: https://fedoramagazine.org/raspberry-pi-zero-gpio-fedora/
HW: https://webnist.de/raspberry-pi-zero-gpio-pins-ueber-den-desktop-steuern/
JW: http://www.heidislab.com/tutorials/getting-started-with-raspberry-pi-led-blinking-on-raspberry-pi-zero

Reading a Pin

JL: http://raspberry.io/projects/view/reading-and-writing-from-gpio-ports-from-python/
CR: https://learn.sparkfun.com/tutorials/raspberry-gpio/all
HW: https://mjrobot.org/rpi-gpiozero/

Runing a Webserver that access GPIO

JL: https://towardsdatascience.com/python-webserver-with-flask-and-raspberry-pi-398423cc6f5d
CR: https://www.e-tinkers.com/2018/04/how-to-control-raspberry-pi-gpio-via-http-web-server/
HW: https://hackaday.io/project/173322-controlling-gpio-outputs-using-a-web-interface-wit

Restful API

JL: https://sites.google.com/site/cartwrightraspberrypiprojects/home/other-projects/rest-api
CR: https://docs.dataplicity.com/docs/control-gpios-using-rest-api
HW: https://www.youtube.com/watch?v=JZfevVG-VuA&list=PLLIDdNg0t5ceg3mI3vn0YJocJ4ndMtM98&index=4&t=0s

Description of the components

JL: https://www.adafruit.com/product/3411
CR: https://computer.howstuffworks.com/raspberry-pi2.htm
HW: https://learn.adafruit.com/introducing-the-raspberry-pi-zero
JW: https://www.youtube.com/watch?v=WJdQ4rknBX0

Project Ideas

SG

JL

JP

CR

Problem: Tension due to prolonged sitting and incorrect sitting positions (e.g. crooked shoulders)
Sensors: Kinect for analysis of posture, sensors that measure the tension in the neck
The longer one maintains a bad sitting position, the older/bent an avatar becomes on the screen. Through movement the avatar becomes younger/upright again.

YS

JW

Problem: ① Uncomfortable working environment in aspects of lighting and air quality; ② Avoidable disturbance by colleges, etc.; ③ Remaining stationary for too long

Solution: ① Automatic adjustable light, automatic jalousie roller, automatic humidifier, LED as indicator next to windows; ② Display as door sign; ③ Speaker with a switch as indicator

Sensor: Temperature and humidity sensor Bme280, light sensor Tsl2561, CO2 sensor, motion sensor

HW

Problem: Pain in the hand and wrist due to consistent movement or incorrect hand/arm position
Sensors: e.g. Leap Motion for motion and posture detection, keyboard/mouse to track activity (?)
Vibration of the mouse/keyboard if the same position was kept for too long or no pause was made. A visualization of an inflammation (red pulsating circles) is displayed, which gets worse/better depending on user behavior. This warns the user when his hand position is worsening. The user may choose to be prevented from continuing to work or not.