Tiny Neural Network Library In 200 Lines Of Code

Neural networks have gone mainstream with a lot of heavy-duty — and heavy-weight — tools and libraries. What if you want to fit a network into a little computer? There’s tinn — the tiny neural network. If you can compile 200 lines of standard C code with a C or C++ compiler, you are in business. There are no dependencies on other code.

On the other hand, there’s not much documentation, either. However, between the header file and two examples, you should be able to figure it out. After all, it isn’t much code. The example in the repository directs you to download a handwriting number recognition dataset from the Internet. Once it trains that data, it shows you the expected output from the first item in the data set and then processes the first item and shows you the result.

Continue reading “Tiny Neural Network Library In 200 Lines Of Code”

Orbital Mechanics On A Vintage Kaypro

These days, a good proxy for hacking prowess is getting Doom playable on the oldest piece of hardware imaginable. While we respect and applaud these efforts, perhaps the bar should be set a bit higher. Like orbital mechanics on an early 80s Kaypro, perhaps?

At least that’s the hurdle [Chris Fenton] set for himself as a fun project for his spare time with his Kaypro 2/84, a vintage Z80 clocking in at a screaming 4 MHz and 64-kB of RAM. With its built-in 80×25, 9″ green phosphor CRT monitor and flip-top keyboard, the Kaypro fit into that loveable luggable category of machines and predated IBM’s and Apple’s market dominance by a few years. The CP/M operating system has actually aged pretty well — but well enough to port [Chris]’ Deep Dish Nine, a graphical game written for the Arduboy that uses Kerbal-like orbital mechanics skills to deliver interplanetary pizzas? In the first instance, no — the game, ported to Turbo Pascal, only managed fractional frames per second, rendering it unplayable. But with some very clever coding, [Chris] was able to improve refresh rates 10-fold. The optimization road not taken includes hardware hacks, like overclocking the Z80 or even replacing it with an FPGA and emulator, but that’s hardly keeping with the spirit of the thing.

It’s always great to see vintage machines pushing the envelope. A great place to see them is one of the Vintage Computer Fairs, like the upcoming VCF Southeast in Georgia. We were at the one diagonally across the country a few weeks back, and they’re well worth the trip.

Hackaday Links Column Banner

Hackaday Links: April 8, 2018

SiFive raised $50 Million in funding. SiFive is a semiconductor working on two fronts: they want to democratize silicon prototyping, and they’re the people making the HiFive series of microcontrollers and SoCs. The HiFives are built on the RISC-V instruction set, a Big-O Open instruction set for everything from tiny microcontrollers to server CPUs. With RISC-V, you’re not tied to licensing from ARM or their ilk. Recently SiFive introduced an SoC capable of running Linux, and the HiFive 1 is a very fast, very capable microcontroller that’s making inroads with Nvidia and Western Digital. The new round of funding is great news for anyone who wants Open Source hardware, and the silicon prototyping aspect of it is exceptionally interesting. Great news for SiFive.

Guess what’s in just a few weekends? The Vintage Computer Festival Southeast. The VCFSE is Hotlanta’s own vintage computer festival, with a whole host of speakers, exhibits, and consignment to tickle those vintage dopamine receptors. On deck for the speakers is [Michael Tomczyk], one of the people responsible for the VIC-20, and [Scott Adams], no the other [Scott Adams], creator of adventure-style games for personal computers but not that adventure-style game. The exhibits will include Japanese retro computers, simulating an ENIAC and a mechanical keyboard meetup. If you’re around Georgia, this is an event worth attending.

Conference season is just around the corner, and you know what that means. It’s time to start ramping up for #badgelife. What is badgelife? It’s a hardware demoscene of electronic conference badges. This year, the badgelife scene has stumbled upon something everyone can get in on. Add-ons! They’re electronic hats (or shields, or capes) for all the badges. Physically, it’s a 2×2 pin header. Electronically, it’s power, ground and I2C. Want to prototype your own add-on? Good news, there’s a development board.

