CAN Hacking: The Hardware

So far we have discussed the basics of CAN, in-vehicle networks, and protocols used over CAN. We’re going to wrap up with a discussion of CAN tools, and parts to build your own CAN hardware.

Wiring

Unfortunately, there’s no set standard for CAN connections. The most common connector for high-speed CAN is a DE-9, with CAN high on pin 7 and CAN low on pin 2. However cables will differ, and many are incompatible.

CAN needs to be terminated, preferably by a 120 ohm resistance on either end of the bus. In practice, you can stick a single 120 ohm resistor across the bus to deal with termination.

Tools

A good CAN tool will let you transmit and receive CAN messages, interpret live data using CAN databases, and talk CAN protocols. The tools with this feature set are proprietary and expensive, but some hacker friendly options exist.

GoodThopter

The GoodThopter12

Based on [Travis Goodspeed’s] GoodFET, the GoodThopter by [Q] uses the Microchip MCP2515 CAN to SPI controller to access the bus. The open hardware tool lets you send and receive messages using Python scripts.

CAN Bus Triple

CAN Bus Triple

The CAN Bus Triple device provides an interface to three CAN buses, and can be programmed in an environment similar to Arduino. The open source code provided lets you muck with the second generation Mazda 3. Unfortunately, the hardware does not appear to be open source.

Saleae Logic

Saleae Logic

It’s not open source, but the Saleae Logic is a very handy and cheap tool for looking at CAN buses. It can capture, decode, and display CAN traffic. This is most useful when you’re building your own CAN hardware.

DIY

The Parts

If you want to design your own hardware for CAN, you’ll need two things: a CAN controller, and a CAN transceiver.

The CAN controller generates and interprets CAN messages. There’s many microcontrollers on the market with built-in CAN controllers, such as the Atmel ATmega32M1, Freescale S08D, and the TI Tiva C Series. When using a built-in CAN controller, you’ll have to use an external oscillator, internal oscillators are not sufficiently accurate for high-speed CAN. If you want to add CAN to an existing microcontroller, the MCP2515 is an option. It’s a standalone CAN controller that communicates over SPI.

The transceiver translates signals from the controller to the bus, and from the bus to the transceiver. Different transceivers are needed for high-speed and low-speed CAN networks. The NXP TJA1050 works with high-speed buses, and the ON Semi NCV7356 works with low-speed, single wire buses.

Dev Boards

There’s a ton of development boards out there featuring microcontrollers with a CAN controller. The Arduino Due‘s SAM3 processor has a controller, but there’s no transceiver on the board. You can pick up a CAN bus shield, and the Due CAN Library to get started.

The ChipKIT Max32 is similar to the Due. It has two CAN controllers, but you’ll need to provide external transceivers to actually get on a bus. Fortunately there’s a shield for that. The ChipKIT is officially supported by Ford’s OpenXC Platform, so you can grab their firmware.

That concludes our discussion of CAN Hacking. Hopefully you’re now ready to go out and experiment with the protocol. If you have questions, send them along to our tip line with “CAN Hacking” in the subject, and we’ll compile some answers. If you liked this series and want to suggest a topic for the next set of posts we’d love to hear that as well!

CAN Hacking

Fork-o-Drumbot: A MIDI Drummer!

forkotitle

We just got word of a great project by [Vito] — A MIDI Drumbot made from an Arduino and scraps from around the house!

After learning some basics of programming microcontrollers way back in high school, [Vito] was excited to start using the Arduino platform. His first thought was to build a desktop milling machine for engraving his own PCBs. But after a bit of research, he soon concluded it might be a bit too ambitious for a first project, so he opted for something a bit simpler — A robot drummer.

Using some cardboard, a few elastics, a plastic fork, a 12V solenoid, an Arduino and a MIDI interface he had created the original Fork-o-Drumbot, able to tap a simple beat, using one note. After this initial success he grew excited to continue along the same vein of recycling things to characterize his entire project. Fast forward a few weeks of blog posts and he now has a fully functional MIDI drummer which even has a cymbal! They were even featured in the local newspaper after performing a duet with a local singer during an art exhibit called the Singing Balconies of Friedrichshain.

