3

I just purchased an ARPI600 expansion board for my raspberry pi 3b. I wanted this board because it acts as an i/o expansion and allows the rpi to control arduino shields. I have seen this card recommended by many people which is why I was incredibly surprised to see that the documentation for it is ridiculously underwhelming.

It gives information about how to setup the serial debugging function without telling you what it is pretty why you would want it. It tells you how to control the ARPI600 with the pi but does not give you any direction as to what or why. There is little to no documentation on the various pins and jumpers implemented. Most of all I am confused about how to provide power to the ARPI600. I am under the impression it receives a 5v current from another source as the pi can only provide a 3v. But as usual there is no documentation to suggest otherwise or confirm my suspicion. So now I have it all hooked up to the rpi but I am afraid to turn it on for fear of shorting it out or something.

I know that based on the popularity of the product someone has an idea of what their doing but no one with the knowledge has posted anything online. If there is anyone with experience configuring the ARPI600 please let me know. If you just search ARPI600 on Google and you will find the operators manual and see what I mean about the documentation.

Christopher
  • 45
  • 1
  • 4

3 Answers3

1

I newly (August 2023) bought an ARPI600 together with a sensor bundle essentially because I also wanted to use the ADC on that board controlled by a Raspberry Pi 4B. I am also a noob so some of my comments might be wrong. At least I got the ADC to work with a potentiometer. I have not tested the other sensors yet.

First there is definitely some cool stuff you can do with the ARPI600. Here is a scientific article about research done with the ARPI600 and here is an openly accessible version.

It seems that the manual (pdf) resp. its online version have not been thoroughly updated in a long time. E.g. the manual recommends to install wiringPi which is discontinued since 2019. It tells you to

sudo apt-get install python-pip 

however python-pip was replaced by python3-pip some time ago. Also the program library at https://www.waveshare.com/wiki/File:ARPI600_.7z seems to have changed compared to the version in the manual. It contains code for python which is good, but the instructions in the manual don't reflect that much. I think it's good that they keep their code library up to date. But one has to be aware that the manual probably refers to an old version. So one has to adapt the instructions in the manual.

All together I suggest to treat the instructions in the manual as loose guide lines and adjust them as seems reasonable, until things start to work. Here's the setup.

Login to your Pi such that you have a terminal (shell) open. Make sure that your system is up to date.

sudo apt-get update
sudo apt-get upgrade

Via

sudo raspi-config 

configure access to the protocols you need: I2C, SPI, Uart (Serial). In contrast to the manual as of Aug 2023 the items in the menu are not in item 5 but in 3.

3 Interface Options -> I4 SPI
3 Interface Options -> I5 I2C
3 Interface Options -> I6 Serial Port (shell login - no, serial port hardware - yes) 

Installing the BCM2835 libraries works as in the manual

wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz
tar zxvf bcm2835-1.71.tar.gz 
cd bcm2835-1.71/
sudo ./configure && sudo make && sudo make check && sudo make install
cd 

Since the WiringPi libraries are deprecated only the second suggestions works which provide some legacy support.

git clone https://github.com/WiringPi/WiringPi
cd WiringPi
. /build
cd 
gpio -v
gpio readall

Alternatively one can get information on GPIO with the preinstalled tools, which are a bit cumbersome (e.g. "raspi-gpio get" will show you information on BANK1 and BANK2 which are not accessible to the user, but controll other parts of the Pi. For Bank0, which is part of the 40 GPIO pins available to the user, they are just listed in GPIO number order which is completely different from the physical layout).

pinout
raspi-gpio get

You can also install pigpio as a replacement or in parallel to wiringPi.

sudo apt-get install pigpio python-pigpio python3-pigpio

See http://abyz.me.uk/rpi/pigpio/index.html for details. I would not recommend to install the piscope extension as it relays on gtk+-3.0 which on installation tries to install some deprecated nvidia drivers which in turn result in half installed zombie nvidia packages - at least in all the attempts I made.

Then you should install some python libraries. Compared to the manual, python-pip needs to be replaced by python3-pip and python-smbus and python-serial seem to be no longer supported (and needed?). The pip packages RPi.GPIO and spidev are also unnecessary as their dependencies are already satisfied by /usr/lib/python3/dist-packages

sudo apt-get install ttf-wqy-zenhei 
sudo apt-get install python3-pip 
sudo pip install rpi_ws281x

Next you should download the provided demo programs. You have to slightly adjust the commands compared to the manual. Going to the original provided website https://www.waveshare.com/wiki/File:ARPI600_.7z reveals how you have to adjust the url for the wget command.

sudo apt-get install p7zip
wget https://www.waveshare.com/w/upload/4/44/ARPI600_.7z
7zr x ARPI600_.7z -r -o./ARPI600
sudo chmod 777 -R ARPI600

