Reading Smart Cards from a PLC (with a Little Arduino Help)

If you’ve spent any time on a factory or plant floor, it is a good bet you’ve run into PLCs (Programmable Logic Controllers). These are rugged computers that do simple control and monitoring functions, usually using ladder logic to set their programs. [plc4u] wanted to connect a smart card reader to an Allen Bradley PLC, so he turned to an Arduino to act as a go-between.

The Arduino talks to a USB card reader using a USB host shield. Then it communicates with the PLC using an RS232 link and the DF1 protocol that most Allen Bradley PLCs understand. You may not need a smart card, but once you know how to communicate between an Arduino and the PLC, you could do many different projects that leverage other I/O devices and code available on the Arduino and connects to existing PLC installations. Just remember that you’ll probably need to ruggedize the Arduino a bit to survive and be safe to the same level as a PLC (which might include a NEMA enclosure or even an explosion-proof box).

Continue reading “Reading Smart Cards from a PLC (with a Little Arduino Help)”

Ball Balancing Arduino-Style

If you have a good sense of balance, you can ride a unicycle or get on TV doing tricks with ladders. We don’t know if [Hanna Yatco] has a good sense of balance or not, but we do know her Arduino does. Her build uses the ubiquitous HC-SR04 SONAR sensor and a servo.

This is a great use for a servo since a standard servo motor without modifications only moves through part of a circle, and that’s all that’s needed for this project. A PID algorithm measures the distance to the ball and raises or lowers a beam to try to get the ball to the center.

Continue reading “Ball Balancing Arduino-Style”

Encryption for Arduino with Spritz

Hackaday.io user [Abderraouf] has written an implementation of the new(ish) Spritz cipher and hash for Arduino. While we’re not big enough crypto-nerds to assess the security of the code, it looks like it’s going to be pretty handy.

Spritz itself is a neat cipher. Instead of taking in fixed blocks of data and operating on them, it allows you to process it in (almost) whatever chunks it comes in naturally, and then extract out the encrypted results piecewise. It works both as a two-way cipher and as a one-way hash function. It looks like Spritz is a one-stop-shop for all of your encryption needs, and now you can run it on your Arduino.

In case you are afraid of new implementations of new ciphers (and you should be), Spritz’s pedigree should help to put you at ease: it was developed by [Ron Rivest] to be a successor to his RC4 algorithm, and it incorporates a lot of the lessons learned about that algorithm over the past. This doesn’t exclude subtle flaws in the implementation of the library (no offence, [Abderraouf]!) or your work downstream, but at least the underlying algorithm seems to be the real deal.

[Abderraouf] links it in his writeup, but just for completeness, here’s the Spritz paper (PDF). What crypto libraries do you currently use for Arduino or microcontroller projects? We’ve been fans of XXTEA for ages, but more because it’s simple and small than because it’s secure. Spritz may be simple enough to implement easily, and still more secure. Sweet.

Light Duty Timekeeping: Arduino Berlin Clock

Just when we thought we’d seen all the ways there are to tell time, along comes [mr_fid]’s Berlin clock build. It’s based on an actual clock commissioned by the Senate of Berlin in the mid-1970s and erected on the famous Kurfürstendamm avenue in 1975. Twenty years later it was decommissioned and moved to stand outside the historic Europa-center.

This clock tells the time using set theory and 24-hour time. From the top down: the blinking yellow circle of light at the top indicates the passing seconds; on for even seconds and off for odd. The two rows of red blocks are the hours—each block in the top row stands for five hours, and each block below that indicates a single hour. At 11:00, there will be two top blocks and one bottom block illuminated, for instance.

The bottom two rows show the minutes using the same system. Red segments indicate 15, 30, and 45 minutes past the hour, making it unnecessary to count more than a few of the 5-minute top segments. As with the hours, the bottom row indicates one minute per light.

Got that? Here’s a quiz. What time is it? Looking at the picture above, the top row has three segments lit. Five hours times three is 15:00, or 3:00PM. The next row adds two hours, so we’re at 5:00PM. All of the five-minute segments are lit, which adds 55 minutes. So the picture was taken at 5:55PM on some even-numbered second.