The Titius-Bode law states the semi-major axes of planets follow a geometric progression. The (simplified, incorrect) demonstration of this law states Mercury orbits at 0.25 AU, Venus at 0.5 AU, Earth at 1 AU, Mars at 2 AU, and continues to the outer planets. The Titius-Bode law is heavily discredited in the planetary science community, and any paper, talk, or manuscript is rejected by scientific editors out of hand. The Titius-Bode law is the planetary science equivalent of flat Earth conspiracy theories and Nazi moon bases; giving any consideration to the idea confirms you’re a moron. This week, some consulting firm posted something that is the Titius-Bode law on their blog. Why? So it could be submitted to Hacker News for that sweet SEO. This submission was upvoted to the top position, and is a wonderful springboard to argue an interesting point on media literacy. I posit the rise of news aggregators (facebook, twitter, digg, reddit, and HN), is the driving force behind ‘fake news’ as lay people become the gatekeepers. Prove me wrong.

The Department of Homeland Security has confirmed there are cell-site simulators (Stingrays, IMSI-catchers, or otherwise known as your own private cell phone base station) around Washington DC. It’s unknown who is operating these simulators, or even where they are. There are two things to read between the lines with this information: Duh, there are rogue Stingrays in DC. Holy crap duh. I bet there are also some around midtown Manhattan. You can buy the stuff to do this on eBay. Personally, I’ve found half a dozen Stingrays or other rogue cell stations this year (guess where?). Second, why is this a news item now? Is this a signal that the DHS will start clamping down on stuff you can buy on eBay? Hop to it, people; cellular hardware is a great way to make a liquid nitrogen generator.

Floor Mopping Robot Takes Cleanliness To The Next Level

While it’s nice to have a robot vacuum your floors for you, a vacuum can only clean your house so much. For a really deep clean, you’ll also need to run a mop over the hard floor surfaces. [Josh] took this to its logical conclusion and built a robot that can really scour his floors for his entry into this year’s Hackaday Prize.

The robot has the ability to spray the floor with a cleaning solution, and then drive over it and scrub the floors with a squeegee. Its designed in a way that allows it to get into tight corners without needing a special brush, and of course it has all the bells and whistles that other robots have, such as ultrasonic sensors, collision detection, and a brain that allows it to navigate a course and get the entire area cleaned.

There are many videos of the robot in action on the project site, showing its operation and testing various features of the device. It’s a pretty interesting take on the home robot, and since its Open Hardware you can build your own if you’re often frustrated by having to mop your own floors, or you could modify it to do things other than squeegee the floors clean.

Continue reading “Floor Mopping Robot Takes Cleanliness To The Next Level”

New App Note Day: Internet Of Pillows

The Internet of Things is a cancer that consumes all reasonable expectations of technology, opens vast security holes we’ve never had to deal with before, and complicates life in the pursuit of quarterly gains from whatever technology startup is hot right now. We are getting some interesting tech out of it, though. The latest in the current round of ‘I can’t believe someone would build that’ is the Internet of Pillows. No, it’s not a product, it’s just an application note, but it does allow us to laugh at the Internet of Things while simultaneously learning about some really cool chips.

The idea behind this ‘smart’ pillow is to serve as a snoring sensor. When the smart pillow detects the user is snoring, a small vibration motor turns on to wake up the user. There’s no connectivity in this smart pillow, so the design is relatively straightforward. You need a microphone or some sort of audio sensor, you should probably have a force-sensitive resistor so you know the pillow is actually being used, and you need a vibration motor. Throw in a battery for good measure. Aside from that, you’re also going to need a microcontroller, and that’s where things get interesting.

This application note was written as a demonstration of what Dialog’s GreenPAC devices can do. We’ve seen these things before, and the idea behind these devices is something like a ‘modern-day PAL’ or ‘a really, really limited FPGA’. It’s a bit more than that, though, because the GreenPAC devices are mixed-signal, there are some counters and latches in there, and all the programming is done through a graphical IDE. If you need a small, low-power chip that only does one thing, the GreenPAC is right up your alley.

So, how does this device detect snoring? The code pulls data from the sound sensor every 30 ms, with a 5 ms time window. If this sound repeats again within six seconds, it’s assumed the user is snoring. The logic then turns on the vibration motor, greatly annoying whoever is sleeping. All of this is done through a graphical IDE, which I’m sure will draw the ire of some, but there really aren’t that many pins or that many LUTs on GreenPAC devices, so it’s never going to get too out of hand.