Strangely the unpacked folder will look like ARPI600/ARPI600/ but it is, what it is.

At this point you are ready to actually use the ADC. I used a very simple setup from an Arduino tutorial to get the voltage on a potentiometer. Since the Arduino pins used in the tutorial are represented on the ARPI600 the wiring is straight forward. Make sure that the jumpers are set correctly as in the manual (reference voltage to 5V, analog inputs A0-A5 to T_A0-T_A5 the later belonging to the inputs for the ADC).

Keep the original files and copy the code for the ADC chip TLC1543 into a testing folder, then you have to adjust the sample code.

mkdir ADCtest
cd ADCtest
cp -r ~/ARPI600/ARPI600/RaspberryPi/program/TLC1543 .
cd TLC1543/python/
nano tlc1543.py

Enter an additional delay at the end of the try block in the fifth to last line and replace line 13 "CHANNEL = 6 # selector channel" by

CHANNEL = 0 # selector channel
...
                time.sleep(1)

or whatever is the correct input pin for the analog voltage. If your setup is the same as in the Arduino tutorial it's 0. Now execute and get some output depending on the setting of the potentiometer.

python3 tlc1543.py

Busy or Not give a Voltage at Pin T_A0 Busy or Not give a Voltage at Pin T_A0 AD: 284 AD: 337 AD: 337 AD: 374 Busy or Not give a Voltage at Pin T_A0 Busy or Not give a Voltage at Pin T_A0 Busy or Not give a Voltage at Pin T_A0 Busy or Not give a Voltage at Pin T_A0 Busy or Not give a Voltage at Pin T_A0 Busy or Not give a Voltage at Pin T_A0 Busy or Not give a Voltage at Pin T_A0 AD: 332 AD: 319 AD: 0 AD: 0 AD: 0 AD: 131 AD: 176 AD: 175 AD: 176 AD: 259 AD: 275 AD: 352 AD: 445 AD: 465 AD: 465 AD: 500 AD: 354 AD: 355

In particular at the beginning and when the voltage is at higher levels you get some error messages. The output is raw data from the ADC which has a scale from 0 to 2^(10)-1=1023 and subdivides the reference voltage (5V in my case) into 1023 steps. So an AD output of 355 corresponds to 355/1023*5V ~ 1.735V. When I tested the same poti setting with a voltmeter I got 1.80V. So I guess that's OK.

Thomas Preu
  • 121
  • 6
1

There is an 18 page user manual I presume you are aware of since you mention finding it w/ google. There's also the wiki page (which seems to be a partial copy of the manual).

After glancing through that stuff, I have to strongly disagree that "there is little to no documentation on the various pins and jumpers", although it may be confusing to a neophyte. Which is fine, and it is also fine to ask for clarification about specific things here, preferably by referring to that publicly available information explicitly, and providing a context in terms of something you would like to do or understand. For example:

I am confused about how to provide power to the ARPI600. I am under the impression it receives a 5v current from another source as the pi can only provide a 3v.

The shield has a 40 pin connector, labelled "5. Raspberry Pi connector : for connecting Raspberry Pi" on page 2 of the manual. This should fit directly over the 40 pins of any appropriate model pi. The 26-pin models may or may not work; obviously they may lack some functionality if they do. If you have a 26-pin model, I think it will be safe enough to try since the pins overlap exactly in terms of purpose -- align the connector at the end, where the 5V and 3.3V pins are.

There are probably hundreds of diagrams of the Pi breakout around, so I will not explain that much further here. However, you will notice the first few pins (counting from the corner) include connections to both the 3.3V and the 5V rails (i.e, yes the Pi can power 5V devices). That's where the sheild gets power. Note the logic level of the Pi's GPIO pins is 3.3V, but not all of those 40 pins are GPIOs. "Pin" != "GPIO". Most of them are, but some are power and ground connectors. Again, there are many diagrams and explanations of this around.

It is also possible the sheild could draw power from the USB serial connector, like an Arduino does, although I'm guessing it probably doesn't. In any case, that is for connecting to a PC; PuTTY is an MS Windows based serial console app.

However, the manual is clear that you should have it connected to the Pi and the Pi powered on before you connect any USB serial cable.

Pi 3 Note

There may be a bit of an issue with this device on a Pi 3 since while all the pins are supposed to be the same, the default configuration kind of screws up the UART connection. It will probably be okay, although you may have to take into account the different device node name at some point. It should not cause any harm, in any case.

