Tag Archives: SPI

72 Channels Serial To Parallel Driver Board Using 74HC595 & ULN2803

72 channels Serial (SPI) to parallel driver board has been designed for various applications. This project can be used as multi Solenoid driver, large size 7 segment display driver, bar graph driver, and LED driver. The project works with 5V logic levels. Output load supply 12V-48V DC and each output can drive 500mA load.

I have used 3 digits 2.3Inch 7 segment displays as an example, this board can handle up to 9 digits. The board can serve many applications like, Stop Watch, digital timer, counter, score board, token display and lot more.

Project built around 74HC595 and ULN2803 ICs, The 74HC595 devices contain an 8-bit serial-in, parallel-out shift register that feeds an 8-bit D-type storage register. The storage register has parallel 3-state outputs. Separate clocks are provided for both the shift and storage register.

72 Channels Serial To Parallel Driver Board Using 74HC595 & ULN2803 – [Link]

SPI Isolation Board

The isolated SPI module is designed for applications, where SPI signals need to be transferred over longer distances than usually. It is based on Linear’s LTC6820. The board is designed as two layer stack-up, with GND plane on the bottom layer and signal traces and components at the top layer. Signals and power are supplied over standard 100mil (2.54mm) pitch IDC header.

Specification

  • Dimension: 40.005 mm x 30.099 mm (1.575″ x 1.185″)
  • 1 Mbps Isolated SPI Data Communication at 10m
  • 500 kbps Isolated SPI Data Communication at 100m
  • Galvanic Isolation Barrier using standard transformer (1500V)
  • Requires no software changes in most SPI systems
  • 3.5V to 15V power supply
  • SPI mode can be adjust via on-board jumpers
  • can act as Master or Slave (adjustable via jumper)
  • screw terminal for twisted pair cable (i.e. as in CAT5 Ethernet cable)

SPI Isolation Board – [Link]

Raspberry Pi DIN Rail I/O Interfaces

VP Process Inc has recently released a new series of Raspberry Pi DIN rail mountable “Hardened” interfaces. The first release is the PI-SPI-DIN-RTC-RS485, which is available in three mounting versions: DIN Rail Clips, DIN Rail Enclosure, and PCB Spacers.

The basic specifications for the PI-SPI-DIN-RTC-RS485 are:

  • Power Input: 9 to 24 VDC
  • 5VDC @ 2.5A (Max 3Amp) Power Supply
  • RS485 Output via RJ45 connector and Terminal Block
  • 2 GPIO connectors – 1 internal for Raspberry Pi, 1 external for peripherals
  • 1 PI-SPI-DIN connector (16 Pin) for PI-SPI-DIN series (power, SPI, I2C and 5 Chip Enables)
  • Real Time Clock (I2C) Microchip MCP7940 with Battery Backup

Last week, VP Process added three modules to the series: PI-SPI-DIN-8AI, PI-SPI-DIN-8DI, and PI-SPI-DIN-4KO. Each module of these has 2 x 16 Pin Ribbon Cable sockets and cables and each connector and cable will carry power, I2C bus, SPI bus and 5 GPIO lines for Chip Select. Additionally, each module is available in the three mounting versions mentioned above. Each module takes power from the ribbon cable as a local input power to  5 VDC switching power supply and 3.3 VDC LDO regulator power supply. At the same time, the main module will maintain the 5VDC to keep the Raspberry Pi safe from interfaces loading.

PCB’s mounted with DIN rail clips

The three modules full specifications

PI-SPI-DIN-8AI : An 8 channel 4-20 mA Input interface based on the 12 Bit Microchip MCP3208 A/D converter. Each input can be re-configured (changing resistors and capacitors) as a VDC input or Thermistor input for temperature applications.

PI-SPI-DIN-8DI : An 8 channel Isolated Digital Inptu interface based on the Microchip MCP23S08 I/O Expander. Since this design has 4 addresses, it allows  4 interfaces to connect together for a total of 32 Inputs, all of 1 chip select. The inputs accept up to 24 VDC or 24 VAC, or switch inputs.

PI-SPI-DIN-4KO ; A 4 channel relay output module. Each relay is rated at 2 AAC and is SPDT. The design is based on the Microchip MCP23S08 I/O Expander. Since this design has 4 addresses, it allows 4 interfaces to connect together for a total of 16 relay outputs.

DIN Rail Enclosures

Fortunately, VP Process had perfectly designed PI-SPI-DIN series to suit many industrial applications by making the designs industrial grade, with adding terminal blocks and enclosures. Furthermore, a new module of the same series is coming soon, PI-SPI-DIN-4AO; a 4 channel analog 4-20mA output module.

Finally, the main module is available for $48, where the remaining modules cost $33 each. More details are available at this page.

Source: WidgetLords Electronics

Installing The Micronucleus Bootloader To An ATtiny Via Arduino

