element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
Experimenting with Current Sense Amplifiers
  • Challenges & Projects
  • Design Challenges
  • Experimenting with Current Sense Amplifiers
  • More
  • Cancel
Experimenting with Current Sense Amplifiers
Challenge Blog Blog #3: MIKROE board assembly and configuration
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: colporteur
  • Date Created: 13 Apr 2022 8:32 PM Date Created
  • Views 1059 views
  • Likes 6 likes
  • Comments 3 comments
  • raspberry pi
  • current sense amplifier
  • MAX40080
Related
Recommended

Blog #3: MIKROE board assembly and configuration

colporteur
colporteur
13 Apr 2022

Three blog posts in one day, what gives? We are currently in the grips of a snow storm that has closed roads and businesses. I have the time so why not blog with it.

This post is designed to provide some details around physically assembling the two MIKROE boards and Raspberry Pi and the configuration needed to have the Pi detect the boards. I found little to no information on how to accomplish this. Knowing that if you let the magic smoke out of electronics it doesn't work anymore, I created this post in the hope you can avoid that.

I acknowledge misza contributions and especially his second blog post,  Blog #2: Introduction to MAX40080 as the major contributing factor to me getting this far.

I am extremely disappointed by not surprised in the lack basic support documentation that I have found so far. The details in misza second blog post contributed to me getting this working.

  • For my assembly I have three printed circuit boards.
    MIKROE Current 6 click (C6C)
    MIKROE Pi 3 click shield (P3CS)
    Raspberry Pi 3B (Pi3B)

image

The C6C plug into socket 1 or 2 on the P3CS board. There is no keying on the board to ensure the boards are connected correctly. Just make sure the terminal strip end of the C6C board aligns with the header pins of the P3CS board as shown in the drawing.

The P3CS is a board that fits on top of the Raspberry Pi single board computer. I found this youtube video that demonstrates the process nicely. https://www.youtube.com/watch?v=sDxZRZGz9E4

If you don't use the stand-offs in the assembly, I strongly encourage you to place a non-conductive material in between the board sandwich. I have had shield board touch components on the Pi releasing the magic smoke. In my setup I stuffed the Pi instruction sheet to make the sandwich. It is alway nice to keep things loose in development because things change and removing screws is such a pain.

The assumption is that you are familiar with loading an Raspberry Pi OS on the Raspberry Pi. If not head on over to this link . https://www.raspberrypi.com/documentation/computers/getting-started.html

for the consumables.

With a SD card installed and the Pi/Click sandwich assembled apply power to the Raspberry Pi.

The click assembly uses i2C bus for communication. This needs to be enabled in the Pi operating system. Start the Raspberry Pi configuration tool to make this change.

sudo raspi-config

Use the arrow keys to navigate to the required menu option.

3 Interface Options> I5 I2C Enabled/disabled automatic loading of I2C kernel module> <Yes>.

image

I recommend a reboot. Some options will take immediately and others do require the reboot. I just reboot after config changes to be sure.

As the operating system has matured some software is included by default and others still have to be added. I’m never quit sure so I run the command and if the software is there, then no fault found. From the Pi terminal install the following software tools.

sudo apt install python3-smbus i2c-tools


The i2c-tools suite will provide details about what devices are available.


From the command line on the Pi use either
sudo i2cdetect -y 1
or
sudo i2cdetect -y 0

and you should get an output.

image

The screen shot is the command output with no devices detected. What gives everything is assembled and connected?

As misza pointed out in his blog post, the Current 6 Click board has a EN (enable) pin that helps determine the i2C address for the board. On the shield board it is labeld CS. I recall this being chip select from my legacy careers. The pin is controlled via a Raspberry Pi GPIO pin. For a C6C board in slot 1 of the Pi3CS board it is gpio 8 and in slot 2 it is gpio7.

The enable needs to be established on boot. A common method to configure a gpio on boot and have them permanent is to make changes to the /boot/config.txt

I found an explanation at this link to carry you through the weeds.
https://forums.raspberrypi.com/viewtopic.php?f=117&t=208748

If you just want the details. Add the following entry to the bottom of the config.txt file


[all]
#Set GPIO8 to be output set to 1
gpio=8=op,dh

If your C6C board is in slot 2 change the 8 to a 7.

After saving the changes reboot.

Now the output from the i2c-tools detect should show an device.

sudo i2cdetect -y 1

image

I observed some strange behaviour with the click board that I have not seen with other i2C type boards.

If you enable a gpio and use i2ctools to detect the board, then remove the gpio enable and reboot, the i2c-tools output slows to a craw, where as before the output appeared almost instantly. Only after you remove the C6C board does the i2ctool return to normal. It seems once the board is enabled it loads down the i2C bus even after the enable is removed.

I have little knowledge to know what is happening other than I notice the i2ctools not performing and wanted to see if it was something I was doing to cause it to happen.

This completes my process to assemble and configure the MIKROE boards so that it can be detected. I hope it helped. Now to figure out how to read the sensor board, that is something else entirely different.

  • Sign in to reply
Parents
  • misaz
    misaz over 3 years ago

    Strange behaviour on I2C bus and slow response from i2ctools is caused by missing pullup resistors. Raspberry Pi has no onboard I2C pullups, so when you disconnected click board, bus became unrealible. Without resistors bus is not pulled high and has no determinisitic voltage until is driven by I2C controller which makes deterministic logical 0 on it. After driver release it, ti became unreliable again (it can stuck at zero or due to external induction can goes to up or down randomly). In this case I2C controller detect random (often invalid) operations on bus and randomly stucks in deadlocks which cause slowing i2ctool utilities. This is also cause of detecting random non-existing devices and so on.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • colporteur
    colporteur over 3 years ago in reply to misaz

    Awesome man! You knowledge level knows no bounds.

    I seem to recall there are pull-ups that can be enabled in gpiozero or RPi-gpio. I'm not sure if they could be configured in the config.txt? The reference suggests it. I'm going to give it a try. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • colporteur
    colporteur over 3 years ago in reply to colporteur

    It took a second thought. Pull ups controls are on inputs not outputs.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • colporteur
    colporteur over 3 years ago in reply to colporteur

    It took a second thought. Pull ups controls are on inputs not outputs.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
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