goldilocks
  • 58,859
  • 17
  • 112
  • 227
  • Thank you for your help, I'll be more specific. The 3.3v and 5v rails, are they the only control point for the voltage? Or are they just the ARPI600 side of the voltage control? What I mean is there also setting that has to be edited on the raspberry pi or is just setting the correct jumper all that needs to be done? – Christopher Jul 01 '16 at 04:48
  • Neither. The power pins are not controllable, that's one thing that distinguishes them from GPIO ("general purpose input output) pins. A "rail" is a circuit that delivers a specific voltage and current regulated supply of electricity. That the 5 and 3.3V pins are connected directly to the corresponding rails means that whenever the pi is plugged in (there doesn't even have to be an OS running) those pins are like wall sockets -- they are always live (there are also corresponding 0V ground pins). – goldilocks Jul 01 '16 at 10:56
  • This may be a bit confusing because the GPIOs use 3.3V logic, meaning they can emit and receive digital signals by using or interpreting voltage within a specified range -- e.g., 0V would obviously count as "low", but so does 1V, and 2.5 and 3.3V both count as "high". That's the basis of digital electronics. A signal is a sequence of on (low) and off (high) levels -- hence binary "logic". The GPIOs are for sending and receiving binary logic signals and if you set one as an output on high it will deliver a very modest 3.3V current (~25 mA, as in enough for one LED). – goldilocks Jul 01 '16 at 10:57
  • That's not enough to power the shield; the rails can deliver much more current, perhaps 500+ mA on the 3.3V and 1000+ mA on the 5V (but note the 5V also powers the USB, while the 3.3V powers things like the SoC itself and thus supplies all the GPIOs). So the pins you see marked as 3.3V (usually orange), 5V (red), ground (black) cannot be controlled -- again they are like wall sockets. If the pi is powered (properly) they are powered too. – goldilocks Jul 01 '16 at 10:57
  • So if you insert that shield properly onto the pi (should be easy, but be gentle, especially when wiggling it off) with the pi unplugged, then turn the pi on, the shield is on too. The driver that's mentioned in the docs (cp2102) is I think a Windows driver, i.e., it is needed on the PC if you want to connect that to the shield's USB port. – goldilocks Jul 01 '16 at 10:57
  • Beware when using the pins: Do not connect a 5V directly to any other pin. Do not connect a power pin (3.3 or 5V) directly to a ground. Do not set a GPIO as an output and connect it directly to ground (this is part of the reason by default, they all start as inputs, except the I2C pins and UART TX). You can do some of these things with resistors -- the point is always make sure you are following and understanding some instructions until you have absorbed the way it all works. – goldilocks Jul 01 '16 at 11:06
  • That is a great explanation. I was unaware that they were a wall socket type of interface. I thought that all of the gpio pins could individually be configured for specific tasks and the fact that they are all live constantly makes a lot of sense. So the 3.3v x ref rail and the 5v x ref rail are both active and whichever one is being jumped will dictate the power level for the components on the ARPI600 and the shield attached to it as well. – Christopher Jul 01 '16 at 20:14
  • That's what I meant by "Pin != GPIO", which I am sure confuses many people at first since the pin breakout is often just called, colloquially, "the GPIOs" -- but while most of the pins are GPIOs, some of them (very importantly!) are not. Also beware that related to this there is a "pin numbering" scheme counting from the top left to right, such that pin #1 would be a (non-GPIO) 3.3V rail pin, and #2 a (non-GPIO) 5V rail pin -- but when you see GPIO's referred to by number, the more common scheme is not the same! E.g, pin #3 is GPIO 2 (aka the I2C SDA line) and pin #7 is GPIO 4, etc... – goldilocks Jul 01 '16 at 20:25
0

Hi im just buy this arpi600, and connect them into the cnc shield but i dont want to use uart or anything just pin, and im realized that there is some code under the arduino slot that im translate into this : P0 = D2 X Step P1 = D3 Y Step P2 = D4 Z Step

P3 = D5 X Dir P4 = D6 Y Dir P5 = D7 Z Dir

but im not sure why still doesnt work, is this arpi600 should connect on serial or uart ? Or i can just write code to call them on python ? This is my python code for cnc shield only for x : (but it still didnt work)

from time import sleep

import RPi.GPIO as GPIO

DIR = 3 # Direction GPIO Pin STEP = 0 # Step GPIO Pin CW = 1 # Clockwise Rotation CCW = 0 # Counterclockwise Rotation SPR = 48 # Steps per Revolution (360 / 7.5)

GPIO.setmode(GPIO.BCM) GPIO.setup(DIR, GPIO.OUT) GPIO.setup(STEP, GPIO.OUT) GPIO.output(DIR, CW)

step_count = SPR delay = .0208

for x in range(step_count): GPIO.output(STEP, GPIO.HIGH) sleep(delay) GPIO.output(STEP, GPIO.LOW) sleep(delay)

sleep(.5) GPIO.output(DIR, CCW) for x in range(step_count): GPIO.output(STEP, GPIO.HIGH) sleep(delay) GPIO.output(STEP, GPIO.LOW) sleep(delay)

GPIO.cleanup()