Interface category

Hack Your Car With Macchina M2

Car hacking applications have been growing during the last few years, making it faster and cheaper to get into automotive tinkering. A new device was launched recently on kickstarter called M2 by Macchina.

M2 is an open-source, versatile development platform which can be wired under the hood for a more permanent installation or plugged into the OBD2 port, enabling you to do virtually anything with your vehicle’s software.

It is a tiny device (56.4mm x 40.6mm x 15.7mm) that is compact, modular, wirelessly connectable, and based on the popular Arduino Due. It consists of a processor board with a SAM3X8E Cortex-M3 MCU, a USB port, some LEDs, an SD card slot, and built-in EEPROM, as well as an interface board with two channels of CAN, two channels of LIN/K-LINE, a J1850 VPW/PWM, and even a single-wire (GMLAN) interface.

M2 is universal as its libraries and protocols are compatible with any car that isn’t older than Google. Macchina also aims to make the M2 compatible with as many existing open source software packages as possible.It is already compatible with SavvyCAN, CanCAT, MetaSploit, and CANtact.

Working with M2 is easy for Arduino users. Here is a summary of the steps needed to duplicate our shift light project on a CANbus-equipped manual transmission car that also illustrates the basic workflow when car hacking with M2:

  • Step 1: Download the latest Arduino IDE and install the Macchina boards add-on; test everything is working by blinking an LED.
  • Step 2: Download and install one of several open source “Sniffer” applications to your computer and upload the corresponding “sketch” to M2.
  • Step 3: Use the “Sniffer” application to identify the piece of data you are looking to use. In this case, engine RPM
  • Step 4: Write a “Sketch” to watch for RPM data and light up some LEDs proportionally and flash when it is time to shift.

You can also check this video to see an example of simple car hacking:

Macchina has partnered with Arduino, Digi and Digi-Key to develop M2, and it believes that its highly-adaptable hardware will most benefit hot rodders, mechanics, students, security researchers, and entrepreneurs by providing them access to the inner workings of their rides.

As it is an open source project, you can get its 3D files, schematics, BOM, and source files on the github repository. M2 will be available for $79 and it may cost about $110 if you build it yourself. Visit Macchina’s Kickstarter page to learn more or pre-order yours today. You can also check out Hackaday’s review about M2.

Macchina M2 tutorial introduction:

DS28EC20, A Serial 1-Wire 20Kb EEPROM

The American manufacturer of analog and mixed-signal integrated circuits, Maxim Integrated, has developed a new serial EEPROM memory that operates from single-contact 1-wire interface.

The DS28EC20 is a 20480-bit, 1-Wire® EEPROM organized as 80 memory pages of 256 bits each. An additional page is set aside for control functions. Data is written to a 32-byte scratchpad, verified, and then copied to the EEPROM memory.

The 1-Wire is a device communications bus system that provides low-speed data, signaling, and power over a single conductor. This technology uses only two wires; data and ground. It is similar in concept to I²C, but with lower data rates and longer range. It is typically used to communicate with small inexpensive devices such as digital thermometers and weather instruments.

DS28EC20 features:
  • 20480 Bits of Nonvolatile (NV) EEPROM Partitioned into Eighty 256-Bit Pages
  • Individual 8-Page Groups of Memory Pages (Blocks) can be Permanently Write Protected or Put in OTP EPROM-Emulation Mode (“Write to 0”)
  • Read and Write Access Highly Backward-Compatible to Legacy Devices (e.g., DS2433)
  • 256-Bit Scratchpad with Strict Read/Write Protocols Ensures Integrity of Data Transfer
  • 200k Write/Erase Cycle Endurance at +25°C
  • Unique Factory-Programmed 64-Bit Registration Number Ensures Error-Free Device Selection and Absolute Part Identity
  • Switchpoint Hysteresis and Filtering to Optimize Performance in the Presence of Noise
  • Communicates to Host at 15.4kbps or 90kbps Using 1-Wire Protocol
  • Low-Cost TO-92 Package
  • Operating Range: 5V ±5%, -40°C to +85°C
  • IEC 1000-4-2 Level 4 ESD Protection (8kV Contact, 15kV Air, Typical) for I/O Pin

