Embed With Elliot: LIN Is For Hackers

A car is a rolling pile of hundreds of microcontrollers these days — just ask any greybeard mechanic and he’ll start his “carburetor” rant. All of these systems and sub-systems need to talk to each other in an electrically hostile environment, and it’s not an exaggeration to say that miscommunication, or even delayed communication, can have serious consequences. In-car networking is serious business. Mass production of cars makes many of the relevant transceiver ICs cheap for the non-automotive hardware hacker. So why don’t we see more hacker projects that leverage this tremendous resource base?

The backbone of a car’s network is the Controller Area Network (CAN). Hackaday’s own [Eric Evenchick] is a car-hacker extraordinaire, and wrote up most everything you’d want to know about the CAN bus in a multipart series that you’ll definitely want to bookmark for reading later. The engine, brakes, doors, and all instrumentation data goes over (differential) CAN. It’s fast and high reliability. It’s also complicated and a bit expensive to implement.

In the late 1990, many manufacturers had their own proprietary bus protocols running alongside CAN for the non-critical parts of the automotive network: how a door-mounted console speaks to the door-lock driver and window motors, for instance. It isn’t worth cluttering up the main CAN bus with non-critical and local communications like that, so sub-networks were spun off the main CAN. These didn’t need the speed or reliability guarantees of the main network, and for cost reasons they had to be simple to implement. The smallest microcontroller should suffice to roll a window up and down, right?

In the early 2000s, the Local Interconnect Network (LIN) specification standardized one approach to these sub-networks, focusing on low cost of implementation, medium speed, reconfigurability, and predictable behavior for communication between one master microcontroller and a small number of slaves in a cluster. Cheap, simple, implementable on small microcontrollers, and just right for medium-scale projects? A hacker’s dream! Why are you not using LIN in your multiple-micro projects? Let’s dig in and you can see if any of this is useful for you. Continue reading “Embed With Elliot: LIN Is For Hackers”

First Look: Macchina M2

In the past few years, we’ve seen a growth in car hacking. Newer tools are being released, which makes it faster and cheaper to get into automotive tinkering. Today we’re taking a first look at the M2, a new device from the folks at Macchina.

The Macchina M1 was the first release of a hacker friendly automotive device from the company. This was an Arduino compatible board, which kept the Arduino form factor but added interface hardware for the protocols most commonly found in cars. This allowed for anyone familiar with Arduino to start tinkering with cars in a familiar fashion. The form factor was convenient for adding standard shields, but was a bit large for using as a device connected to the industry standard OBD-II connector under the dash.

The Macchina M2 is a redesign that crams the M1’s feature set into a smaller form factor, modularizes the design, and adds some new features. With their Kickstarter launching today, they sent us a developer kit to review. Here’s our first look at the device.

Continue reading “First Look: Macchina M2”

Ikea Standing Desk Goes Dumb To Smart On LIN Bus

IKEA’s products are known for their clean, Scandinavian design and low cost, but it is their DIY or “assemble it yourself” feature that probably makes them so popular with hackers. We seem to receive tips about IKEA hacks with a consistent regularity. [Robin Reiter] has a Bekant Sit/Stand motorized table with buttons to raise and lower the surface, but it doesn’t have any memory presets. That’s a shame because it requires a lot of fiddling with the up/down buttons to get it right every time. It would be nice to press a button, go grab a Coffee, and come back to find it adjusted at the desired height. With a little bit of hacking, he was able to not only add memory preset buttons, but also a USB interface for future computer control.

The existing hardware consists of a PIC16LF1938 micro-controller with two buttons for movement control and a LIN bus  protocol which communicates with the automotive grade motors with integrated encoders that report position values. After a bit of sniffing around with his oscilloscope and analyzer, he was able to figure out the control codes for the motor movements. For some strange reason, however, the LIN signals were inverted, so he had to introduce a transistor signal inverter between the PIC master and the Arduino Nano that would act as a slave LIN node. Software was made much easier thanks to an Arduino library developed by [Zapta] for the LIN Bus signal Injector, The controls now have four buttons — two to replicate the original up/down movements, and the other two to act as memory presets.

The code, schematic and a simple wiring layout are posted on Github, in case there are others out there who’d like to replicate this hack. Check out the video after the break where he gives a walk through the code.

Continue reading “Ikea Standing Desk Goes Dumb To Smart On LIN Bus”