Posts with «python» label

Simple Computer Gesture Control with Arduino and Python

As outlined in this Circuit Digest write-up, with the right hardware, you can now control your computer using hand gestures. While interesting, this kind of technology can be a little expensive. But if you’d like to augment your notebook or laptop via simple gesture capabilities without breaking the bank, B. Aswinth Raj has your answer in the form of an Arduino Uno and two ultrasonic sensors.

His system places the two sensors at the top of a screen, which are read by the Uno. This data is then passed on to a Python program running on the host computer that allows for actions such as play/pause, fast-forward, and volume control while watching videos.

Given the nature of the setup, there’s no reason why more sensors or programming couldn’t be added for further control, perhaps as shortcut “keys” for your favorite design software package! You can read more about the project here, and see a demo of it below.

Listening for Hand Gestures

[B. Aswinth Raj] wanted to control a VLC player with hand gestures. He turned to two common ultrasonic sensors and Python to do the job. There is also, of course, an Arduino. You can see a video of the results, below.

The Arduino code reads the distance from both sensors — one for the left hand and the other for the right. This allows the device to react to single hand gestures that get closer or further away from one sensor as well as gestures involving both hands. For example, raising your left hand and moving it closer or further away will adjust the volume. The right hand controls rewind and fast forward. Raising both hands will start or stop playback.

Of course, since the Arduino is reading the gestures you could change them to suit you. We might have mounted the sensors further back (or, perhaps, added more sensors) so you could use trigonometry to triangulate the hand’s exact position. Well, perhaps not exact, but you could get an idea of the hand’s motion from right to left as well as forward and backward.

On the host computer side, Python receives serial data from the Arduino and then simulates keystrokes to get the desired result. Of course, this is also highly customizable.

By coincidence, we did a similar project a few years ago using one sensor and the Arduino’s ability to appear like a USB keyboard. We’ve also seen 8 sensors making piano music.


Filed under: Arduino Hacks
Hack a Day 02 Nov 03:00

Arduino and Pi Breathe New Life into Jukebox

What do you do when someone gives you a Wurlitzer 3100 jukebox from 1969, but keeps all the records? If you are like [Tijuana Rick], you grab an Arduino and a Rasberry Pi and turn it into a really awesome digital music player.

We’ll grant you, making a music player out of a Raspberry Pi isn’t all that cutting edge, but restoration and integration work is really impressive. The machine had many broken switches that had been hastily repaired, so [Rick] had to learn to create silicone molds and cast resin to create replacements. You can see and hear the end result in the video below.

[Rick] was frustrated with jukebox software he could find, until he found some Python code from [Thomas Sprinkmeier]. [Rick] used that code as a base and customized it for his needs.

There’s not much “how to” detail about the castings for the switches, but there are lots of photos and the results were great. We wondered if he considered putting fake 45s in the machine so it at least looked like it was playing vinyl.

Of course, you don’t need an old piece of hardware to make a jukebox. Or, you can compromise and build out a replica.

 

 


Filed under: Arduino Hacks, Raspberry Pi

Jetsonbot

Primary image

What does it do?

Avoid obstacles with vision

Hardware overview is in the video with a better description.

Jetson TK1 processes images from the USB webcam and the two Raspberry Pi NoIR cameras then sends commands to the Arduino Mega in order to move autonomously around the environment avoiding obstacles.

The software is custom written and uses OpenCV for image processing.  No ROS, no SLAM, no neural nets or whatever.

Cost to build

Embedded video

Finished project

Number

Time to build

Type

URL to more information

Weight

C64 Keyboard Emulation Over Serial

There’s a lot of reasons you might want to emulate the keyboard on your Commodore 64. The ravages of time and dust may have put the original keyboard out of order, or perhaps you need to type in a long program and don’t fancy pecking away with the less-than-stellar feedback of the standard keys. [podstawek] has come up with the solution: a Commodore 64 keyboard emulator that works over serial.

It’s a simple concept, but one that works well. A Python script accepts incoming keypresses or pre-typed text, then converts them into a 6-bit binary code, which is sent to an Arduino over the serial connection. The Arduino uses the 6-bit code as addresses for an MT8808 crosspoint switch.

MT8808 Functional Diagram from Datasheet

The MT8808 is essentially an 8×8 matrix of controllable switches, which acts as the perfect tool to interface with the C64’s 8×8 keyboard matrix. Hardware wise, this behaves as if someone were actually pressing the keys on the real keyboard. It’s just replacing the original key switches with an electronic version controlled by the Arduino.

[podstawek] already has the setup working on Mac, and it should work on Linux and Windows too. There’s a little more to do yet – modifying the script to allow complex macros and to enable keys to be held – so check out the Github if you want to poke around in the source. Overall it’s a tidy, useful hack to replace the stock keyboard.

The C64 remains a popular platform for hacking — it’s even had a Twitter client since 2009.


Filed under: classic hacks, computer hacks

Raspberry Pi Project

Hey guys,

I'm starting out a project in which I want to build a Raspberry Pi Self Driving Robot. The basic tasks the robot will perform are:

  • Lane tracking using RPi Camera and OpenCV3 + Python
  • Obstacle detection with Ultrasonic sensor + input from RPi Camera(if possible)

The materials I currently plan to use in this project are:

read more

Let's Make Robots 01 Jan 15:42

Raspberry Pi Project

Hey guys,

I'm starting out a project in which I want to build a Raspberry Pi Self Driving Robot. The basic tasks the robot will perform are:

  • Lane tracking using RPi Camera and OpenCV3 + Python
  • Obstacle detection with Ultrasonic sensor + input from RPi Camera(if possible)

The materials I currently plan to use in this project are:

read more

Let's Make Robots 01 Jan 15:42

Raspberry Pi Project

Hey guys,

I'm starting out a project in which I want to build a Raspberry Pi Self Driving Robot. The basic tasks the robot will perform are:

  • Lane tracking using RPi Camera and OpenCV3 + Python
  • Obstacle detection with Ultrasonic sensor + input from RPi Camera(if possible)

The materials I currently plan to use in this project are:

read more

Let's Make Robots 01 Jan 15:42

Raspberry Pi Project

Hey guys,

I'm starting out a project in which I want to build a Raspberry Pi Self Driving Robot. The basic tasks the robot will perform are:

  • Lane tracking using RPi Camera and OpenCV3 + Python
  • Obstacle detection with Ultrasonic sensor + input from RPi Camera(if possible)

The materials I currently plan to use in this project are:

read more

Let's Make Robots 01 Jan 15:42

Pan and Tilt with Dual Controllers

It wasn’t long ago that faced with a controller project, you might shop for something with just the right features and try to minimize the cost. These days, if you are just doing a one-off, it might be just as easy to throw commodity hardware at it. After all, a Raspberry Pi costs less than a nice meal and it is more powerful than a full PC would have been not long ago.

When [Joe Coburn] wanted to make a pan and tilt webcam he didn’t try to find a minimal configuration. He just threw a Raspberry Pi in for interfacing to the Internet and an Arduino in to control two RC servo motors. A zip tie holds the servos together and potentially the web cam, too.

You can see the result in the video below. It is a simple matter to set up the camera with the Pi, send some commands to the Arduino and hook up to the Internet.

The serial protocol for the Arduino is simple: The Pi sends a numeric position followed by a P (for pan) or T (for tilt) at 9600 baud. A web server and some Python handle the interface to the Internet and the human.

We’ve certainly seen our share of similar projects. Some of them have been a bit larger.


Filed under: Arduino Hacks, Raspberry Pi