Blocks of eight memory pages can be write-protected or put in EPROM-Emulation mode, where bits can only be changed from a 1 to a 0 state. The life-expectancy of the DS28EC20 is specified at more that 200 k erase/write cycles at 25 °C. The I/O pin has IEC 1000-4-2 Level 4 ESD protections (8 kV contact, 15 kV air).

Applications that can use the DS28EC20:
  • Card/Module Identification in Rack-Based Systems
  • Device Authentication
  • IEEE 1451.4 Sensors
  • Ink and Toner Cartridge ID
  • Medical and Industrial Sensor Identification/Calibration
  • PCB Identification
  • Smart Cable

Ordering DS28EC20 is available for about $1.7 per chip through Maxim website. You can also get design resources and technical documents of the chip.

VGADuino-II : Arduino Graphic Shield

VGADuino-II : The New 256 Color Graphic Shield for Arduino

Arduino is pretty much famous for the numerous shields it has. These plug-and-play shields make our life a lot easier while working on some complicated projects. Among all other shields, graphic shields are getting more and more popular. A graphic shield lets you show text, numbers, shapes, and even small images on a screen, using Arduino. VGADuino-II is a new graphic shield which lets you use your TV or any monitor with VGA 15 pin as a large screen for Arduino.

It’s very exciting that you won’t have to rely on those small displays which are stacked on the shield itself, anymore. Rather you are getting a whole TV or VGA monitor to display your data. As  Masih Vahida, the creator of VGADuino, says:

VGADuino is a shield that is made for Arduino with all the libraries and samples that user can easily stack it on the Arduino board and starts programming. it can connect Arduino to any kind of TV or Monitor with VGA 15 Pin connector.

VGADuino-II : The 256 color graphic shield for arduino
VGADuino-II: The 256 color graphic shield for Arduino

Key Features:

  • Internal functions to draw various shapes with AT-Commands and Arduino libraries
  • 11 Different font sizes with standard ASCII characters support
  • 256 color, 8bit RGB format
  • Having access to each pixel individually
  • Standard VGA DB15 output
  • Screen resolution: 800×600 60Hz
  • Actual pixels: 400×300 60Hz

Technical Details:

In VGADuino-II, NXP-LPC1756 ARM chip is used as the main microcontroller and XILINX XC95144XL CPLD for refreshing the display and taking care of the sync signals. There is also an SD Ram to keep the screen’s pixel color data.

In this version of VGADuino, each pixel is one byte, that means each pixel has 256 colors which are in standard 8bit RGB format. (3 bits for Red, 3 bits for Green and 2 bits for Blue).

It communicates with Arduino over UART using predefined AT command set. All relevant Arduino libraries are available to implement in code. The user can choose among all 11 fonts with definable background and foreground color of text.

VGADuino-II Technical Details
VGADuino-II Technical Details

Conclusion:

VGADuino-II is available for $79. You may go here and back the Kickstarter project to get a VGADuino-II. All the groundbreaking features offered by VGADuino-II are making it a value for money. There is no risk at all. The design is tested and completed by the maker.

For a better understanding watch this video.

https://www.kickstarter.com/projects/67935456/vgaduino-ii-new-256-color-graphic-shield-for-ardui/widget/video.html

CMOS-TTL QUADRATURE ENCODER USING LS7084

The quadrature LS7084 Module is a CMOS quadrature clock converter. Quadrature clocks derived from optical or magnetic encoders, when applied to the A and B inputs of the LS7084 are converted to strings of a Clock and an Up/down direction control. These outputs can be interfaced directly with standard Up/Down counters for direction and position sensing of the encoder.

Features

  • Supply 5V DC
  • +4.5V to +10V operation (VDD – VSS)
  • On Board Power LED
  • J1 Encoder pulse multiplication ( Jumper JL Close =1X, Jumper JH Close = X4)
  • Header Connector for Encoder Interface
  • X1 and X4 mode selection
  • Programmable output clock pulse width
  • On-chip filtering of inputs for optical or magnetic encoder applications.
  • TTL and CMOS compatible I/Os
  • Up to 16MHz output clock frequency

CMOS-TTL QUADRATURE ENCODER USING LS7084 – [Link]

Program ESP8266 with Arduino

Programming ESP8266 With Arduino IDE : The Easy Way

The ESP8266 WiFi Module is a self-contained SOC that can give any microcontroller access to your WiFi network. It’s an extremely cost-effective board with a huge and ever-growing community. Each ESP8266 module comes pre-programmed with an AT command set firmware. This module has a powerful on-board processing and storage capability that allows it to act as a standalone microcontroller.

