A quick tutorial to using MiniPiio AIN4 4-ch Analog Board

March 28, 2014

The latest version of raspi-config allows you to enable the SPI drivers without having to edit raspi-blacklist.conf file yourself.

In LXTerminal start raspi-config by type:

raspi-config

Select the advance menu option and chose enable SPI devices. Exit the menu and reboot your Pi.

We’ll program our example in Python, so we’ll start by downloading the SPIdev driver library.

We can use Python Installer to get install it:

sudo pip install spidev

A quick python example is shown below:

#!/usr/bin/python

import spidev
import time

# ADC Channel
ADCCHAN = 1

# Open SPI, use Chip Select 0
spi = spidev.SpiDev()
spi.open(0,0)

while True:

    adc = spi.xfer2([1,(8+ADCCHAN)<<4,0])
    data = ((adc[1]&3) << 8) + adc[2]

    print ('ADC CH1 =', data)

The MiniPIIO Uses a Microchip MCP3004 (or MCP3204) which are from the same ADC familily as the MCP3008

You can find the MiniPIIO AIN4 at our Tindie store:

MiniPiio_Expander2_DIO16_AIN4_small

 

Advertisements

Accessorize your Pi for £10

July 7, 2012

Much has been said about how the cheap (as in low cost) the Raspberry Pi is, but I wanted to find out how cheap I could buy all the peripherals for.

SD-Card 2G/4G £3.00 staples/play.com/ebay
HDMI lead £1.00 poundland/poundworld/ebay
mouse (USB £1.00 poundland/poundworld/ebay
keyboard (USB) £3.00 ebay/asda
Power Supply (5V USB) £1.00 poundland/poundworld/ebay
micro USB cable £1.00 poundland/poundworld/ebay

Cost of Accessories = £10.00

raspberry pi ~£22.00 from RS or Farnell

Interesting, I was able to get most of the things from my local poundland and poundworld. I had to visit both of them as neither had every thing I needed. In fact, when I went back a few days later to pick up a couple more of the £1 mice, only to find they were sold out 😦

Next on my list where the keyboard and SD-Card. I found my local Staples were selling off their surplus of a branded 4G card so I pickup up a couple of £2.99. A couple of weeks later, play.com were having a sale so I picked up a 16G for £5.99. Buying a cheap keyboard in the shops proved to be the most difficult thing to find. In the end, a quick search of ebay got me a cheap one for £3.00.

As it happens I saved the cost of Power Supply and micro USB lead by using an old mobile phone supply and micro USB but you could still pick them up for £1 each at your local pound stores.

So there you have it you too can Accessorize your Pi for £10


New website: www.dtronixs.com

April 4, 2012

Exciting news, well for me anyway. I was getting frustrated not been able to store my project design files on this blog so I’ve started a new website:

www.dtronixs.com

It’s still early days but I’m planning on putting all my project design files there and perhaps a wiki as well to support them better.


PCB Tutorials

April 7, 2009

After a couple of years away from doing my own PCB designs the number of great open source electronics projects out there such as the Uzebox and Arduino projects have inspired me to start building my own boards again. So whilst refreshing my PCB skills I found a couple of articles that might interest others:

David Jones has a nice PCB design overview and tutorial which is here. and another more technical article (pdf) on split ground planes can be found at here.

EasyPC from NumberOne Systems was and still is my PCB design package of choice but the Eagle PCB design package from Cadsoft looks to be many peoples favourite package – especially the free (but limited) package. So here are a couple of tutorials for Eagle as well:

Instructables Cadsoft Tutorial
Sparkfun Tutorial