The original Berlin clock suffered from the short lives of incandescent bulbs. Depending on which bulb went out, the clock could be ‘off’ by as little as one minute or as much as five hours. [mr_fid] stayed true to the original in this beautiful build and used two lights for each hour segment. This replica uses LEDs driven by an Arduino Nano and a real-time clock. Since the RTC gives hours from 0-23 and minutes and seconds from 0-59, a couple of shift registers and some modulo calculations are necessary to convert to set theory time.

[mr_fid] built the enclosure out of plywood and white oak from designs made in QCAD. The rounded corners are made from oak, and the seconds ring is built from 3/8″ plywood strips bent around a spray can. A brief tour of the clock is waiting for you after the break. Time’s a-wastin’!

Continue reading “Light Duty Timekeeping: Arduino Berlin Clock”

Arduino Powered Knife-Wielding Tentacle will Leave You in Stitches

Writing articles for Hackaday, we see funny projects, and we see dangerous projects. It’s rare to find a project which combines the two. This one somehow manages to pull it off. [Outaspaceman] is familiar with LittleBits, but he’s just starting to learn Arduino programming. He completed the blink tutorial, but blinking an LED just wasn’t enough fanfare for the success of his first Arduino program. He connected the Arduino Mega’s LED output to a pair of LittleBits which then switch a servo between two positions. A bare servo wouldn’t be much fun, so [Outaspaceman] connected a tentacle and a small Swiss army knife. Yes, a knife.

The tentacle in question is designed to be a finger puppet. There’s something about a tentacle waving a knife around that is so hilarious and absurd that we couldn’t help but laugh. We’re not alone apparently, as this video has gone viral with over 1 million views. It’s almost like a violent revenge of the most useless machine. For the technically curious, the tentacle’s seemingly random motion is analogous to that of the double pendulum.

Our readers will be happy to know that [Outaspaceman] has made it to the Arduino servo tutorial, and is now controlling the servo directly, no LittleBits needed. We just hope he has a good way to turn his creation off – without the need for stitches.

Continue reading “Arduino Powered Knife-Wielding Tentacle will Leave You in Stitches”

FleaFPGA + Arduino Uno = FleaFPGAUno

Some things are better together: me and my wife, peanut butter and jelly, and FPGAs and Arduino Unos. Veteran hacker [Valentin Angelovski] seems to agree: the FleaFPGA Uno is his latest creation that combines an FPGA (a Lattice MachX02 700HC) with an Arduino-compatible CPU.

It’s a step-up model from the origional FleaFPGA. With a few other components thrown in (such as a HDMI and composite video output and a WiFi option), you have a killer combination for experimenting with FPGAs or building an embedded system. That is because the Arduino part frees the FleaFPGA Uno from the breadboard: you can easily program, control and interface with the FPGA over a serial line or a wireless link using the Arduino IDE. There is even support for Arduino shields (albeit only 3.3V ones), making it even more expandable. This would be an awesome starting point for a retro gaming system, as many 8-bit consoles can be easily emulated in an FPGA. [Valentin] is currently selling the boards directly, and they are very reasonably priced at $50 or $60 for the WiFi version.

Continue reading “FleaFPGA + Arduino Uno = FleaFPGAUno”

Tiny Arcade, Based on Arduino

Who can resist video games when they’re packed up in tiny, tiny little arcade machines? [Ken]’s hoping that you cannot, because he’s making a cute, miniature Arduino-based arcade game platform on Kickstarter. (Obligatory Kickstarter promo video below the break.)

The arcades are based on [Ken]’s TinyCircuits Arduino platform — a surprisingly broad range of Arduino modules that click together using small snap connectors in place of pin headers. The system is cool enough in its own right, and it appears to be entirely open source. Housing these bits in a cute arcade box and providing working game code to go along with it invites hacking.

There’s something about tiny video cabinets. We’ve seen people cram a Game Boy Advance into a tiny arcade cabinet and re-house commercial video game keyfobs into arcade boxes. Of course, there’s the Rasbperry Pi. From [Sprite_TM]’s cute little MAME cabinet to this exquisite build with commercially 3D-printed parts, it’s a tremendously appealing project.

But now, if you’re too lazy to build your own from scratch, and you’ve got $60 burning a hole in your pocket, you can get your own tiny arcade — and tiny Arduino kit — for mere money. A lot of people have already gone that route as they passed the $25k funding goal early yesterday. Congrats [Ken]!

Continue reading “Tiny Arcade, Based on Arduino”