Following 2 easy steps, you can upload Arduino sketches on your ESP8266 using Arduino IDE.

  • Configuring the IDE
  • Making the circuit

Parts List:

  1. ESP 8266 Module.
  2. Jumper wires.
  3. A breadboard.
  4. One USB to TTL converter, a.k.a UART converter.

Configuring The IDE:

In order to bring support for ESP8266 chips to the Arduino environment, you need to add ESP8266 Arduino Core in the IDE.

NOTE: You must have Arduino IDE version 1.6.4 or higher. The latest version is highly recommended. Download the latest version of IDE from Arduino.cc.

  1. Install Arduino 1.6.8.
  2. Start Arduino and open Preferences window.
  3. Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. (See the first image)
  4. Open Boards Manager from Tools > Board menu and install esp8266 platform. (See the second image)

Add URL to "Preferences" in Arduino IDE

Add URL to “Preferences” in Arduino IDE

Select ESP8266 board from Board Manager

Select ESP8266 board from Board Manager

Making The Circuit:

ESP8266-01 wiring for uploading program
ESP8266-01 wiring for uploading program
ESP8266-12E wiring for uploading program
ESP8266-12E wiring for uploading program

ESP-01:

  1. Connect GPIO0 to Ground (set it LOW or 0)
  2. Connect CH_PD toVcc (set it HIGH or 1)

ESP-12(E/F):

  1. Connect GPIO0 to Ground (set it LOW or 0)
  2. Connect GPIO15 to Ground (set it LOW OR 0)
  3. Connect GPIO2 to Vcc (set it HIGH or 1)
  4. Connect CH_PD toVcc (set it HIGH or 1)

Pin Vcc and GND should be connected to power supply’s +ve and -ve rail respectively. TX and RX of ESP8266 should be connected to RX and TX of USB to TTL converter respectively.

NOTE: You can replace the USB to TTL converter with an Arduino UNO board, but you have to upload a blank sketch or “bare-minimum” sketch to the Arduino so that the MCU of the Arduino board doesn’t interrupt. Connect TX and RX of the ESP8266 to RX and TX of the Arduino UNO respectively.

Conclusion:

You are done! Now just select your ESP8266 board from Tools > Board menu, write any program, and click on Upload button. The ESP8266 will run as standalone microcontroller now.

To have a clear idea, read the article FLASH AT FIRMWARE TO ESP8266 also.

Turn Your Raspberry Pi Into An OBD2

Thomas Beck started a new project to develop a Raspberry Pi based OBD2, On-Board Diagnostic tester, to read vehicle data, trouble codes, and read monitor data. He had developed earlier a firmware for the elektor OBD Analyser NG, a handheld analyser with graphical display, ARM Cortex M3 controller and open source user interface. Since this device is not available anymore, he is working on a new one.

The On-Board Diagnostics is a system that makes status of all vehicle subsystems reachable by the vehicle owner or the repair technician, the data are requested from the vehicle through a list of predefined codes, then the OBD device will process and display them.

The Old Elector OBD Analyser NG
The Old Elektor OBD Analyser NG

The Raspberry Pi must have similar interfaces to the OBD Analyser NG. On the user side there is a serial interface which is available at the Raspberry Pi GPIOs, but on the vehicle side a DIAMEX DXM OBD2 module is used. Thus, Thomas decided to develop a simple add-on board to make the module compatible for using with Pi.

Thomas used the DXM on his own OBD2-Analyser NG for prototyping the idea, and share his successful results with DIAMEX, the manufacturer of the DXM module, which accepted the idea and developed a Pi-OBD add-on board based on their modern AGV OBD2 module.

The Pi-OBD add-on board consists of an DIAMEX AGV OBD2 interface with an automotive-proven power supply/voltage regulator for the AGV, the Pi and a display. It has a PCB that suitable with the Raspberry Pi B+, 2 and 3. The complete system is powered via the OBD2 cable. The Pi-OBD uses a few GPIOs and covers some more. So, using a display connected via an HDMI ribbon cable is recommended.

DIAMEX Pi-OBD Add-On Board
DIAMEX Pi-OBD Add-On Board

