The Raspberry Pi is a great machine to learn the ins and outs of blinking pins, but for doing anything that requires blinking pins fast, you’re better off going with a BeagleBone. This has been the conventional wisdom for years now, and now that the updated Raspberry Pi 2 is out, there’s the expectation that you’ll be able to blink a pin faster. The data are here, and yes, you can.
The method of testing was connecting a PicoScope 5444B to a pin on the GPIO pin and toggling between zero and one as fast as possible. The original test wasn’t very encouraging; Python maxed out at around 70 kHz, Ruby was terrible, and only C with the native library was useful for interesting stuff – 22MHz.
Using the same experimental setup, the Raspberry Pi 2 is about 2 to three times faster. The fastest is still the C native library, topping out at just under 42 MHz. Other languages and libraries are much slower, but the RPi.GPIO Python library stukk sees a 2.5x increase.
There’s something so nostalgic about the rotary phone that makes it a fun thing to hack and modernize. [Voidon] put his skills to the test and converted one to VoIP using a Raspberry Pi. He used the RasPi’s GPIO pins to read pulses from the rotary dial – a functional dial is always a welcome feature in rotary phone hacks. An old USB sound card was perfect for the microphone and handset audio.
As with any build, there were unexpected size issues that needed to be worked around. While the RasPi fit inside the case well, there was no room for the USB power jack or an ethernet cable, let alone a USB power bank for portability. The power bank idea was scrapped. [voidon] soldered the power cord to the RasPi before the polyfuse to preserve the surge protection, used a mini-USB wifi dongle, and soldered a new USB connector to the sound card. [Voidon] also couldn’t get the phone’s original ringer to work, so he used the Raspberry Pi’s internal sound card to play ringtones.
The VoIP (SIP) was managed by some Python scripting, available at GitHub. [voidon] has some experience in using Asterisk at his day job, so it will be interesting to see if he incorporates it in the future.
[Don] and his wife were looking for a way to teach their two-year old daughter how to tell time. She understood the difference between day and night, but she wasn’t old enough to really comprehend telling the actual time. [Don’s] solution was to simplify the problem by breaking time down into colored chunks representing different tasks or activities. For example, if the clock is yellow that might indicate that it’s time to play. If it’s purple, then it’s time to clean up your room.
[Don] started with a small, battery operated $10 clock from a local retailer. The simple clock had a digital readout with some spare room inside the case for extra components. It was also heavy enough to stay put on the counter or on a shelf. Don opened up the clock and got to work with his Dremel to free up some extra space. He then added a ShiftBrite module as a back light. The ShiftBrite is a high-brightness LED module that is controllable via Serial. This allows [Don] to set the back light to any color he wants.
[Don] already had a Raspberry Pi running his DIY baby monitor, so he opted to just hijack the same device to control the ShiftBrite. [Don] started out using a Hive13 GitHub repo to control the LED, but he found that it wasn’t suitable for this project. He ended up forking the project and altering it. His alterations allow him to set specific colors and then exit the program by typing a single command into the command line.
The color of the ShiftBrite is changed according to a schedule defined in the system’s crontab. [Don] installed Minicron, which provides a nice web interface to make it more pleasant to alter the cron job’s on the system. Now [Don] can easily adjust his daughter’s schedule via web page as needed.
We can never seem to get enough garage door hacks around here. [Tanner’s] project is the most recent entry into this category. He’s managed to hook up a Raspberry Pi to his garage door opener. This greatly extends his range to… well anywhere with an Internet connection.
His hack is relatively simple. He started with the garage door opener remote. He removed the momentary switch that was normally used to active the door. He bridged the electrical connection to create a circuit that was always closed. This meant that as long as the remote had power, the switch would be activated. Now all [Tanner] had to do was remove the battery and hook up the power connectors to his Raspberry Pi. Since the remote works on 3.3V and draws little current, he is able to power the remote directly from the Pi. The Pi just has to turn its pin high momentarily to activate the remote.
The ability to toggle the state of your garage door from anywhere in the world also comes with paranoia. [Tanner] wanted to be able to tell if the door is up, down, or stopped somewhere in the middle while he was away from home. He also wanted to use as little equipment as possible. Since he already had an IP camera in the garage, he decided to use computer vision to do the detection.
He printed off two large, black shapes onto ordinary white computer paper. One was taped to the top of the door and one to the bottom. A custom script runs on the Pi that grabs the latest image from the camera and uses OpenCV to detect the shapes. If both shapes are visible, then the script can assume the door is closed. Otherwise, it’s likely open. This makes it easier for [Tanner] to know if the door is opened or closed without having to check the camera himself.
Can’t get enough garage door hacks? Try these on for size. Continue reading “A Raspberry Pi Garage Door Opener”
[Tim] was looking for a way to control his power outlets using WiFi. He looked into purchasing a WeMo but he realized that he could build something even better with more bang for his buck. He started out by purchasing a five pack of Etekcity wireless remote control outlet switches. These are kind of like the WeMo, only they aren’t controlled via WiFi. Instead, they come with an RF controller. [Tim] just needed to find a way to bridge the gap between the RF remote and WiFi.
[Tim] decided to use a Raspberry Pi as the brains of the controller. He also purchased a SMAKN 433MHz RF receiver and transmitter for communicating with the wireless outlet switches. The wiring for the modules is pretty simple. There are only four wires. There are power and ground wires for each module. Then the transmitter needs two GPIO pins while the receiver only needs one.
[Tim] began with a fresh installation of Raspbian. He then installed Wiring Pi, which gives you the ability to interface with the GPIO pins in a way that is similar to Arduino. He also installed Apache and PHP to create a web interface for switching the outlets. The last step was to write some custom software. The software included a script that allowed [Tim] to sniff out the controls of his RF remote. The correct codes are entered into the “toggle.php” file, and everything is set. All [Tim] has to do now is browse to his Pi’s web server and click a button. All of the custom code is available via git.
[Sigurd] manage to obtain an old vending machine from his dorm. The only problem was that the micocontroller on the main board was broken. He and his friend decided they could most likely get the machine back into working order, but they also knew they could probably give it a few upgrades.
This system uses two Arduino Pro Minis and an Electric Imp to cram in all of the new features. One Arduino is connected to the machine’s original main board. The Arduino interfaces with some of the shift registers, relays, and voltage regulators. This microcontroller also lights up the buttons on the machine as long as that particular beverage is not empty. It controls the seven segment LED display, as well as reading the coin validator.
The team had to reverse engineer the original coin validator in order to figure out how the machine detected and counted the coins. Once they figured out how to read the state of the coins, they also built a custom driver board to drive the solenoids.
A second Arduino is used to read NFC and RFID cards using a Mifare RC522 reader. The system uses its own credit system, so a user can be issued a card with a certain amount of pre-paid credit. It will then deduct credit appropriately once a beverage is vended. The two Arduinos communicate via Serial.
The team also wanted this machine to have the ability to communicate with the outside world. In this case, that meant sending cheeky tweets. They originally used a Raspberry Pi for this, but found that the SD card kept getting corrupted. They eventually switched to an Electric Imp, which worked well. The Arduino sends a status update to the Imp every minute. If the status changes, for example if a beverage was dispensed, then the Imp will send a tweet to let the world know. It will also send a tweet to the maintenance person if there is a jam or if a particular slot becomes empty. Continue reading “A Tweeting Vending Machine”