In order to be able to upload Arduino sketches directly to the ATtiny84 over USB without the need to use a programming device, Shawn Hymel, an electrical engineer at Sparkfun Electronics, had published a guide showing how to install the micronucleus bootloader, which supports virtual USB (V-USB), onto an ATtiny84 using Arduino.

The Atmel AVR ATtiny84 is a $3 tiny 8-bit processor with 8K of program space, 12 I/O lines, and 8-channel 10 bit ADC. It will run up to 20MHz with an external crystal and can be programmed in circuit.

To start following the tutorial, you will need these parts:

Micronucleus is a bootloader designed for AVR ATtiny microcontrollers with a minimal usb interface, cross platform libusb-based program upload tool, and a strong emphasis on bootloader compactness. It has a built in V-USB so that you can send compiled firmware over a virtual USB connection.

The process will use an Arduino as a programmer by loading an Arduino ISP to install the micronucleus bootloader on the ATtiny84. The next step is allowing USB programming on ATtiny84 by manually change fuses, then creating a board definition for ATtiny84 and installing any necessary USB drivers.

The hardware components should be connected as shown in the above circuit. At first you have to remove the capacitor and connect a FTDI breakout to the Arduino Pro Mini and upload the Arduino ISP firmware.

Before installing Micronucleus, a 10μF capacitor is added between the RESET and GND pins of the Arduino. It will prevent the Arduino from entering bootloader mode so that it will pass the compiled firmware to the connected ATtiny rather than trying to program itself.

AVRDUDE is used then to change the ATtiny fuses and set them as the following:

  • No clock divider
  • Brown-out detection at 2.7V (not necessary, but useful if running off battery)
  • Self-programming

This tutorial should also work with ATtiny85, ATtiny841, and ATtiny167. You can find the detailed steps with a blink example on the main tutorial page.

Basics of most common communication protocols

circuitbasics.com has published a series of tutorials on the most popular communication protocols, like UART, I2C, SPI etc. Check them on the links below.

The New Fujitsu ReRam

Resistive random-access memory (RRAM or ReRAM) is a type of non-volatile (NV) random-access (RAM) computer memory that works by changing the resistance across a dielectric solid-state material often referred to as a memristor.

Fujitsu Semiconductor has just launched world’s largest density 4 Mbit ReRAM product for mass production: MB85AS4MT. Partnering with Panasonic Semiconductor Solutions, this chip came to life.

The MB85AS4MT is an SPI-interface ReRAM product that operates with a wide range of power supply voltage, from 1.65V to 3.6V. It features an extremely small average current in read operations of 0.2mA at a maximum operating frequency of 5MHz.

It is optimal for battery operated wearable devices and medical devices such as hearing aids, which require high density, low power consumption electronic components.

20161029154434_mb85as4mt

Main Specifications
  • Memory Density (configuration): 4 Mbit (512K words x 8 bits)
  • Interface: Serial peripheral interface (SPI)
  • Operating power supply voltage: 1.65V – 3.6V
  • Low power consumption:
    • Read operating current: 0.2mA (at 5MHz)
    • Write operating current: 1.3mA (during write cycle time)
    • Standby current: 10µA
    • Sleep current: 2µA
  • Guaranteed write cycles: 1.2 million cycles
  • Guaranteed read cycles: Unlimited
  • Write cycle time (256 byte page): 16ms (with 100% data inversion)
  • Data retention: 10 years (up to 85°C)
  • Package: 209 mil 8-pin SOP

This figure shows the block diagram of the chip:

reram

MB85AS4MT is suitable for lots of applications like medical devices, and IoT devices such as meters and sensors. In addition, the chip has the industry’s lowest power consumption for read operations in non-volatile memory.

For more information about MB85AS4MT, you can check the datasheet and the official website.

Build Your Own I2C Sensor

Since Raspberry Pi doesn’t have a built-in ADC (Analog to Digital converter) to read the voltage off from most of sensors, the best solution is to add I2C ADC chips and modules to your project.

Paweł Spychalski faced this problem while building his own weather station that is based on Raspberry Pi. It collects various data and displays them on dedicated web page and Android app. Every few months he tries to add a new sensor to it. Last time it was a daylight sensor. He added this sensor to his system by using ATtiny85 and it was connected via I2C bus.

ATtiny85 is a member of Atmel tinyAVR series which has 8-bit core and fewer features, fewer I/O pins, and less memory than other AVR series.

The Inter-integrated Circuit (I2C) Protocol is a protocol intended to allow multiple “slave” digital integrated circuits (“chips”) to communicate with one or more “master” chips. Like the Serial Peripheral Interface (SPI), it is only intended for short distance communications within a single device. Like Asynchronous Serial Interfaces (such as RS-232 or UARTs), it only requires two signal wires to exchange information.

I2C uses only two bidirectional open-drain lines, Serial Data Line (SDA) and Serial Clock Line (SCL), pulled up with resistors. Typical voltages used are +5 V or +3.3 V although systems with other voltages are permitted.

