Programming Pi Games With Bare Metal Assembly

pifoxWhile the most common use for a Raspberry Pi is probably a media center PC or retro game emulator, the Pi was designed as an educational computer meant to be an easy-to-use system in the hands of millions of students. Team 28 at Imperial College London certainly living up to the Raspberry Pi Foundation’s expectations with their bare metal assembly clone of Star Fox, aptly titled PiFox.

This isn’t the first time a college course has taken up the task of developing software for the Pi without an operating system; a few years ago, Cambridge University started that off with a series of bare metal tutorials for the Pi that included drawing graphics on the screen and playing around with USB keyboards. PiFox greatly expands on what those early tutorials could do, reading an NES joystick from the GPIO pins, sound with DMA, and rendering 3D objects.

If you’d like to build PiFox for yourself, or better yet, expand on the existing build, all the code is up on Github. There’s also a Raspberry Pi emulator for Linux, just in case you have an ARM assembly bug you just can’t scratch with a Raspberry Pi.

Continue reading “Programming Pi Games With Bare Metal Assembly”

Raspberry Pi Bluetooth Receiver For Your Car Stereo

RasPi Car Audio

The ability to play music in your car over a Bluetooth connection is very handy. You can typically just leave your phone’s Bluetooth module turned on and it will automatically pair to your car. Then all you have to do is load up a music player app and press play. You don’t have to worry about physically tethering your phone to the car every time you get in and out of the vehicle. Unfortunately Bluetooth is not a standard option in many cars, and it can be expensive to buy an aftermarket adapter.

[parkerlreed] built his own solution to this problem using a Raspberry Pi. He first installed arch Linux on his Pi. He also had to install pulseaudio and bluez, which is trivial if you use a package manager. He then modified some of the Linux configuration files to automatically bring the Pi’s Bluetooth adapter online once it is initialized by the kernel.

At the end of the boot sequence, the Pi is configured to automatically log in to a virtual console as [parkerlreed’s] user. The user’s bashrc file is then altered to start pulseaudio in daemon mode at the end of the login sequence. This allows the Pi to actually play the audio via the Pi’s sound card. The Pi’s stereo output jack is then plugged into the vehicle’s auxiliary input jack using a standard audio cable.

The Reddit post has all of the configuration details you would need to duplicate this setup. [parkerlreed] also includes some commands you will need to setup the initial pairing of the Raspberry Pi to your smart phone. Be sure to watch the video demonstration below. Continue reading “Raspberry Pi Bluetooth Receiver For Your Car Stereo”

PiGates Validates Your Concert Tickets

gatespi

[Seph] works for a company that handles ticketing for concerts and special events. One of his primary tasks is to check for counterfeit tickets at the gates of an event. Depending on the venue, this can be mag-stripes, bar codes, or one of several breeds of RFID. Until recently, netbooks coupled with USB readers performed the task. The netbooks weren’t a great solution though – they were expensive, relatively fragile, and took up more space than necessary.

[Seph] had a better idea. He created a ticket validation system using a Raspberry Pi. The Pi sits in a translucent case with a PiGlow RGB LED board. A USB reader (in this case a bar code reader) plugs into one of the Pi’s USB ports. These readers can operate in several modes, including keyboard emulation, which [Seph] chose because it wouldn’t require any driver work.

Using PiGates is so simple even a drummer could handle it. Normally the Pi glows blue. When a ticket is scanned, [Seph’s] python script reads the code and verifies it against an online database.If the ticket is valid, the Pi will glow green. A counterfeit ticket is indicated by flashing red LEDs.

Click past the break for more on PiGates.

Continue reading “PiGates Validates Your Concert Tickets”

RasPi FM Transmitter

Easily Turn Your Raspberry Pi Into An FM Transmitter

Have you ever wanted to be your own radio DJ? [Kevin] has made it easier than ever with his Raspberry Pi FM Transmitter program. The program is written in C. [Kevin] has made source code is available along with a compiled binary.

PIFM allows you to load up any audio file and specify a frequency to transmit. The program will then use PWM to modulate the audio sample through the Pi’s GPIO4 pin. [Kevin] claims that the RasPi alone will only transmit around a 10 cm distance. He says that making a simple antenna out of a jumper wire can increase the distance to around 100 meters. All you have to do is hook up the wire to the GPIO4 pin to drastically increase the range.

The legality of such a transmitter will vary from place to place, so be sure to check out your local regulations before you go transmitting audio on regulated frequencies. If this kind of thing is interesting to you, you may want to investigate ham radio. It’s not all Morse code and old fogies. Some people claim it’s a hacker’s paradise.

[via Reddit]

How To Upgrade Jasper’s Voice Recognition With AT&T’s Speech-to-Text API

Jarvis upgrade

Jasper is an open-source platform for developing always-on voice-controlled applications — you talk and your electronics listen! It’s designed to run on a Raspberry Pi. [Zach] has been playing around with it and wasn’t satisfied with Jasper’s built-in speech-to-text recognition system. He decided to take the advice of the Jasper development team and modify the system to use AT&T’s speech-to-text engine.

The built-in system works, but it has limitations. Mainly, you have to specify exactly which keywords you want Jasper to look out for. This can be problematic if you aren’t sure what the user is going to say. It can also cause problems when there are many possibilities of what the user might say. For example if the user is going to say a number between one and one hundred, you don’t want to have to type out all one hundred numbers into the voice recognition system in order to make it work.

The Jasper FAQ does recommend using the AT&T’s speech-to-text engine in this situation but this has its own downsides. You are limited to only one request per second and it’s also slower to recognize the speech. [Zach] was just fine with these restrictions but he couldn’t find much information online about how to modify Jasper to make the AT&T engine work. Now that he’s gotten it functional, he shared his work to make it easier for others.

The modification first requires that you have at AT&T developer account. Once that’s setup, you need to make some changes to Jasper’s mic.py module. That’s the only part of Jasper’s core that must be changed, and it’s only a few lines of code. Outside of that, there are a couple of other Python scripts that need to be added. We won’t go into the finer details here since [Zach] goes into great detail on his own page, including the complete scripts. If you are interested in using the AT&T module with your Jasper installation, be sure to check out [Zach’s] work. He will likely save you a lot of time.

 

A Tweeting Litter Box

SmartLitterBox

How can you not be interested in a project that uses load cells, Bluetooth, a Raspberry Pi, and Twitter. Even for those of our readers without a cat, [Scott’s] tweeting litter box is worth the read.

Each aspect of this project can be re-purposed for almost any application. The inexpensive load cells, which available from eBay and other retailers, is used to sense when a cat is inside the litter box. Typically sensors like the load cell (that contain a strain gauge) this use a Wheatstone bridge, which is very important for maximizing the sensitivity of resistive sensor. The output then goes to a HX711, which is an ADC specifically built for load cells. A simple alternative would be using an instrumentation amplifier and the built-in ADC of the Arduino. Now, the magic happens. The weight reading is transmitted via an HC-06 Bluetooth module to a Raspberry Pi. Using a simple Perl script, the excreted weight, duration, and the cat’s resulting body weight is then tweeted!

Very nice work! This is a well thought out project that we could see being expanded to recognize the difference between multiple cats (or any other animal that goes inside).

THP Hacker Bio: Fl@C@

fl@a@ avatar and project imageNow that we’re starting to get serious about The Hackaday Prize we thought we’d take a look at the lives of some of the hackers who have submitted entries. Meet fl@C@, who is working on a Raman Spectrometer which is largely 3D printed and uses a Raspberry Pi. He was kind enough to answer all of our questions, some serious and some not so.

01-thp-bio

Image: OldComputers.net
Image: OldComputers.net