The GreenPAC is a very interesting family of parts that we don’t see too much of around here. That’s a shame, because for low-power applications that don’t need a lot of horsepower, the GreenPAC seems like it would be very useful. Slightly more useful than an Internet of Things pillow, at least.

Cracking A Bluetooth Credit Card

You might be surprised to find out that it’s actually not a good idea to put all of your credit card information on a little Bluetooth enabled device in your pocket. Oh, what’s that? You knew already? Well in that case you won’t find the following information terribly shocking, but it’s still a fascinating look at how security researchers systematically break down a device in an effort to find the chinks in its armor.

[Mike Ryan] of ICE9 Consulting has recently published an article detailing the work done to examine and ultimately defeat the security on the FUZE Card. From using an x-ray machine to do non-destructive reconnaissance on the device’s internals to methodically discovering all the commands it responds to over Bluetooth, it’s safe to say the FUZE Card is cracked wide open at this point.

To be clear, the attacker must still pair with FUZE, so physical access is required. But as pointed out by [Mike] in the blog post, handing your card over to a merchant is standard operating procedure in many cases. It isn’t as if it would be hard to get a hold of one of these FUZE cards for a minute or two without the owner becoming suspicious. Pairing FUZE to the Linux device to continue to the next step of the attack only takes a few seconds, as demonstrated in the video after the break.

Once paired, the attacker can simply send a BLE command to FUZE which disables the lock screen. It’s really that simple. The attacker can also send commands to dump credit card info over Bluetooth, meaning they could download your information even when the card is “safely” back in your pocket. The inherent failure in the FUZE design is that you don’t need to provide any sort of authentication to pair it to a new Bluetooth device. It makes the (very dangerous) assumption that the person holding it is entitled to do so.

Even if you know better than to ever buy a device like this, the post [Mike] has written up is really a must-read for anyone who’s ever looked at a device and tried to figure out what was going on in its little silicon brain. We especially liked his assertion that reverse engineering a device essentially boils down to: “staring, thinking, a little experimentation, but mostly staring and thinking.” We’re having an internal debate here at Hackaday HQ about making that the site’s tagline.

Incidentally, this is very similar to the Bluetooth gun “safe” that was cracked not so long ago. At this point, it might be wise to just stay away from anything with that little blue logo on it if you intend to trust it with your identity and/or deadly weapon.

Continue reading “Cracking A Bluetooth Credit Card”

Function Generator Gets DIY Frequency Standard

For those of us who like to wrangle electrons from time to time, there are some exceptional deals out there for low (or at least lower) cost imported test equipment. If you’re willing to part with a few hundred dollars US, you can get some serious hardware that a decade ago would have been effectively outside the reach of the hobbyist. Right now you can order a four channel oscilloscope for less than what a new Xbox costs; but which one you’ll rack up more hours staring at slack-jawed is up to you.

10 MHz output from DIY frequency standard

Of course, these “cheap” pieces of equipment aren’t always perfect. [Paul Lutus] was pretty happy with his relatively affordable Siglent SDG 1025 Arbitrary Function Generator, but found its accuracy to be a bit lacking. Fortunately, the function generator accepts an external clock which can be used to increase its accuracy, so he decided to build one.

[Paul] starts off by going over the different options he considered for this project, essentially boiling down to whether or not he wanted to jump through the extra hoops required for an oven-controlled crystal oscillator (OCXO). But the decision was effectively made for him when his first attempt at using a more simplistic temperature controlled oscillator failed due to an unfortunate misjudgment in terms of package size.

In the end, he decided to spring for the OCXO, and was able to use the USB port on the front panel of the SDG 1025 to provide the power necessary for the crystal to warm up and remain at operating temperature. After he got the oscillator powered, he just needed to put it in a suitable metal enclosure (to cut down external interference) and calibrate it. [Paul] cleverly used the NIST WWV broadcast and his ears to find when his frequency standard overlapped that of the source, therefore verifying it was at 10 MHz.

Hackers love accuracy, and accordingly, we’ve seen a number of frequency standard builds ranging from extremely cheap to luxuriously overkill.