425px-i2c-svg
Sample Inter-Integrated Circuit (I²C) schematic with one master (a microcontroller) and three slave nodes

Most of developers use I2C to connect to sensors with the help of the Arduino “Wire” library or “i2c-tools” on the Pi, but it is rare to see someone that is actually building the I2C slave device. Paweł’s project uses TinyWireS library, a slave-mode SPI and I2C library for AVR ATtiny Arduino projects.

This diagram shows how to build analog to digital converter using ATtiny85 and connect it to any device (Raspberry Pi, Arduino) using I2C bus. Here photoresistor has been used, but any analog meter will be fine: temperature, potentiometer, moisture…

ATtiny85 directly connected to Raspberry Pi via I2C, photoresistor with 10kOhm pull down connected to ATtiny85 and signal LED.

attiny_photoresistor_i2c
ATtiny85 directly connected to Raspberry Pi via I2C, photoresistor with 10kOhm pull down connected to ATtiny85 and signal LED.

For reading data you can use this code. ATtiny sends current measurement as two 8 bit value. First older bits, then younger 8 bits.

Wire.requestFrom(0x13, 2);    // request 2 bytes from slave device #0x13

int i =0;
unsigned int readout = 0;

while (Wire.available()) { // slave may send less than requested
 byte c = Wire.read(); // receive a byte as character

 if (i == 0) {
  readout = c;
 } else {
  readout = readout << 8;
  readout = readout + c;
 }

 i++;
}

Serial.print(readout);

To do this project you need to use Arduino IDE 1.6.6., TinyWireS library,ATtiny45/85 board, plus an 1MHz internal oscillator.

Watchdog timer interrupts ATtiny every few minutes, measures voltage, filters it and stores in memory. Every time read operation is requested, last filtered ADC value (10 bits as 2 bytes). I2C support is provided by TinyWireS library that configures ATtiny USI (Universal Serial Interface) as I2C slave.

/**
* This function is executed when there is a request to read sensor
* To get data, 2 reads of 8 bits are required
* First requests send 8 older bits of 16bit unsigned int
* Second request send 8 lower bytes
* Measurement is executed when request for first batch of data is requested
*/
void requestEvent() {
 TinyWireS.send(i2c_regs[reg_position]);

 reg_position++;
 if (reg_position >= reg_size) {
  reg_position = 0;
 }
}

/*
* Setup I2C
*/
TinyWireS.begin(I2C_SLAVE_ADDRESS);
TinyWireS.onRequest(requestEvent); //Set I2C read event handler

 

Bright by day, dark by night
Bright by day, dark by night

This cool weather station and its need of daylight sensor is only an example. The amazing thing is that you can now build new I2C sensors and introduce new modules to your projects easily following Paweł’s steps.

For more details about this project you can check Github and the weather station website.

Introduction to I²C and SPI protocols

figure1

byteparadigm.com has a nice introductory article on I2C and SPI protocols:

Today, at the low end of the communication protocols, we find I²C (for ‘Inter-Integrated Circuit’, protocol) and SPI (for ‘Serial Peripheral Interface’). Both protocols are well-suited for communications between integrated circuits, for slow communication with on-board peripherals. At the roots of these two popular protocols we find two major companies – Philips for I²C and Motorola for SPI – and two different histories about why, when and how the protocols were created.

Introduction to I²C and SPI protocols – [Link]

Tiny Lisp Computer using ATmega328

tinylispcomputer

The Tiny Lisp Computer is a self-contained computer programmed in Lisp. Some programming examples are included in the author’s website.

This article describes a self-contained computer with its own display and keyboard, based on an ATmega328, that you can program in Lisp. You can use it to run programs that interface to components such as LEDs and push-buttons via the I/O pins, read the analogue inputs, and operate external devices via the I2C and SPI interfaces. It has a small monochrome OLED display that gives 8 lines of 21 characters per line, and a miniature PS/2 keyboard

Tiny Lisp Computer using ATmega328 – [Link]

7 Segment LED Based SPI Display using 74HC595

7-segment-led-based-spi-display-using-74hc595-photo

Single Digit Big Display module using 74HC595 IC project will display large size 7 segment single digit number. 3.5inch height, which can be visible over large distance.  More digit can be connected serially to each other easily connector.

This circuit is a single digit seven segment big display using a set of 5 LEDs per segment and a shift register for easy control by micro-controller input. Each of the LEDs used in this project are 5mm high glow type.

Specifications

  • A ULN2003 IC helps sink higher current flowing through the LEDs to ground.
  • Resistor R1 to R8 are current limiting Resistors for the LEDs connected in series.
  • CN1 Connector is Data In connector
  • CN2 Connector is optional Data Out Connector if you need to stack more than 1 single display board in series
  • +V CN1 & CN2 should be connected to higher voltage to drive the LEDs
  • VCC Should be connected to 5V DC. This supply can be source from host controller
  • Each Segment made up of 5LEDs

7 Segment LED Based SPI Display using 74HC595 – [Link]