-
1Install Raspberry Pi OS
Download the latest OS from https://www.raspberrypi.org/downloads/noobs/.
Format the SD card.
Extract the ZIP file to the SD card.
Select the Rasbian OS and install.
-
2Configure the Raspbian OS
sudo raspi-config
1 - Change default pi user password
2 - Hostname
- choose a host name of your liking
4 - Localization Option
- I2 - Change Timezone
- select your country
- select your time zone
- I4 - Change Wi-fi Country
- select your country
5 - Interfacing Options
- P2 - SSH
- Yes
8 - Update
-
3Disable Text Terminals from Blanking
sudo nano /etc/kbd/config
- Edit the following lines to show as follows.
BLANK_TIME=0 BLANK_DPMS=off POWERDOWN_TIME=0
-
4Configure the WiFi
sudo nano /etc/network/interfaces
Comment out the following lines by adding a "#" before each.
iface wlan0 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Add the following lines, where "wireless-ssid" is your SSID and "wireless-password" is your password.
iface wlan0 inet dhcp wpa-ssid "wireless-ssid" wpa-psk "wireless-password"
Reboot.
sudo shutdown -r now
-
5Install Software
Install Git
sudo apt-get update sudo apt-get install git -y
Install Pygame
sudo apt-get install python-pygame -y
Add OneWire Support
sudo nano /boot/config.txt
Edit the file adding the following line to the bottom.
dtoverlay=w1-gpio
Reboot.
sudo shutdown -r now
-
6KS-KegBerry Code
Download the code.
git clone https://github.com/KayserSosa/KS-KegBerry.git
-
7Bench Test Hardware
Temporarily wire all the electronics up.
Flow Meter 1 (Left):
- Red to Pin 2 (5 V)
- Black to Pin 6 (Ground)
- Yellow to Pin 16 (GPIO 23)
Flow Meter 2 (Middle):
- Red to Pin 2 (5 V)
- Black to Pin 6 (Ground)
- Yellow to Pin 18 (GPIO 24)
Flow Meter 3 (Right):
- Red to Pin 2 (5 V)
- Black to Pin 6 (Ground)
- Yellow to Pin 22 (GPIO 25)
Temperature Sensor:
- Red to Pin 1 (3.3 V)
- Black to Pin 6 (Ground)
- Yellow to Pin 7 (GPIO 04)
-
8Bench Test
Run the KS-KegBerry code.
cd KS-KegBerry sudo python KS-kegberry.py
Blow air through each of the flow meters. (Make sure you are blowing in the correct direction.)
Hold the temperature sensor and verify if increases and decreases correctly.
If everything is working correctly, continue on, if not troubleshoot the issues.
-
9Setup Auto Login
Source: https://stackoverflow.com/questions/33753985/raspberry-pi-auto-login-without-etc-inittab
Create a new service.
sudo mkdir –pv /etc/systemd/system/getty@ttyl.service.d sudo nano /etc/systemd/system/getty@ttyl.service.d/autologin.conf
Add the following lines and save/close the file.
[Service] ExecStart= ExecStart=-/sbin/agetty –autologin pi –noclear %I 38400 linux
-
10Setup Auto Execute on Startup
Source: http://www.instructables.com/id/Raspberry-Pi-Launch-Python-script-on-startup/
Create the launcher script.
sudo nano launcher.sh
Add the following lines and save/close the file.
#!/bin/sh # launcher.sh # Navigate to home dir, then to program dir, then execute, then back home cd / cd home/pi/KS-KegBerry sudo python KS-kegberry.py cd /
Make the file executable.sudo chmod 755 launcher.sh
Add a logs directory to the home directory.
sudo mkdir logs
Open up Crontab.
sudo crontab -e
Add the following line to the bottom and save/close the file.
@reboot sh /home/pi/launcher.sh >/home/pi/logs/cronlog 2>&1
Reboot.
sudo shutdown -r now
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.