As a result, there are two options to add OBD2 to Raspberry Pi:

  1. OBD2 for Raspberry Pi using the DIAMEX Pi-OBD add-on board, it needs:
    • Pi-OBD add-on board
    • OBD2 cable
    • 7″ touchscreen
    • Raspberry Pi/Raspbian with free serial device, e.g. /dev/ttyAMA0 or /dev/ttyS0
    • HHGui OBD2 software for the Pi
  2. OBD2 for Raspberry Pi using the DIAMEX DXM OBD2 module, it needs:
    • XM OBD2 module
    • A few additional parts like PCB (a breadboard will do), wires, connector for GPIOs, connector for OBD2 cable, optional but recommended: 2 resistors, 1 capacitor, 1 diode
    • OBD2 cable
    • Vehicle 12V socket to USB adapter + USB cable to power the Pi and the display
    • Raspberry Pi/Raspbian with free serial device, e.g. /dev/ttyAMA0 or /dev/ttyS0
    • Display for the Pi (minimum display size 320 x 165 pixels)
    • HHEmu OBD2 software for the Pi

pi-case-1-sm

This project is still in the development phase and it is open source. All technical details are available at its official page.

Web-Bluetooth Devices Integration

Chrome Browser version 53 came out with a new feature: Origin Trial for Bluetooth which allows websites to use this feature and enable Web Bluetooth for all their visitors. Web Bluetooth is a new technology that connects the Web with the Internet of Things, this technology will provide a level of integration in the IoT scene that never happened before making web designers eager to get their bits out into the real world.

There is no need to install a mobile app on your smartphone to control any of your Bluetooth Low Energy (BTLE) devices anymore. Thanks to this technology, it will be easier to build one solution that will work on all platforms, including both mobile and desktop, that result to lower development costs, more open source control interfaces for various physical products, and more innovation.

To understand how that works, here’s an example of a drone controlled from a web app:

In Bluetooth Low Energy networks, devices play two roles. A device can be either a “Central” or a “Peripheral”. Bluetooth device with services that correspond to one function of the device. Each service exposes variables called characteristics that represent one parameter of the service, which can be read, written or both. Each service and characteristic is identified by a unique 16-bit or 128-bit number and they are defined by the Bluetooth SIG (Special Interest Group).

Bluetooth Low Energy: Peripherals, Services and Characteristics
Bluetooth Low Energy: Peripherals, Services and Characteristics

How to use Web Bluetooth

  • In order to use Web Bluetooth, your site must be served over a secure connection (HTTPS). A secure website is becoming a requirement for a growing number of new web APIs. One way is using GitHub hosting. The implementation of the Web Bluetooth API is partially complete and currently available on Chrome OS, Chrome for Android M, Linux, and Mac.
  • Go to chrome://flags/#enable-web-bluetooth, enable the highlighted flag, restart Chrome and you should be able to scan for and connect to nearby Bluetooth devices, read/write Bluetooth characteristics, receive GATT (Generic Attribute Profile) Notifications and know when a Bluetooth device gets disconnected.
  • Building a Web Bluetooth App

This is the process that will be common for all Web Bluetooth apps:

  1. Scan for a relevant Device
  2. Connect to it
  3. Get the Service you are interested in
  4. Get the Characteristic you are interested in
  5. Read, Write or Subscribe to the Characteristic

The code should be written in JavaScript. It has to scan for a device with an identified Service number, then ask for this service, ask for a specific characteristic number, and finally write the desired command. An example for hacking a light bulb and connecting it to the web via bluetooth is available here.

Although the browser is the most ubiquitous cross-platform operating system that the world has ever seen working on all platforms and systems, it could be a threat because of many malicious websites that mischief with your security. Sites ask the browser to show a list of nearby Bluetooth devices matching certain criteria, and the user either picks which to grant access to or cancels the dialog. Thus, users’ permission is the only responsible about their own privacy.

Two conflicting views are raising right now, one is for IoT enthusiasts and the other’s for security geeks. Essentially, this integration will push forward the development of new IoT applications. but it may risk users’ privacy. On the contrary, Developers are promising to minimize risks and are assuring that connection through this API will be secure and privacy-preserving. The Chrome team will end the trial in next January (2017), and after that, they expect to be able to stabilize the feature and move it closer to a general release.

Further details can be found at the official documentation website, the blog of one the developers, and this step-by-step tutorial. More about the security model can be reached here.

8 Channel Optically Isolated IO Board

8-channel-optically-isolated-io-board-c047_w

