Part of the fun of watching action movies is imagining yourself as the main character, always going on exciting adventures and, of course, being accompanied by the perfect soundtrack to score the excitement and drama of your life. While having an orchestra follow you around might not always be practical, [P1kachu] at least figured out how to get some musical orchestration to sync up with how he drives his car, Fast-and-Furious style.
The idea is pretty straightforward: when [P1kachu] drives his car calmly and slowly, the music that the infotainment system plays is cool and reserved. But when he drops the hammer, the music changes to something more aggressive and in line with the new driving style. While first iterations of his project used the CAN bus, he moved to Japan and bought an old Subaru that doesn’t have CAN. The new project works on something similar called Subaru Select Monitor v1 (SSM1), but still gets the job done pretty well.
The hardware uses an Asus Tinkerboard and a Raspberry Pi with the 7″ screen, and a shield that can interface with CAN (and later with SSM1). The new music is selected by sensing pedal position, allowing him to more easily trigger the aggressive mode that his previous iterations did. Those were done using vehicle speed as a trigger, which proved to be ineffective at producing the desired results. Of course, there are many other things that you can do with CAN bus besides switching up the music in your car.
Continue reading “Adaptive Infotainment Plays Tunes To Match Your Dangerous Driving”
The CAN bus is a rich vein to mine for a hacker: allowing the electronic elements of most current vehicles to be re-purposed and controlled with ease. [MikrocontrollerProjekte] has reverse engineered a CAN bus media and navigation controller and connected it to an STM32F746G-Discovery board. The STM32 is in turn connected to an Android phone, and allows the media controller to trigger a large number of functions on the phone, including music playback, maps, and general Android navigation.
When reverse engineering the controller, [MikrocontrollerProjekte] employed a variety of approaches. A small amount of information was found online, some fuzzing was done with random CAN bus IDs and messages, as well as some data logging with the device inside the car to identify message data to the relevant IDs on the bus.
The STM32F746G-Discovery board acts as a Human Interface Device (HID), emulating a mouse and keyboard connected to the Android phone via USB OTG. The LCD screen shows the output of the keystrokes and touchpad area. We’re not sure how useful the mouse-emulation would be, given that the phone has a touchscreen, but the media functions work really well, and would also make a really snazzy music controller for a PC.
We’ve covered plenty of other cool CAN bus hacks, like reverse-engineering this Peugeot 207, or this general purpose CAN sniffer.
Continue reading “Reverse Engineered Media Controller From Car Is Best Friends With Android”
The CAN bus has become a staple of automotive engineering since it was introduced in the late ’80s, but in parallel with the spread of electronic devices almost every single piece of equipment inside a car has been put on the CAN bus. While there are opinions on whether or not this is a good thing, the reality is that enough data is gathered on this bus to turn an unmodified modern car into a video game controller with just a little bit of code.
The core of [Scott]’s project is a laptop and a Python program that scrapes information about the car from the car’s CAN bus, including positions of the pedals and the steering wheel. This information can be accessed by plugging an adapter into the OBD-II port (a standard for all cars made after 1995). From there, the laptop parses the CAN data into keyboard and mouse commands for your video game of choice.
This is an interesting investigation into the nitty-gritty of the CAN bus, but also a less dangerous demonstration of all of the data available from the car than some other cases we’ve seen. At least [Scott]’s Mazda (presumably) lacks any wireless attack vectors!
Continue reading “Turn a Car Into a Game Controller”
While most of us will never set foot in a fighter jet, some of us can still try to get as close as possible. One of the most eye-catching features of a fighter jet (at least from the pilot’s point-of-view) is the heads-up display, so that’s exactly what [Frank] decided to build into his car to give it that touch of fighter jet style.
Heads-up displays use the small reflectivity of a transparent surface to work. In this case, [Frank] uses an LED strip placed on the dashboard to shine up into the windshield. A small amount of light is reflected back to the driver which is able to communicate vehicle statues without obscuring view of the road. [Frank]’s system is able to display information reported over the CAN bus, including voltage, engine RPM, and speed.
This display seems to account for all the issues we could think up. It automatically cycles through modes depending on driving style (revving the engine at a stoplight switches it to engine RPM mode, for example), the LEDs automatically dim at night to avoid blinding the driver, and it interfaces with the CAN bus which means the ability to display any other information in the future should be relatively straightforward. [Frank] does note some rough edges, though, namely with the power supply and the fact that there’s a large amount of data on the CAN bus that the Teensy microcontroller has a hard time sorting out.
That being said, the build is well polished and definitely adds a fighter jet quality to the car. And if [Frank] ever wants even more aviation cred for his ground transportation, he should be able to make use of a 747 controller for something on the dashboard, too.
Prolific hacker [kodera2t] is working on his own “ESP32 monster board” dev board for the still-newish ESP32 WiFi module. His board has everything: Ethernet, OLED, LiPo, and even CAN-bus. But all that peripheral connectivity is worth nothing if you can’t program the microcontroller to use it.
The Arduino environment for the ESP32 is coming along quite nicely, but it’s not yet fully featured enough to run all of [kodera2t]’s hardware. To take advantage of all that, he needs to use Espressif’s SDK — called the “IoT Development Framework” or IDF for short. In his latest project log, [kodera2t] goes through everything necessary to get the IDF up and compiling on OSX. (It’s strangely similar to the Linux procedure.) Read through the official instructions here, if you want more, but we think [kodera2t] hits all the high points.
While we’re tooting [kodera2t]’s horn, check out his old project — an Arduino shoehorned into an SD card — or watch his alter-ego [Toshiro Kodera] give a serious talk about his day job, engineering radio-frequency meta-materials.
Stepper motors are a great solution for accurate motion control. You’ll see them on many 3D printer designs since they can precisely move each axis. Steppers find uses in many robotics projects since they provide high torque at low speeds.
Since steppers are used commonly used for multi-axis control systems, it’s nice to be able to wire multiple motors back to a single controller. We’ve seen a few stepper control modules in the past that take care of the control details and accept commands over SPI, I2C, and UART. The AnanasStepper 2.0 is a new stepper controller that uses CAN bus for communication, and an entry into the 2017 Hackaday Prize.
A CAN bus has some benefits in this application. Multiple motors can be connected to one controller via a single bus. At low bit rates, it can work on kilometer long busses. The wiring is simple and cheap: two wires twisted together with no shielding requirements. It’s also designed to be reliable in high noise environments such as cars and trucks.
The project aims to implement an API that will allow control from many types of controllers including Arduino, Linux CNC, several 3D printer controllers, and desktop operating systems. With a few AnanasSteppers one of these controllers, you’d be all set up for moving things on multiple axes.
I am a crappy software coder when it comes down to it. I didn’t pay attention when everything went object oriented and my roots were always assembly language and Real Time Operating Systems (RTOS) anyways.
So it only natural that I would reach for a true In-Circuit-Emulator (ICE) to finish of my little OBDII bus to speed pulse generator widget. ICE is a hardware device used to debug embedded systems. It communicates with the microcontroller on your board, allowing you to view what is going on by pausing execution and inspecting or changing values in the hardware registers. If you want to be great at embedded development you need to be great at using in-circuit emulation.
Not only do I get to watch my mistakes in near real time, I get to make a video about it.
Getting Data Out of a Vehicle
I’ve been working on a small board which will plug into my car and give direct access to speed reported on the Controller Area Network (CAN bus).
To back up a bit, my last video post was about my inane desire to make a small assembly that could plug into the OBDII port on my truck and create a series of pulses representing the speed of the vehicle for my GPS to function much more accurately. While there was a wire buried deep in the multiple bundles of wires connected to the vehicle’s Engine Control Module, I have decided for numerous reasons to create my own signal source.
At the heart of my project is the need to convert the OBDII port and the underlying CAN protocol to a simple variable representing the speed, and to then covert that value to a pulse stream where the frequency varied based on speed. The OBDII/CAN Protocol is handled by the STN1110 chip and converted to ASCII, and I am using an ATmega328 like found on a multitude of Arduino’ish boards for the ASCII to pulse conversion. I’m using hardware interrupts to control the signal output for rock-solid, jitter-free timing.
Walk through the process of using an In-Circuit Emulator in the video below, and join me after the break for a few more details on the process.