Last week we started the first round of community voting for The Hackaday Prize, where everyone on Hackaday.io has a voice in choosing the best project for the current theme of the week. To encourage people to vote, we’re giving away a $1000 gift card to The Hackaday Store to one person on hackaday.io if they have voted in the latest round of community voting. How are we doing that? A very, very large die and SQL queries:
No, no one won this week. That’s okay, because we’re giving t-shirts away to three random people who did vote. This week, [cgapeart], [Jeff], and [devonelliott] are getting t-shirts from the Hackaday Store, just because they were cool enough to vote.
We’re going to keep this round of community voting going for another week. Everyone registered on Hackaday.io gets 50 votes for each round of voting, and every Friday (around 20:00 UTC), we’ll randomly select one person registered on Hackaday.io. If that person has voted, they get a $1000 gift card for The Hackaday Store. If they haven’t voted — a t-shirt. They’re nice t-shirts, but I’d rather have the gift card.
All you have to do for a chance to win a $1000 gift card is head over to the Community Voting Page and pick which project is most likely to be widely used. There’s no wrong answer; all you have to do is decide between two projects. If you only use up one vote, you’re in the running for a $1000 gift card.
I’ll be doing another round of random, fair die rolls and SQL queries next Friday. Until then, VOTE!
Most hobbyists say that it is easier to build a functional prototype of an electronic device, than to make the enclosure for it. You could say that there are a lot of ready-made enclosures on the market, but they are never exactly what you need. You could also use a 3D printer to build a custom enclosure, but high-end 3D printers are too expensive, and the cheaper ones produce housings which are often not robust enough, and also require a lot of additional treatment.
Another way is to build the enclosure out of FR4, a material which is commonly used in PCB production. Such enclosures are low-cost, with thin walls but yet very strong, nice looking, pleasant to the touch and have excellent thermal and moisture stability. FR4 offers some more possibilities – efficient wiring with no wires inside the housing, integrated UHF or SHF antennas or RFID coils, capacitive switches, electrical shielding, selective semi-transparency, water or air tightness, and even integration of complex mechanical assemblies.
Here I shall explain the process of building those “magic” enclosures. It is based on nearly fifty years of personal experience and more than a hundred enclosures, built for most of my projects. Here are two examples – this case for a hardware password manager is just a few centimeters long, while the other one (protective transportation cover for my son’s synthesizer) measures 125cm (about 49 inches), and yet both of them are strong enough to withstand a grown man standing on top of them.
The global approach is simple – you take the sheet of single-sided copper clad FR4, cut it and solder the parts together. That sounds simple, but there are a lot of details which should be met if you want to get top results. Please read about them carefully. You might be tempted to skip some of the steps described here, but if you do so, you will most likely end up being disappointed with the results.
I usually see retro-gaming projects using tiny screens with a fair number of pixels (64×64) but what I really like is the look of making every pixel count. With this in mind I built 1-Pixel Pac-Man, the classic coin-op experience but with characters that consist of just one pixel. Playing a throw-back like this wouldn’t be the same without some vintage controls so I picked up an Atari joystick, patched it into a microcontroller, and started coding. Check it out:
Smartmatrix Bundle
32×32 RGB panel with acrylic diffuser
Back of the Smartmatrix
This piece of hardware made the project build really easy: the Smartmatrix. [Louis Beaudioin] developed the Smartmatrix and it’s been in the Hackaday Store for a while now. The display module itself is a commodity item that is used in LED billboards. There are shrouded headers on the back of the panels, to the left and right sides, which allow them to be daisy chained. The Smartmatrix PCB plugs into one of these shields, provides a soldering footprint for the Teensy 3.1 which drives the display, and gives you the wiring to connect screw terminals from the PCB to the power terminals on the module. Why the need for beefy power jumpers? At full white the thing can draw about 3.5A — don’t worry there’s a power supply included in the bundle.
Also integral to making this look good is the diffuser panel which is frosted acrylic. The Smartmatrix is designed to be housed in a shadowbox frame; it even includes a frame backer board with a cut-out for the Teensy 3.1 so it can be programmed without opening the thing up. I like looking at the guts so I’m leaving my free floating until I come up with an interesting way to mount everything as one unit.
Programming Pac-Man from the Ground Up
If you haven’t looked into it before, the ghost AI and gameplay details for Pac-Man are absolutely brilliant. [Toru Iwatani] did a masterful job with the original, and you should take a look at all of the analysis that has been done over the years. The best collection I could find was the Pac-Man Dossier and I based most of my code on the rules described there.
Basically the ghosts have two modes, chase and scatter. The modes set the enemy targets differently; to points at the four corners of the board in scatter, and to points relative to the player in chase. The relative part is key; only the red enemy actually chases you. Another one of them looks at the red enemy’s distance and angle, and targets the reflection of that vector. Really easy, really clever, and results in enemy behavior that’s believable. It isn’t just the enemy movement, little touches like a speed penalty (1/60 of a second) for each dot the player gobbles up means the enemies can catch up if you continuously eat, but you can escape by taking the path already-eaten.
Library, DMA, and Extra Hardware
Teensy 3.1
DB9 Connector for Joystick
Extras in the Bundle
Kickstarter remote and RTC Module
The hardware and software running the Smartmatrix made the display portions of the project really simple. First off, the Teensy 3.1 is fast, running at 96MHz in this case. Second, it has Direct Memory Access (DMA) which [Louis] used in the Smartmatrix library. This means that driving the display takes almost no CPU time at all, leaving the rest for your own use. This example of a game is under-utilizing this power… it’s totally capable of full-motion video and calculating amazing visualizations on the fly.
The PCB hosting the Teensy 3.1 breaks out several pins to one side. I’m not sure what I’ll add in the future so I actually used the extra surface-mount IO pins on the bottom of the Teensy to connect the Atari joystick (which is simply a set of switches). The are enough pads for two joysticks so I used pin sockets to interface the Teensy to the PCB so that I can get to it again later.
The kit also includes an IR receiver and remote, and also a microSD card to loading animations (there’s an SD socket on the PCB). The bundle in the Hackaday Store is a kit you solder yourself, but [Louis’] company, Pixelmatix, has a Kickstarter running for fully-assembled versions that come with a black remote and sound-visualization hardware.
Future Improvements
The game is fully working, but there are a few key things that I really want to add. The Teensy 3.1 has a single DAC pin available. I’m fairly certain the original coin-op game had mono audio. It should be possible to reproduce the sound quite accurately with this board. That would really make the project pop.
There are also a bunch of touch-ups that need to happen. I’d like to add an animation when the player is eaten by an enemy, and a countdown before the level restarts. The score, shown in binary on the right column, should be scrolled out in decimal when the game ends, and what’s a coin-op recreation without a high-score screen?
It’s time to do a series on logic including things such as programmable logic, state machines, and the lesser known demons such as switching hazards. It is best to start at the beginning — but even experts will enjoy this refresher and might even learn a trick or two. I’ll start with logic symbols, alternate symbols, small Boolean truth tables and some oddball things that we can do with basic logic. The narrative version is found in the video, with a full reference laid out in the rest of this post.
Invert
The most simple piece of logic is inversion; making a high change to low or a low change to high. Shown are a couple of ways to write an inversion including the ubiquitous “bubble” that we can apply almost anywhere to imply an inversion or a “True Low”. If it was a one it is now a zero, where it was a low it is now a high, and where it was true it is now untrue.
AND
Moving on to the AND gate we see a simple truth table, also known as a Boolean Table, where it describes the function of “A AND B”. This is also our first opportunity to see the application of an alternate symbol. In this case a “low OR a low yields a low”
NAND
Most if not all of the standard logic blocks come in an inverted form also such as the NAND gate shown here. The ability to invert logic functions is so useful in real life that I probably used at least three times the number of NAND gates as regular AND gates when doing medium or larger system design. The useful inversion can occur as spares or in line with the logic.
As a piece of protest art, “Covert Remote Protest Transmitters” ticks all the boxes. An outdoor covert projector that displayed anti-globalization messages at a G20 summit is protest. To disguise it inside a surveillance camera body housing — sticking it to the man from inside one of his own tools — is art. And a nice hack.
However you feel about the politics of globalization (and frankly, we’re stoked to be able to get cheap tech from anywhere in the world) the open-source DIY guidebook to building the rig (PDF) makes up for it all.
They installed the camera/projector long before the summit, where it sat dormant on a wall. A cell phone inside turned on the projector’s light with each ring because they attached a relay to the cell phone’s speaker circuit. In the instructions there’s an example of using a light-dependent resistor (CdS cell) to do the same thing, relying on the phone’s backlight functionality instead. There are a lot of ways to go here.
The optics consist of a couple of lenses aligned by trial and error, then fixed in place to a balsa wood frame with hot glue. A big fat Cree LED and driver provide the photons.
The video documentation of the piece is great. It’s mostly the news media reacting to the art piece as a “security breach”. A security breach would be a gun or a bomb. This was an overhead projector displaying messages that were out of the organizers’ control. Equating security with the supression of dissent is double-plus-ungood. Touché, CRPT.
Anyway, while you’re getting prepped for your next protest, have a look at the Image Fulgurator.
A few years ago, [Mitch Altman] from Noisebridge came up with the idea of a Hackerspace Passport. The idea behind it was not to hinder or monitor travels but to encourage visiting other hackerspaces. These passports can be purchased for just a few dollars or, in true open source fashion, be made with nothing more than a computer printer… the Hackerspace Passport design files are totally free and available here.
So next time you’re visiting a new hackerspace, bring your passport and get it stamped to document the trip…. and that brings us to the point of this post: The Stamp. At around $25, having a custom ink stamp made at an office supply store isn’t that much money, but buying a stamp is not as fun as making one! That is what we are going to do today; make a stamp… or more specifically, several stamps using different techniques. Then we’ll compare the performance of each method.
DESIGN
Stamp 3D Model
Inkscape solid HaD logo
Inkscape Lined HaD Logo
Printed Stamp Mold
Printed Stamp STL
Since this is Hackaday, we will be making a Hackaday Logo stamp. Back a couple years ago we ran a contest asking folks to make unique things with the Hackaday logo. To make it easy for the entrants, the Hackaday logo was made available in SVG format. We’ll start with that, since it is available, and make a minor change by adding some lettering, as most soon-to-be stamp makers will probably want letters on their stamps too. This is easily done in the FOSS vector graphic editor software: Inkscape.
The stamp size is important. A Hackerspace Passport page has room for 4 stamps up to 41 x 47mm and we’ll try to keep our stamp within those limits.
I love the Hackaday crowd. Despite a long day standing at a booth or crawling the fairgrounds as a spectator, everyone still made it on Saturday night to the 2nd Annual Hackaday BAMF meetup and made it one for the annals of hacker history. Just look at that crowd… I see a couple of Hackaday Prize Judges, a friend I met in Germany (who I actually found out I first met at this same event last year), and many many more great people. I don’t want to spoil the fun so check out the full size over on [Rich Hogben’s] photo log and see how many you can identify.
We started this gathering last year as a come-as-you-are and bring-what-you’re-proud-of after party to Bay Area Maker Fair. We don’t rent out the bar — O’Neil’s Irish Pub in San Mateo — but we had a handshake agreement for drink tickets (thank you to Supplyframe for buying the first round for everyone) with the bartenders. The place feels like the perfect size, and before long we were packed into every available space. The ramp to the restroom area in the back was a gauntlet of conversation — enough room to walk by but you felt like you were interrupting people talking to those across from them.
OSHChip
HeartBeat Boombox
mark-1 Macetech glasses
The amount of hardware on hand was spectacular. Taking pictures of it was tough in the tight quarters. I got a look at the first prototype of the Pebble smart strap. I really enjoyed seeing OSHChip (pictured above) which is an ARM Cortex-M0 chip and BLE rolled into a DIP-16 form factor. [Sophi’s] HeartBeat Boombox was a big hit; it uses the heartrate and blood oxygen sensors seen above to drive a drumbeat. Those blinky glasses should look familiar. [Garrett Mace] and his colleague [Jason] were on hand. These Macetech glasses are from a couple of years back but don’t worry, they were sporting the newest RGB flavor which I’m told will have black solder mask and integrated controller among other tasty goodies.
The Band
One-wire RGB LEDS (literally 1 conductor)
DIY Flex PCB; vinyl cutter and copper tape
Perhaps the best way to tell the success of the night is that there were a lot of friends in the room that I never realized were even there. The next day I met up with [Sarah Petkus] and [Mark Koch] and was surprised to find they had been at the Hackaday meetup and I missed them. The same thing happened when I looked at [Rich’s] album from the night and saw [Trey German] was there too. I wasn’t hiding and I wasn’t stuck in one conversation, it was just that kind of a party that makes the room feel like a TARDIS but somehow the night doesn’t last forever.
It’s hard to imagine BAMF without this Saturday gathering. If you missed it this year, add it to your calendar for next.