Home Hardware Look at the RasPiO Analog Zero

Look at the RasPiO Analog Zero

by shedboy71

The RasPiO Analog Zero is an add on ‘hat’  that can be used with any 40 pin Raspberry Pi. This board adds analog input capability to your Raspberry Pi.

About the hat

The main part of the RasPiO Analog Zero is an MCP3008 8 analog to digital converter. This board allows you add various sensors and devices that you could not normally use such as LDRs, potentiometers, voltages and many sensors that output their value as an analog value

Here is a picture of the board after it has been assembled.

raspio-analog-zero

The MCP3008 analog to digital converter chip is connected to the SPI ports MOSI, MISO, SCLK and CE of your Raspberry PI , you can see that all other pins are made available via an unpopulated single row header nad if you wanted you can easily add a header to this.
There is also a small prototyping area with 5v, 3v3 and GND where you can add extra components
The lack of analog input / output has always been a bug bear of mine with regards the Raspberry Pi, this low cost board (£11 in the UK) will add on analog input capability

Code

Save this with a python .py extension

[codesyntax lang=”python”]

from gpiozero import MCP3008
from time import sleep

while True:
    for x in range(0, 8):
        with MCP3008(channel=x) as reading:
            print(x,": ", reading.value)
sleep(0.1)

[/codesyntax]

 

If you want to display a voltage of a channel you would do something like this, again save this example with a .py extension

[codesyntax lang=”python”]

from gpiozero import MCP3008 
adc = MCP3008(channel=0)
voltage = 3.3 * adc.value
print("channel 0 voltage is: ", voltage)

[/codesyntax]

 

Links

RASPIO ANALOG ZERO (Pack of 3)

http://rasp.io/analogzero/

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More