Adding Range (and Bling) to an Electric Skateboard

Long-time Hackaday reader [Andrew Rossignol] bought a Boosted-brand electric skateboard while he was living in NYC. While the batteries more than sufficed for his commute in the Big Apple, he ran out of juice when he moved to the Left Coast, leaving him three miles short of a ten mile trip.

Faced with the unthinkable fate of pushing his skateboard like a Neanderthal, [Andrew] added more batteries. There’s great detail about how he chose the battery chemistry and the particulars of charging and something about load balancing, so it’s definitely worth a read if you’re building an electric vehicle.

IMG_3927But once [Andrew] had some surplus battery capacity on board (tee hee!) he thought of ways to waste it. The natural solution: tons of RGB LED underlighting.

Still not content with an off-the-shelf solution (which wouldn’t let him recharge the batteries without unplugging the lights), he ended up rolling his own with an Arduino and some WS2812s. The nicest touch? Keeping it all out of the elements in a sweet aluminum box, hiding the cable salad within.

There’s a lot to be said for the good industrial design of something like the Boosted skateboard, but if you’d rather DIY, we’ve been covering electric skateboard for a while now. It’s nice to see how battery and motor technology have changed since then, too. Compare and contrast this recent build with that old-school version and with [Andrew’s] build that was covered in this post. We live in good times.

Low Power and Pin-Constrained

We’ve all been there. You’re building up a microcontroller project and you wish that you could just add “one more feature” but you’re limited by the hardware. Time to start thinking. (Or, arguably, buy the next model up.)

[Sam Feller] found himself in this position, adding a knob to set the time and a button to arm the alarm for his Analog Voltmeter Clock, and he came up with a way to implement an on-off switch, and poll a button and a potentiometer with only two pins of a microcontroller.

The problem with potentiometers in low-power designs is that they’re always leaking power. That is, unless you switch them off when you’re not using them. So the ideal solution is to power the potentiometer from one GPIO pin on the microcontroller, and read its value with another. That’s two GPIO pins just for the potentiometer. But [Sam] needed to read input from a button too, and he was out of pins.

His clever solution is to switch two resistors in or out of the circuit depending on the status of the pushbutton, so that the voltage range at the potentiometer is between either VCC and VCC/2 when the switch is pressed, or between VCC/2 and GND when the switch is not pressed.

If the ADC reads something higher than VCC/2, the microcontroller knows that the button is pressed, and vice-versa. The potentiometer’s setting determines exactly where the voltage lies within either range.

Done and done. If you find yourself in the similar situation of needing to read in values from a whole bunch of buttons instead of a potentiometer, then you can try using an R-2R DAC wired up to the pushbuttons and reading the (analog) value to figure out which buttons are pressed. (If you squint your eyes just right, this solution is the same as the R-2R DAC one with the potentiometer replacing all but the most-significant bit of the R-2R DAC.)

Another tool for the toolbox. Thanks [Sam].

Knappa Tutu: Some Dancing Required

Sometimes, you see a lamp shade and you’re just intoxicated enough to put it on your head like a hat and dance around on the table. Other times, you see the same lamp shade, and decide to wire it up with Neopixels, an accelerometer, and an Arduino and make a flowery, motion-activated light show when you wear it as a dress. Or at least that’s what we’ve heard.

[Cheng] gets full marks for the neo-IKEA name for the project and bonus points for clean execution and some nice animations to boot. The build is straightforward: build up the lamp so that it fits around your waist, zip-tie in the RGB LED strip, and connect up accelerometer and microcontroller. A tiny bit of coding later, and you’re off to the disco. It looks like a ridiculous amount of fun, and a sweet weekend build.

Continue reading “Knappa Tutu: Some Dancing Required”

Stegosploit: Owned by a JPG

We’re primarily hardware hackers, but every once in a while we see a software hack that really tickles our fancy. One such hack is Stegosploit, by [Saumil Shah]. Stegosploit isn’t really an exploit, so much as it’s a means of delivering exploits to browsers by hiding them in pictures. Why? Because nobody expects a picture to contain executable code.

stegosploit_diagram[Saumil] starts off by packing the real exploit code into an image. He demonstrates that you can do this directly, by encoding characters of the code in the color values of the pixels. But that would look strange, so instead the code is delivered steganographically by spreading the bits of the characters that represent the code among the least-significant bits in either a JPG or PNG image.

OK, so the exploit code is hidden in the picture. Reading it out is actually simple: the HTML canvas element has a built-in getImageData() method that reads the (numeric) value of a given pixel. A little bit of JavaScript later, and you’ve reconstructed your code from the image. This is sneaky because there’s exploit code that’s now runnable in your browser, but your anti-virus software won’t see it because it wasn’t ever written out — it was in the image and reconstructed on the fly by innocuous-looking “normal” JavaScript.