Stick around after the break for an extremely catchy rendition of Superstitious by Stevie Wonder, as played by the Fork-o-Drumbot!

Continue reading “Fork-o-Drumbot: A MIDI Drummer!”

Can An 8 Node Raspberry Pi Cluster Web Server Survive Hackaday?

Plenty of folks have used their Raspberry Pi as a web server. [Steve] however is the first 8 node load balanced pi cluster server we’ve run into.  While we have seen pi clusters before, they’ve never been pressed into service as a public facing web server. [Steve] has created a really nice informative website about the Raspberry Pi, and Linux in general. As his page views have increased, he’s had to add nodes to the server. Currently [Steve] sees about 45,000 page views per month.

At first glance it would seem that the load balance system would be the weak link in the chain. However, [Steve] did realize that he needed more than an Pi to handle this task. He built the load balancer using an old PC with 512MB of RAM and a 2.7GHz x86 CPU. The most important thing about the balancer is dual network interfaces, one side facing the internet, the other facing the Pi cluster. The balancer isn’t a router though. Only HTTP requests are forwarded. The Pi nodes themselves live on their own sub net. Steve has run some basic testing with siege, however nothing beats a real world test. We figured a couple of links in from Hackaday would be enough to acid test the system.

Do It Yourself Nuclear Fusion

By far the coolest projects we see are those dealing with high voltages and deep vacuums. Vacuum tubes of all types fall into this category, as do the electron microscopes we see from time to time. The king of all vacuum and electron hacks is the Farnsworth Fusor, a machine that will both transmute the elements and bathe you in neutrons. Fun stuff, and [Daniel] has a great tutorial for building your own.

[Dan]’s fusor is surprisingly simple to make. Obviously, the most important part is the vacuum chamber which in this build is based around a glass oil cup cylinder. With just a few roughly machined parts – the only tool needed to make the metal plates is a drill press – it can hold a low enough vacuum to contain a star in a jar.

For reasons of safety and sanity, [Dan] isn’t running his fusor at a high enough voltage to actually fuse deuterium into helium. This is really just a beautiful, glowey demonstration of what can be done with enough knowledge, the skills, and a handful of parts.

Open Source Telescope Control

board

Telescope mounts connected to computers and stepper motors have been available to the amateur astronomer for a long time, and for good reason, too. With just the press of a button, any telescope can pan over to the outer planets, nebula, or comets. Even if a goto command isn’t your thing, a simple clock drive is a wonderful thing to have. As with any piece of professional equipment, hackers will want to make their own version, and thus the openDrive project was born. It’s a project to make an open source telescope controller.

Right now, the project is modular, with power supply boards, a display board, motor driver, an IO board (for dew heaters and the like), and a hand-held controller. There’s an openDrive forum that’s fairly active covering both hardware and software. If you’re looking for a project to help you peer into the heavens, this is the one for you. If telescope upgrades aren’t enough to quench your astronomical thirst you could go full out with a backyard observatory build.

Danke [Håken] for the tip.

Manufacturer-Crippled Flir E4 Thermal Camera Hacked To Perform As High-End Model

Last month, [Mike] took a look at the Flir E4 thermal imaging camera. It’s a great tool for those occasions when you need the vision of a Predator, but what he found inside was substantially cooler: it seems the engineers behind the Flir E4 made their lives easier by making the circuits inside the $1000 E4 the same as the $6000 Flir E8.

This only means one thing, and [Mike] has delivered. He’s upgraded the firmware in the Flir E4 to the E8, giving it a vastly increased resolution – 80×40 for the E4 to 320×240 for the E8.

The hack itself is as easy as putting the serial number of the E4 in a config file, zipping a few files up, and installing it with the Flir tools. An amazingly simple mod (with an awesome teardown video) that turns a $1000 thermal imaging camera into the high-end $6000 model.

Continue reading “Manufacturer-Crippled Flir E4 Thermal Camera Hacked To Perform As High-End Model”