Opto-Isolated I/O Board offers a compact & convenient way to interface industrial type inputs/outputs to your microcontroller boards, Signal transmission between circuits of different potentials and impedances etc.

Specifications

  • 4 opto-isolated inputs & 4 opto-isolated outputs
  • Std TTL input signals for opto-couplers
  • Interfacing is via 10-pin Box Header and Screw terminal type connector
  • Power source LED indicator
  • Four mounting holes 3.2 mm each
  • PCB dimensions 54 mm x 64 mm

8 Channel Optically Isolated IO Board – [Link]

RELATED POSTS

4Duino – A 2.4″ TFT LCD IoT Display Module

If your application needs a controller with display interface and a network connectivity, then you need to think about using 4Duino from 4D Systems, a 2.4″ TFT LCD IoT display module.

4Duino-slide-1

4Duino key features

4Duino

4Duino has ATmega32U4, a 8-bit MCU from Atmel, which is the same microcontroller inside Arduino Leonardo. 4Duino also preserves Arduino UNO pinouts.

ESP8266 WiFi module ESP-06 model is embedded in 4Duino making it suitable for IoT (Internet of Things) applications.

4Duino features a 2.4” 320 x 240 pixels with 65K colors TFT LCD display, with resistive touch. LCD is powered by the feature-rich 4D Systems Picaso Graphics Processor.

A SD Card socket is connected also with Picaso for multimedia storage and data logging purpose, memory card storage size can be up to 32GB.

4duino_BD

  • ATmega32U4 with
    • 32KB Programmable Flash
    • 2.5KB Internal SRAM
    • 1KB Internal EEPROM
    • UP to 16 MIPS Throughput
  • Powerful 2.4” Intelligent LCD-TFT display module powered by PICASO with
    • 14KB Programmable Flash
    • 14KB Internal SRAM
    • 240 x 320 Resolution, RGB 65K true to life colours, TFT LCD Display with integrated 4-wire Resistive Touch Panel.
  • ESP8266 Wi-Fi Module with
    • 802.11 b/g/n
    • Wi-Fi Direct (P2P), soft-AP
    • TCP/IP protocol stack
    • 1MB Flash
  • General Purpose I/O pins for user interfacing, which include
    • 20 Digital IO pins
    • of which 7 are capable of PWM
    • and 12 are capable of Analog input
  • On-board USB for powering the 4Duino and programming the ATmega32U4.
  • 2×5 way header for programming Picaso and ESP8266 via a 4D Systems Programming Cable or Adaptor
  • On-board latch type micro-SD memory card connector for multimedia storage and data logging purposes.
  • DOS compatible file access (FAT16 format) as well as low level access to card memory.
  • Module dimensions: 72.8 x 53.3 x 14.6mm.

Programming 4Duino

There are two IDEs available to program the 4Duino. Using the Arduino IDE, or using the Workshop4 IDE  which provides additional customized graphical tools allowing the user to take the advantage of the features of the Atmel processor and the Picaso processor, by utilising the Picaso Serial Library and the hundreds of graphics commands.

If you want to program the Atmega32U4, there is no need to any additional hardware tools, but if you want to update ESP8266 or Picaso processor firmware, or if you want to use some tools from Workshop4 IDE like Genie environment, which provides Drag/Drop graphics building, then you need to have uUSB-PA5, a serial-TTL UART bridge converter, or any other Serial-TTL bridge.

Price and Documentation

4Duino price is 80$, also a starter kit is available for 110$, it includes some accessories like power adapter, SD card memory and uUSB-PA5-II (Programming Adaptor).

Product Page

4Duino Datasheet

4Duino Schematic

Workshop4 IDE
Via: HackerBoards

Bi-Directional Voltage Level Translator

20160706_VoltageLevelTranslator_002-768x512

Lukas Fassler from Soldernerd shares his experience designing a bi-directional voltage level translator and manufacturing the board with DirtyPCBs.

While most of my microcontroller designs run on 3.3 volts there is still the occasional 5 volt design. Or I do something with an Arduino. So the need may arise to interface between logic working at different voltage levels. There are several ways of doing this, depending on your needs. Things are relatively simple as long as you know in advance which side is transmitting and which side is receiving. It gets more difficult if the communication is bi-directional or with buses such as I2C that are bi-directional by nature.

Bi-Directional Voltage Level Translator – [Link]