232115_1366x1792_scrotAnd here’s the coup de grâce. By packing HTML and JavaScript into the header data of the image file, you can end up with a valid image (JPG or PNG) file that will nonetheless be interpreted as HTML by a browser. The simplest way to do this is send your file myPic.JPG from the webserver with a Content-Type: text/html HTTP header. Even though it’s a totally valid image file, with an image file extension, a browser will treat it as HTML, render the page and run the script it finds within.

The end result of this is a single image that the browser thinks is HTML with JavaScript inside it, which displays the image in question and at the same time unpacks the exploit code that’s hidden in the shadows of the image and runs that as well. You’re owned by a single image file! And everything looks normal.

We like this because it combines two sweet tricks in one hack: steganography to deliver the exploit code, and “polyglot” files that can be read two ways, depending on which application is doing the reading. A quick tag-search of Hackaday will dig up a lot on steganography here, but polyglot files are a relatively new hack.

[Ange Ablertini] is the undisputed master of packing one file type inside another, so if you want to get into the nitty-gritty of [Ange]’s style of “polyglot” file types, watch his talk on “Funky File Formats” (YouTube). You’ll never look at a ZIP file the same again.

Sweet hack, right? Who says the hardware guys get to have all the fun?

Dealing with Fallout

In just a few short days, Fallout 4 will be released and a substantial portion of the Hackaday staff will be taking the day off. As you would expect, a lot of people with 3D printers, soldering irons, and far too much time on their hands are getting pumped for the Fallout release. Here’s a few Fallout builds we’ve found over the past few weeks:


919501417186321280The most iconic thing you’ll find in a Fallout game is the Pip-Boy, the UI for the player and a neat wrist-mounted computer (that somehow has a CRT in it, I guess) for the player’s character. Hackaday’s own [Will Sweatman] built his own Pip-Boy 3000 that’s completely functional. The build uses a 4.3 inch touch display, a 10 position rotary switch, and a bunch of 3D printed parts.

Elsewhere on, [Karl] is working on a functional Pip-Boy controller for Fallout, and [cody] built one with a Raspberry Pi. Of course, if you’re super special and have two thousand dollars to blow, Bethesda released a limited-edition Pip-Boy edition of Fallout 4 that’s compatible with most cell phones.

The Not Pip-Boys


There’s more to Fallout than just wrist-mounted computers, and for the true aficionados, there are gigantic gear-shaped doors. [TreyHill] has a partially finished basement with a gaming room tucked behind his very own vault door. The door itself is built out of plywood and rolls along a gear rack mounted to the floor. Will it hold up to a nuclear blast? Probably not. Is it up to code? It looks cool, at least.

[Lilykill] on Thingiverse is extremely capable with a copy of solidworks and produced a bunch of 3D models from the Fallout universe that includes power armorray guns, more Pip-Boys, plasma grenades, and a Nuka-Cola truck.

Fallout 4 for the Apple II

Fallout 4 will be available for the PS4, Xbox One, and PC, leaving out a large contingent of retro gamers. Fear not, lovers of the 6502: there’s’ a version for the Apple II:

This tribute to both the Apple II and Fallout was made with the Outlaw Editor, an SDK for pseudo-3D game development on exceedingly old hardware. There’s actual ray casting happening in this tribute, and it works just the same as Wolfenstein 3D or the like.

The Eloquence of the Barcode

Beep. You hear it every time you buy a product in a retail store. The checkout person slides your purchase over a scanner embedded in their checkout stand, or shoots it with a handheld scanner. The familiar series of bars and spaces on the label is digitized, decoded to digits, and then used as a query to a database of every product that particular store sells. It happens so often that we take it for granted. Modern barcodes have been around for 41 years now. The first product purchased with a barcode was a 10 pack of Juicy Fruit gum, scanned on June 26, 1974 at Marsh supermarket in Troy, Ohio. The code scanned that day was UPC-A, the same barcode used today on just about every retail product you can buy.

The history of the barcode is not as cut and dry as one would think. More than one group has been credited with inventing the technology. How does one encode data on a machine, store it on a physical media, then read it at some later date? Punch cards and paper tape have been doing that for centuries. The problem was storing that data without cutting holes in the carrier. The overall issue was common enough that efforts were launched in several different industries.

Continue reading “The Eloquence of the Barcode”

The Flying Man

No, that’s not a typo for Burning Man. What do you get when you take a hundred feet of plastic sheet, weld up a big ramp, modify a car into your own personal high speed winch, and put it all near a lake? You get some serious air time.

A group of French water sports enthusiasts decided to build this fantastically ill-advised super slip and slide. They built a giant ramp alongside an old farm house heading towards the lake. At the bottom is a large ramp they welded together out of steel. Now you can just slide down this slip and slide.

But they weren’t content with just that.

Continue reading “The Flying Man”