element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Blog Monitoring 16 analogue inputs with the Raspberry Pi
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
GPIO Pinout
Raspberry Pi Wishlist
Comparison Chart
Quiz
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: mistertee
  • Date Created: 7 Jul 2015 8:52 AM Date Created
  • Views 573 views
  • Likes 1 like
  • Comments 0 comments
Related
Recommended
  • raspberry
  • pi
  • analogue
  • adc
  • inputs

Monitoring 16 analogue inputs with the Raspberry Pi

mistertee
mistertee
7 Jul 2015

The Custard Pi 3 plugs into the Raspberry Pi GPIO (A, B, B+ and 2) and provides 8 analogue inputs using the SPI bus. This post shows how you can connect 2 x Custard Pi 3 to a Raspberry Pi and get 16 inputs. (There is soldering required).


The Custard Pi 3 uses the SPI bus. The connections are shown below.


image


J1-24 is the chip enable (CE0) output from the GPIO which is used to address the AtoD chip - MCP3208. The other pins are

 

J1_19:  MOSI - data out from the GPIO (input to MCP3208)

J1_21: MISO - data into the GPIO  (output from MCP3208)

J1_23: SCLK - used to clock data in and out.


The GPIO has a second chip enable (CE1) provided on pin J1_26. On the second Custard Pi 3 board, cut the connection from pin 10 of the IC (U1) to pin 24 of J1 and connect pin 10 of IC (U1) to pin 26 of J1 instead.

 

The 2 Custard Pi 3 baords can be stacked on top of each other as they both have stackable GPIO connectors.


image


Now all one has to do is to modify the Python code to address the second Custard Pi 3 board which has been modified to be eneabled from CE1 (Pin 26 of J1).

 

In the downloads tab of the SF Innovations website (http://www.sf-innovations.co.uk/downloads.html) the mods required to "Function for reading analogue inputs (Projects 11,& 14)" are shown below.

 

1.  In section below change 2nd line to " GPIO.setup(26, GPIO.OUT) #pin 26 is chip enable"

 

GPIO.setmode(GPIO.BOARD)

GPIO.setup(24, GPIO.OUT) #pin 24 is chip enable

GPIO.setup(23, GPIO.OUT) #pin 23 is clock


2. In section below change 2nd line to "GPIO.output(26, True)"


#set pins to default state

GPIO.output(24, True)

GPIO.output(23, False)

GPIO.output(19, True)


3. In section below change first line to "GPIO.output(26, False) #enable chip"


GPIO.output(24, False) #enable chip

anip=0 #clear variable


4. In section below change 2nd line to "GPIO.output(26, True) #disable chip"


#print (bit,value,anip)

GPIO.output(24, True) #disable chip


5. Now save this file with a different name.


6. Call the original file for a reading from the unmodified Custard Pi 3 and call the modified file for a reading from the modified Custard Pi 3.


Summary


This is a method for connecting 2 Custard Pi 3's to the Raspberry Pi to get 16 analogue inputs.

 

 

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube