Bust people for farting with your Raspberry Pi
All kids understand that farts are funny. As we grow older, some of us lose our sense of humour in this area. You'll be glad to hear we believe that building a real working fart detector has both educational and comedic value. If you have a relative or dog who frequently likes to stink up the family home, you'll be able to provide the advanced warning necessary to evacuate the room.
- Understand the difference between analogue and digital
- Understand binary counting
- Understand voltage, current and resistance
- Understand how an air quality sensor works
- Understand fart potency
- To have built and programmed a working fart detector
- To have made a rudimentary DAC (digital to analogue converter)
- Gained experience in Python programming
- Gained experience using the Raspberry Pi GPIO pins
- Raspberry Pi (any model)
- Micro USB power adaptor
- An SD Card with Raspbian already set up through NOOBS (setup guide)
- USB keyboard
- USB mouse
- HDMI cable
- Ethernet cable
- LAN with Internet connection
- A monitor or TV
- Breadboard (try Pimoroni or Maplin)
- Male to Female jumper wires, at least 8 (try Pimoroni)
- Male to Male jumper wires, at least 6 (try Pimoroni)
- 2 x 47k ohm resistor, through hole (try Pimoroni or Maplin)
- 1 x 22k ohm resistor, through hole (try Pimoroni or Maplin)
- 1 x 10k ohm resistor, through hole (try Pimoroni or Maplin)
- 1 x 4.7k ohm resistor, through hole (try Pimoroni or Maplin)
- Air quality sensor (try RS Components)
- python-pygame
- 2 to 3 hours
- Setting up your Pi
- Wire up the Air Quality sensor
- Wire up the trigger pin
- Build a resistor ladder DAC
- Play a test alarm sound
- Write code to calibrate the ladder
- Monitoring for farts and raising the alarm
- Continuous monitoring and recalibration
- Make the output even more amusing
- The worksheet
- (Optional) Final version of Python code farts-final.py
-
Download to your Pi with the following commands:
wget http://goo.gl/DrvYfl -O evacuate.mp3 --no-check-certificate wget http://goo.gl/OJBFEf -O farts-final.py --no-check-certificate chmod +x farts-final.py sudo ./farts-final.py
-
Unless otherwise specified, everything in this repository is covered by the following licence:
Fart Detector by the Raspberry Pi Foundation is licenced under a Creative Commons Attribution 4.0 International License.
Based on a work at https://github.com/raspberrypilearning/fart-detector