This is a fun and very easy project I came up with while trying to build a wireless shutter for an iPhone. I knew selfie sticks could trigger your camera shutter, so I was trying to find out what information they were sending through the 3.5mm aux port (aka headphone plug) to do this.
In this process I learned that headphone volume buttons will also trigger the camera shutter!
So I plugged in some headphones with volume control, and tried to come up with a way to attach my phone to a stick. I came up with the spatula sponge elastic combo you'll see here.
Take a look for yourselves!
January 11, 2017
January 05, 2017
Markov Chains: The Imitation Game
In this post we're going to build a Markov Chain to generate some realistic sounding sentences impersonating a source text. This is one of my favourite computer science examples because the concept is so absurdly simple and and the payoff is large. This will be done using python, and your final code will look like this.
Before I explain how it works though, let's look at an example generated from the past four Cyber Omelette posts:
So it's not exactly coherent, but it comes pretty close! I also built a twitter bot called mayhem_bot (git repo) using this concept. This bot imitates users and trending hashtag discussions, so send it some tweets if you want more examples.
Before I explain how it works though, let's look at an example generated from the past four Cyber Omelette posts:
"The first step to attach our mirror is done by simply screw the backing with a Raspberry Pi's into the filename. That looks like installing and blinking cursor. Type the wood screws.
Gorilla glue.
Electrical tape.
Extension Cord with multiple passes of the all Together Once it hasn't really stuck in place until all directions. Clean your monitor."
So it's not exactly coherent, but it comes pretty close! I also built a twitter bot called mayhem_bot (git repo) using this concept. This bot imitates users and trending hashtag discussions, so send it some tweets if you want more examples.
Rat dreams of stealing the treat bag and NOT getting caught. #unlikelyanimaldreams #mayhem_bot— Mayhem Bot (@mayhem_bot) December 20, 2016
— Mayhem Bot (@mayhem_bot) December 9, 2016
December 15, 2016
DIY Smart Mirror ft. Alexa
Materials
- Computer Monitor. Buy used and look for cable inputs that point down or sideways instead of straight out. 22" recommended (I used Acer AL2216 )
- Video cable. Whatever fits your monitor (I used HDMI to DVI adapter)
- Raspberry Pi 3, 16GB Micro SD Card, 5V Micro USB power supply, any RPi case
- Wood. I bought four 3ft lengths of 3"x1"
- 8 Angle brackets
- Short wood screws.
- Gorilla glue.
- Electrical tape.
- Extension Cord with multiple plugs.
- 50cm x 70cm Ikea STROMBY frame.
- Gila Mirrored Window Film
- USB Sound Card, Lapel Mic, any USB powered speaker *
*Bonus Alexa Materials
Additional required tools/supplies are: scotch tape, a squirt bottle, dish soap, a drill or screwdriver, exacto knife, scissors, and a saw.
March 10, 2018 update: I'm currently in the process of trying out an actual two way mirror as well instead of the window film. If you're interested in this I can recommend this mirror which comes in several sizes. I'll have a post coming soon with instructions for how to mount it.
Creating the Two Way Mirror
The two way mirror is the most essential part of this build. To create this component, you just apply Gila Mirrored Window Film to any piece of glass or acrylic. This works equally well for glass and acrylic, and only takes about 15 minutes.
December 09, 2016
Raspberry Pi Bot Server
My trusty RPi3 twitter bot server "starkiller". |
So let's say you've got a twitter bot that you want running 24/7, but you don't want it running on your personal system. What you need here is a server, which is really just a dedicated system. Note, if you're looking for a web server, you'd be better off with Amazon's AWS .
If you're running automated tasks and answering tweets however, a Raspberry Pi is an excellent choice.
The steps are pretty straightforward:
1. Setup a computer (raspberry pi) to run your program.
2. Write a script to launch your program.
3. Run the script automatically at startup.
Setup your computer
The starting point here is simply to buy a Raspberry Pi. RPi3 is great because it has build in wifi, and it's very affordable, any generation will work though. Once you've got the hardware, you need to install an OS. I strongly recommend Raspbian Jessie with Pixel (download and install guide can be found here).
Labels:
automation,
bot,
crontab,
hardware,
raspberry pi,
raspbian,
rpi,
rpi3,
server,
software,
twitter bot
December 08, 2016
From the Vault: PICHEC Raspberry Pi Cluster
I want to document this project, as it is one of my favourite projects to date. This took place about 4 years ago while I was working at the Irish Centre for High End Computing (ICHEC).
One of ICHEC's projects at the time was creating demonstration for the BT Young Scientist Exhibition to explain the use of parallel computing. I volunteered to build a Raspberry Pi cluster for this, along with a parallel demo application called Conway's Game of Life. The (very old) code can be found here, and more details about the simulation can be found in the official handout.
The best part of the project was building the cluster. My design placed the 8 Raspberry Pi's into the legs of a plexiglass enclosure shaped like the pi symbol. I also wrapped ethernet cables in colour electrical tape to give them distinct colours, and added several strands of EL Wire to make it glow.
Here are a couple of photos of the cluster and build process.
One of ICHEC's projects at the time was creating demonstration for the BT Young Scientist Exhibition to explain the use of parallel computing. I volunteered to build a Raspberry Pi cluster for this, along with a parallel demo application called Conway's Game of Life. The (very old) code can be found here, and more details about the simulation can be found in the official handout.
The best part of the project was building the cluster. My design placed the 8 Raspberry Pi's into the legs of a plexiglass enclosure shaped like the pi symbol. I also wrapped ethernet cables in colour electrical tape to give them distinct colours, and added several strands of EL Wire to make it glow.
Here are a couple of photos of the cluster and build process.
Glorious PICHEC |
November 30, 2016
DIY Alexa Raspberry Pi Voice Assistant
Amazon did something really cool. They made their Alexa voice assistant code open source and cross platform. That means instead of buying their Amazon Echo to get a home assistant, you can simply install it on any system you want.
It's actually a fairly straightforward project, especially if you've setup a Raspberry Pi before (or eight #fromthevault)! Basically you're just installing an application, and setting up a microphone and speaker. Nothing fancy.
There are already some great guides for getting started too for both Raspberry Pi and Alexa. I'm just going to direct you to these, give a rough overview, and add some additional tips.
Here it is in action:
For equipment, you'll need:
1. A Raspberry Pi 3 with SD card and USB micro power source:
It's actually a fairly straightforward project, especially if you've setup a Raspberry Pi before (or eight #fromthevault)! Basically you're just installing an application, and setting up a microphone and speaker. Nothing fancy.
There are already some great guides for getting started too for both Raspberry Pi and Alexa. I'm just going to direct you to these, give a rough overview, and add some additional tips.
Here it is in action:
Shopping List
For equipment, you'll need:
1. A Raspberry Pi 3 with SD card and USB micro power source:
November 24, 2016
Intro to Python: Hello World! (Part 1 /2)
Many of the projects on this site use a programming language called python. Python is a great language for beginners, because it is designed to be very readable, but it's also very powerful. It is powerful because there are a lot of powerful libraries and APIs that are easy to use made for python, which allows you to write some pretty exciting programs without much code.
In this post, I walk you through installing python, and running your first program. In the next post I will introduce containers and functions used to make code readable and re-usable.
Once you have completed both parts, you should have a good understand of the language features I use in the programs on this blog. There is a lot you can do with only a few concepts!
Here are a couple projects to check out once you have completed these tutorials:
Making a simple Twitter Bot
Reddit word counting
Writing an orbit simulator
Now let's get down to business.
In this post, I walk you through installing python, and running your first program. In the next post I will introduce containers and functions used to make code readable and re-usable.
Once you have completed both parts, you should have a good understand of the language features I use in the programs on this blog. There is a lot you can do with only a few concepts!
Here are a couple projects to check out once you have completed these tutorials:
Making a simple Twitter Bot
Reddit word counting
Writing an orbit simulator
Now let's get down to business.
Intro to Python: Containers, Functions, and Loops (Part 2 /2)
This is the second post in a series. If you're just getting started, see Part 1.
In the previous post, you got python installed, and ran a simple program. In this section we will use some language features to store data, and re-use code. These are important concepts for all programming languages.
Before we get started, let me warn you to pay attention to your indentation / white space here. Python doesn't care if you use tabs or spaces for white space, but does require that indented blocks are consistent.
The first container we will look at is a list. A list is rather unsurprisingly just a series of items in a single object. To create a list, you just assign values inside square brackets separated by commas. After it is created you can add values using your_list_name.append(value).
In the previous post, you got python installed, and ran a simple program. In this section we will use some language features to store data, and re-use code. These are important concepts for all programming languages.
Before we get started, let me warn you to pay attention to your indentation / white space here. Python doesn't care if you use tabs or spaces for white space, but does require that indented blocks are consistent.
Lists
The first container we will look at is a list. A list is rather unsurprisingly just a series of items in a single object. To create a list, you just assign values inside square brackets separated by commas. After it is created you can add values using your_list_name.append(value).
Subscribe to:
Posts (Atom)