Giter Club home page Giter Club logo

hardware_demo's Introduction

hardware_demo

voyeur

Voyuer is the code used to control a robotic Venetian blind. It consists of a Raspberry Pi 3, a camera and screen to display the camera output. It using OpenCV to control a servo to close a Venetion blind when it detects a face and open a Venetian blind when it doesn't detect a face.

The goal of the work is to question how we interact with technology. Is looking at our screens similar to looking through windows? What permission do we have to look through these windows? Who is controlling what we see through these screens? What happens if the screens react to our presence?

NOTE: The project is still in development and this code/instructions are for a very early prototype.

Materials

Construction

Setup/Install Required Software

This installs OpenCV from a binary. The version is a bit outdated and only has python2 bindings, but I've found that having an outdated version is much easier than having to compile OpenCV from source. PyImageSearch has a tutorial if you'd like to try and install OpenCV and the python3 bindings from source.

sudo apt-get install opencv

Install pigpio library to interface with the gpio pins.

sudo apt-get install pigpio

Start pigpio daemon process so the library can communicate with the gpio pins.

sudo pigpiod

Setup Harware

  1. Connect and configure the camera module to the Rasberry Pi. Tutorial
  2. Connect the Pi cobbler and breakout cable to the GPIO pins on the Raspberry Pi on one end and the breadboard on the other.
  3. Using the breadboard, connect the servo to the Raspberry Pi GPIO pins. Since we are powering only a single servo, we're connect the servo directly to the Raspberry Pi. The servo is controlled via Pulse Width Modulation (PWM) signals driven in software by the pigpio library. Connect the red cable on the servo to the 5V pin on the Pi, the brown cable to the GND pin on the Pi, and the yellow cable to pin 18 (the pin we'll use to send the PWM signal) on the Pi. Reference.
  4. Attach the servo to the blind openning/closing mechanism. I strung a piece of wire through the top of the servo to twist the blinds open/close when the servo turns.

Putting it all together

Now with all the requisite software + hardware, you can use the code in this repo to control the blinds! Clone this repo and you should be ready to go!

Be forewarned, the code here is still very rough. Before optimizing I wanted to get this working end-to-end so the blind control code has no safeguards in place to prevent the blinds from getting damaged if they're not in the expected state. e.g. the main code expects the blinds to start open, if they don't the code might think the blinds are in one state, but actually be in another.

Another thing I'm not proud of right now is shelling out to the pigs command line tool to send the PWM signals to the servo. In my haste to get the prototype working, I had some trouble working with the pigpio python bindings directly, but was able to use the command line tool without problems.

Resources

PWM software control on the Pi

PyImageSearch Python OpenCV Tutorials

Credits

Credits go to Etan and Siraj

hardware_demo's People

Contributors

llsourcell avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.