Creating. It’s probably no surprise that I have many hobbies…but hardware hacking is my life. I got my first taste with my dads Imsai 8080 (showing my age, but I was fairly young!)..Then it was an Apple][.. I really dove into that. I built my own from a bare pcb to a working machine when I was around 11 or 12. Just moved up from there.. Really went nuts when I got a job at a surplus electronics store in the silicon valley.. I rarely took home a paycheck.. I have a few other hobbies, I’m a private pilot…love flying. I built a pretty cool device that allowed me to datalog my flights, my heartrate, keep track of the fuel, it speaks and connects to the comm to remind me when to switch tanks, etc.. I’ll have to put that up on the project page.

What is Your Profession?Well…For my day job, I am a Network Engineer.. I can’t really say for which company, but it’s big.

What is Your Passion?

My Passion is Going Big

I would say my passion is going big..if it’s worth doing…..it’s worth overdoing. I love coming up with ideas that would make a difference. The spectrometer I am working on is actually only a small part of a larger project I am working toward. There are never enough hours, or dollars to cover all of my ideas…but I always work as hard as I can to get there.. TLDR- I’m excited every day to wake up and make another step towards changing the world.

Piece of Equipment You'd Go "Office Space" On?I work from home, but in the office… it’s definitely the snack machine. Seriously? We can’t build a machine that dispenses snacks without getting them stuck?

Favorite Operating System?I’d say linux. I’ve been a fan of ubuntu for a while.. lately I’ve been playing with xubuntu. I don’t care for messing with computers..lol. xubuntuI love electronics, hardware, software and all that.. but I do not geek out over PC hardware..I consider them another tool…they need to work when I need them to work. lol

Favorite Bench Equipment?Not sure if you want a breakdown of what gear I have….I have quite a bit and a pretty elaborate lab setup..but I’m really a bit of a minimalist when it comes to day to day use.. I use my scope when it’s appropriate..my logic analyzer (saelae logic rocks) pretty often.. but I’d say my go to device is usually my DMM since it’s what I tend to use most often…I have a few, but I like to use the one that connects up to my PC so I can make screenshots, and/or see it from a distance..

Favorite Piece of Silicon?mbed-pinoutI would have to default to the mBed for this one..for general purpose. I started out like most people probably with the basic stamp waaaay back…and went through a few others..and settled on the mBed when there was just one device, but now they have so many platforms that you can fit to whatever need..and some of them are dirt cheap. I’m using the ST Nucleo041RE for the spectrometer project, and it’s only $10 at mouser. I have just started peering into FPGA stuff, I hope to get some more time to work with them very soon, I see lots of potential.. I never really used Arduino’s until the past year or two when I got into quadcopters..they have a purpose..and are ok for quick and dirty stuff since you can source a pro mini on ebay for like 3 bucks..

Favorite Programming Language?Python has become my best friend. C++ is great and all, I’ve been forced to use VB6 for work…where they even use winbatch……. But python works.. and it’s easy to crank something out quickly, and you can build some pretty robust stuff with it..

Three Projects Before You Die?Well, I have a couple that come to mind immediately that I honestly would love to share with the world…but won’t just yet.. =) So, I’ll go with what is left…hopefully it’s plenty for now..

  1. I’d love to build a fusor. I built my first tesla coil when I was 17.. I’d love to take the hobby fusor to the next step..
  2. A Moon Rover. Seriously. And the vehicle to get it there. I think we all agree rockets and gasoline both need to go away. Mankind needs to reach out beyond what we’re confortable with.
  3. A fully autonomous multirotor. I actually started this project..have it all layed out..but it’s not high enough on my priority list to make it the rest of the way..I have probably 80% of the parts new in a box..I’ve started doing a writeup on it..and hope to get it up soon.

Skill You Wish Everyone Would Learn?

Learn the Value of Knowing Where and How to Find the Information [You] need

I wish that everyone would learn the value of knowing where and how to find the information they need to accomplish a goal. Schools typically force you to memorize facts and information that is often worthless. I would like for people to learn instead how to be adaptive in their approach to problems, and understand that there is always more than one answer.. and there is a huge resource out there that will enable you to make educated decisions and reach grander goals. We live in a great time with that…and in that way, the internet is underutilized…

How Did You Pick Your THP Project Idea?The timing was right…I thought this was an interesting and unique project..I had promised myself to try to be more open and share..this project was perfect since it has 3d parts people can print themselves, a raspberryPi, a sorta arduino and a cool laser…plus I figured there are several people out there that could either benefit from a low cost raman spectrometer, or at least benefit from some part of it..be it the parts I designed or just the understanding of how it works and what they’re used for…

Any Tough Stuff You Need Advice On?raman-spectrometer-laserI always keep an open mind, and consider any advice given.. There have been many aspects of this project that created a challenge.. This is my first serious venture into 3d printing this much stuff…I’ve never really worked with lasers and optics in such a way.. Avoiding spending thousands on optics was a major challenge. I have been doing all the research I can to understand the best approach to imaging…My first idea was to modify a webcam to take long exposures since the light reaching the camera will be fairly faint..after looking into that, it’s not just a lot of work and difficult to reproduce…but the cameras that others have modified are ancient and next to impossible to find. I wanted to go with a camera that anyone could find…the raspiCam kept surfacing as the best choice…so, the next challenge was how to get the long exposure…the raspiCam driver doesn’t really allow for 10-30 second exposures… so the next idea was to take several shots, and stack them to build a usable image.. so my latest approach is to take a 90fps video for a couple seconds, split that into individual frames, and stack those.. If anyone has suggestions in this area, I’d love to hear them.. I planned on using either mathematica or qtoctave from python, etc..

THP Project You'd Like Someone Else to Build?1280px-Apollo15LunarRoverA Moon Rover. =) It’d probably most definately be a team effort.. But I think as a community, the skills are out there. And the google XPrize shouldn’t be the only game in town.. I think things are building up to this kind of stuff anyway, but someone’s got to be first.

Your Life in Exactly 5 Words?

Live Out Loud Every Day

What Else Ya' Got?I’d just like to say…putting this project on this site was a major debate for me. I grew up with parents that had secret clearances, and privacy was central. I’ve been trying to build up the courage to share my work and ideas with the world because I think it benefits everyone. This project is my first to share, and for it to be featured here, and for me to be honored with being the first the be featured is really amazing. I appreciate this whole community, I’ve learned a lot from it over the years and I hope to be able to give back and contribute more soon!