Preparing for à la mode: Raspberry Pi and Arduino

Well, I got my Raspberry Pi, and preparations are well underway to make an Arduino compatible clone that fits right on top.

Anool Mahidaria has completed an initial circuit design, and I’ve gotten some of the software set up. Lots of information out there that helped me figure out what to do, so I thought I’d compile it here in one place.

à la mode will connect via the uart on the GPIO, so we need to figure out how to enable serial communications, and get the Arduino environment installed.

Serial port: An embarrassment of riches?

The Pi’s Broadcom brain has a very rich set of peripherals, unfortunately it was hard for the Pi’s designers to route them all out to a connector. There’s a limited functionality min-uart that is very well supported, and at least in the debian image I’ve tried has drivers.

It doesn’t have hardware handshaking or DTR (needed for auto reset on the Arduino) but is supported at this stage so I think that’s what we’ll go with. There’s also a fully featured UART, and most of it’s compatible pins are brought out to the GPIO connector, but as far as I can tell, it’s not fully supported in the distributions generally available for the Pi.

The GPIO connector is well documented on the Pi’s wiki:

But I found this blog post most helpful: http://lavalink.com/2012/03/raspberry-pi-serial-interfacing/ from which I get this useful illustration.

That’s great, but it turns out that the Serial port is a little too well supported. (Caveat, I’m talking about the recommended Debian Squeeze image) You can log into it as a console! This, of course, prevents you from opening the port in a program (such as Arduino), so we need to disable logins on this port, as well as logging messages that go out. This post explains how to disable both.

I’ll repeat the instructions here, in case the link goes away:

First, disable logging messages:

Edit /boot/cmdline.txt

From:

[code]dwc_otg.lpm_enable=0 rpitestmode=1 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait[/code]

to:

[code]dwc_otg.lpm_enable=0 rpitestmode=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait[/code]

deleting the two parameters involving the serial port /dev/ttyAM0

You also have to edit /etc/innitab to remove the login (getty)

comment out:

[code]2:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100[/code]

then reboot.

Arduino IDE:

The Homelabs raspberry pi blog has good concise instructions for installing the Arduino IDE. The IDE is written in Java (based on Processing) and while Oracle doesn’t have an official Java for the ARM core in the Pi, the Open JDK has been ported. It doesn’t have a JIT (Just In Time Compiler) so it’s a little slower, but it works.

First grab the Arduino IDE code. (you can change the url if you want the latest)

[code]wget http://arduino.googlecode.com/files/arduino-1.0-linux64.tgz
tar zxvf arduino-1.0-linux64.tgz[/code]

The Arduino IDE is written in Java, but there are native parts to do compilation for the atmega328p  microcontroller. Fortunately those have also been ported:

[code]
sudo apt-get install avr-libc
sudo apt-get install libftdi1
sudo apt-get install avrdude

[/code]
Java:

[code]sudo apt-get install openjdk-6-jre[/code]

Serial support:
[code]sudo apt-get install librxtx-java[/code]

And then copy the native stuff into the Arduino directory:

[code]
cd arduino-1.0
for i in $(find . -name “librxtxSerial.so”) ; do cp /usr/lib/jni/librxtxSerial.so $i ; done
for i in $(find . -name “RXTXcomm.jar”) ; do cp /usr/share/java/RXTXcomm.jar $i ; done
cp /usr/bin/avrdude /home/pi/arduino-1.0/hardware/tools/avrdude
cp /etc/avrdude.conf /home/pi/arduino-1.0/hardware/tools/avrdude.conf

[/code]

After this, you can attach an Arduino to one of the USB ports, or (carefully) a 3.3 v clone to the GPIO pins.

More to come!

 

 

Raspbery Pi à la mode ?

Lot’s of people are excited about the Raspberry Pi®, a complete computer for $25 (or $35 with ethernet).
The initial shipment is entirely sold out, and there are 200,000 more on order. Lots of people have been saying that this is the end of the Arduino, as it’s about the same cost, a full linux system with keyboard, mouse, and hdmi video output.

I think this is an oversimplification. Arduino is fantastic at interfacing to the physical world in a way that no linux (or Windows) PC could hope to approach at any cost.

The Pi does have a GPIO connector, but it pales in comparison to the humble Arduino. No built in PWM (servos anyone?) and no Analog to digital conversion.

Why throw the baby out with the bathwater? How about some delicious ice cream with your Raspberry Pi?
As a member of the amazing Open Source Hardare collective Wyolum.com,  I’m working with Justin Shaw and  Anool Mahidharia on “à la mode”: an Arduino clone specifically for the Raspberry Pi (That rendering above is courtesy of our  fabulous  EE  Anool) . You can of course connect an Arduino to a Pi USB port, but when you want a turnkey solution, how about an Arduino compatible “plate” (what the Pi folks call shields) that fits right on top of the Raspberry Pi.

You can plug your existing shields right in,  and you can even run the Arduino IDE on the Pi. Since the Pi’s core mission is to provide equal access to computing to all children, this will also give the kids the opportunity to mix it up “Arduino-style” with real world hardware.

We couldn’t have a vanilla add-on, so we added:

  • A battery backed real time clock: RTC: DS3231 (same as ChronoDot)
  • uSD card for logging
  • Socketed Atmel Atmega 328p in case you make a wiring mistake and need to replace it.

We’re sending off for prototype boards soon, so if you have feedback, let us know! Join the conversation at the Wyolum.com forums.

Raspberry Pi® is a trademark of the Raspberry Pi Foundation.

Arduino Library for Scratch Sensor Board Emulation

I re-wrote the simple sketch as an Arduino Library for Scratch Sensor Board (picoboard) emulation.

You can download it at github

Unzip the contents of this repository into a directory called ScratchSensors in the Arduino libraries directory (or in Sketchbook/libraries)

In your sketch: #include <ScratchSensors.h>

and then: ScratchSensors Scratchboard;

In Setup: Scratchboard.init();

Sensor values are stored in an array internally to the ScratchSensors class called Values[];
The picoboard/Scratch sensor board that is emulated has specific sensor labels that are reported:
#define RESISTA 0
#define RESISTB 1
#define RESISTC 2
#define RESISTD 3
#define SLIDER 4
#define LIGHT 5
#define SOUND 6
#define BUTTON 7

Values should be between 0 and 1023. These are scaled by scratch to be between 0 and 100. BUTTON is handled in a special way: 0 is depressed and 1023 is not pressed. Let’s say you have an analog sensor like an accelerometer connected to Arduino pins A0, A1, and A2. Then during loop():

Scratchboard.Values[RESISTA] = analogRead(A0);
Scratchboard.Values[RESISTB] = analogRead(A1);
Scratchboard.Values[RESISTC] = analogRead(A2);

then, write the packets out to the serial/usb port: Scratchboard.report();

There’s an example in the examples directory based on the Sparkfun midi shield. It has two pots and three buttons. Of course only one of the buttons can be used with the Scratch buttonpressed semantics, but the others can be tested for specific values.

Interfacing Scratch to the Arduino Platform

I’m a big fan of Scratch, the educational programming language created at MIT. International Scratch Day is coming up, and when we went two years ago, we had a blast. Last time, I added a distance sensor to an Arduino, made it emulate a Scratch Sensor Board, and  put it under a trampolene. This year, I decided to document the general process of making your own scratch sensors and bring a compact sensor module for the kids to play with.

At one point during our research at work, we needed a way to measure the movement and relative distance of a camera platform, so I designed, and my tech put together a combination of a Teensy (Arduino Compatible microcontroller), an Adafruit ADXL335 Accelerometer breakout, and a Sharp IR distance sensor.

I dug up my old code for the trampolene hack, which was based on some code I got off the Scratch forums. It didn’t work!

What we are actually doing is emulating what was originally called a “Scratchboard” and now produced by a company called the Playful invention company and called a “PicoBoard”.

There’s a spec (and schematics) at http://info.scratch.mit.edu/sites/infoscratch.media.mit.edu/files/file/ScratchBoard_Tech_InfoR2.pdf

Turns out, the platform used to be more forgiving, and now it expects a report of all the sensors (whether we are using them or not.)

The IR distance Sensor outputs an analog voltage proportional to the distance to the nearest thing in it’s path, and likewise the accelerometer outputs a voltage proportional to the acceleration (including gravity). I mapped the distance sensor to the “slider” sensor, and the X, Y and Z outputs to the Resistance A, B and C sensors.

Here’s a demo video:

[youtube]http://www.youtube.com/watch?v=wVa8QUz5DxI[/youtube]

I’m planning on re-working the interface code into an Arduino Library, and I’ll post that here when I get it done.

In the meantime here’s the Arduino code:

// Scratchboard emulation
// by Kevin Osborn
// http://baldwisdom.com
// Feel free to use this code in any way you wish! (Though if you want to link
// to my blog, that would be cool)
// The Scratchmote has a sharp ir distance sensor
// and a 3 axis accellerometer

#define DISTSENSE A0
#define ACCELX    A1
#define ACCELY    A2
#define ACCELZ    A3

#define TESTMODE  0

// Format output for ScratchBoard emulation
// sensor=0-7, value=0-1023 (rescaled by Scratch to 0-100)
// 0="A", 1="B", 2="C", 3="D",
// 4="Slider", 5="Light", 6="Sound", 7="Button"
void ScratchBoardSensorReport(int sensor, int value)
{
  Serial.write( B10000000
                 | ((sensor & B1111)<>7) & B111));
  delayMicroseconds(400);
  Serial.write( value & B1111111);
}
int flatx,flaty,flatz; // might be used to set midpoint
int maxX,minX; //testing purposes
int lastx,lasty,lastz;

void setup()
{
  pinMode(DISTSENSE, INPUT);
  pinMode(ACCELX,INPUT);
  pinMode(ACCELY,INPUT);
  pinMode(ACCELZ,INPUT);

  lastx =maxX= minX = flatx=analogRead(ACCELX);
  lasty = flaty=analogRead(ACCELY);
  lastz = flatz=analogRead(ACCELZ);

  Serial.begin(38400);
}

void loop()
{
  int distance = abs(map(analogRead(DISTSENSE),0,650,0,1023)-1023);
  //experimenting with the ADXL335 gives us readings between low single digits
  // and < 700 for human powered movements   int x = map(analogRead(ACCELX),0,700,0,1023);   int y = map(analogRead(ACCELY),0,700,0,1023);   int z = map(analogRead(ACCELZ),0,700,0,1023);      int rx = (x +lastx)/2;   int ry = (y +lasty)/2;   int rz = (z +lastz)/2;      lastx = rx;   lasty = ry;   lastz = rz; #if TESTMODE Serial.println(distance); /* Serial.print("x,y,z= "); Serial.print(x);Serial.print(","); Serial.print(y);Serial.print(","); Serial.println(z); */ if (x > maxX) maxX=x;
if (x< minX) minX=x;
Serial.print("maxX = ");Serial.println(maxX);
Serial.print("minX = ");Serial.println(minX);
delay(500);

#else
if (Serial.available())
{
  if (Serial.read() == 0x01){
  ScratchBoardSensorReport(0,rx);
  ScratchBoardSensorReport(1,ry);
  ScratchBoardSensorReport(2,rz);
  ScratchBoardSensorReport(3,0);
  ScratchBoardSensorReport(4,distance);  
  ScratchBoardSensorReport(5,0);
  ScratchBoardSensorReport(6,0);
  ScratchBoardSensorReport(7,0);
  }
 //ScratchBoardSensorReport(1,analogRead(POT2));
 // ScratchBoardSensorReport(7,digitalRead(BUTTON1)?0:1023);
  delay(30);
}
#endif

}

The Scratch examples are on the scratch site:

Note you can’t play them directly from the site, as you need the sensors!

 

Soldering Tips from Dorkbot PDX’s Scott Dixon

I love google+ it often exposes me to really amazing people and projects. Even better, sometimes when you comment, people are very generous with their help. I recently saw a post on Dangerous Prototypes blog about a group build of one of their the Bus Pirate V4. They laid out the parts and did two shifts to build 30 copies of the board.

It was done at Dorkbot PDX (People Doing Strange Things with Electricity in Portland Oregon), and I noticed that they were using a really cool PID controlled hotplate for surfacemount soldering, using a hacked Harbor Freight IR thermometer, and an optimized for the task Arduino clone.

I commented (Google +) on one of the pictures taken by Scott Dixon, one of the organizers, and developers of the soldering system with some questions.  The conversation that ensued was very informative and I wanted to share it with you:

Kevin: I’m newish to SMD, but I’m finding in some ways it’s easier than through hole. No more trying to get things flat, etc.

Scott: Definitely.  Also no turning the board over all the time to solder the leads, etc…

Kevin: Someone showed me how to use a toaster oven, but a lot of folks I know use the hotplate. Is one better than another?

Scott: For boards with parts primarily on one side, the hot plate is simpler and works fine.  I haven’t used a toaster oven but I hear some models work quite well particularly when you want to reflow both sides at once.  That was one of the reasons I put the thermocouple interface on the board but so far we haven’t used it for that.  Also, some day I might try sous vide.

Kevin: I recently built my first all SMD board. I did it by hand, with a little guidance from an experienced technician. Is there a time when it’s better to use one technique or the other?

There is an interesting cross over point between hand soldering and hot plate reflow depending on the complexity of the board (and how good you are at hand soldering).  As an experiment, three of us hand soldered the Bus Pirate.  We all have pretty good equipment, including stereo microscopes and we are all pretty good at hand soldering (although nowhere in the league of a tech who does it all the time).  It took each of us about 2 hours to do the BPV4 by hand.  By comparison, the first time we did the BP on the hotplate it took about 45-50 minutes or so (including getting the parts off the reels, etc).  We had a solder paste stencil so that made it somewhat faster.  So for something with that many parts it was over twice as long to hand solder.  A simpler project would be closer and a really simple project would be faster by hand, compared to setting up the hotplate and cleaning the stencil, etc.  If you don’t have a stencil and have to put the solder paste on by hand, that is somewhat slower.

I guess the only other thing I’d add is that we have done a number of SMD workshops and training sessions and our success rate for people walking out with a working project is often 100% and never very much below that.  So I would encourage people to give it a try.  It is almost certainly easier than you think.  It helps if you can find a workshop or class the first time but you can certainly learn on your own.

It doesn’t take that much specialized equipment:  Some moderate magnification (3X or so,  like reading glasses or a hands free magnifying glass) and a good pair of fine point anti-magnetic tweezers.  Maybe a 10X or so magnifier for inspection.  If you don’t want to spring for a temperature controlled hot plate or toaster oven, you can certainly make do by manually controlling the heat.  Having a temperature control system does reduce the stress though and decrease the likelihood that you will overcook some parts.

And, at least at first, I’d recommend using professionally produced PC boards with solder mask.  That helps to control the solder and minimizes solder bridges.  DorkbotPDX is a great place to get high quality inexpensive PC boards made!

Oh, and one more thing:  If you are putting solder paste on by hand (without a stencil) you will almost certainly err on the side of depositing way too much paste.  Think about the fact that a stencil only leaves a solder paste layer a few mils thick and how little paste that actually is.

Ahoy! Bus Pirating GPS

As a new member of Wyolum.com, I’ve been pitching in on their (our?) I2GPS project (Now available for pre-order!).

Wyolum has a terrific LED array board, originally intended to build word clocks, but Justin and others have also built a large format digital clock/timer display out of several of these boards, and the Super Accurate GPS clock will make it a terrific Race Clock.

I wanted to test out some GPS modules from an Asian source, and I felt that whatever Arduino code I had time to write was bound to be incomplete, so I decided to use the manufacturer’s PC progam.

We’re using the Fastrax UPS501, and the software is called Fastrax Workbench. The UPS501 is a terrific module, very sensitive (gets a good fix and tracks 9-10 satellites from within my house!) The reason Justin and Anool picked it, though, is that it has a 1 PPS output. This one Pulse Per Second can be used to get microsecond accuracy by lining this up with the GPS time as well.

Although it’s trivial, I thought I’d share how I used Dangerous Prototype’s Bus Pirate to hook up the GPS module to a PC for testing.

Since the UP501 GPS module communicates via TTL Serial, I wanted to use the Bus Pirate in “Transparent UART Bridge” mode.

I used this pinout chart to determine what was needed: http://dangerousprototypes.com/docs/Common_Bus_Pirate_cable_pinouts

  • Pin 1 is RXD on the GPS and this goes to TXD on the Bus Pirate: Grey wire or MOSI
  • Pin 2 is TXD on the GPS and this goes to RXD on the Bus Pirate:  Black wire or MISO
  • Pin 3 is GND on the GPS to GND on the Bus Pirate:  Brown Wire
  • Pin 5 and 6 are power and backup power, hook both those up to 3.3v Red wire on Bus Pirate
The bus pirate talks at 115200 baud. connect with your favorite terminal program (I’m using Teraterm Pro). Here’s the transcript of the commands to set it up (the semicolon and the comment following are not to be typed)
HiZ>m    ; Mode
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. LCD
x. exit(without change)
(1)>3     ;UART
Set serial port speed: (bps)  
 1. 300
 2. 1200
 3. 2400
 4. 4800
 5. 9600            ; Default baud for the GPS
 6. 19200
 7. 38400
 8. 57600
 9. 115200
10. BRG raw value
(1)>5      ;9600
Data bits and parity:
 1. 8, NONE *default
 2. 8, EVEN
 3. 8, ODD
 4. 9, NONE
(1)>      ;default - 1-8-none
Stop bits:
 1. 1 *default
 2. 2
(1)>              ; default 1
Receive polarity:
 1. Idle 1 *default
 2. Idle 0
(1)>           ;default 1
Select output type:
 1. Open drain (H=Hi-Z, L=GND)
 2. Normal (H=3.3V, L=GND)
(1)>2      ;Normal
Ready
UART>W          ; Turn on the power supplies
POWER SUPPLIES ON
UART>(1)    ; Select the transparent UART Bridge. If you forget this, you can type (0) for the options
UART bridge
Reset to exit
Are you sure? Y

Then it will start spitting out NMEA sentences

$GPGGA,235957.037,,,,,0,0,,,M,,M,,*43
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,00*79

Exit the program and fire up FastTrax Workbench. The only tricky part here is to select the correct baud rate. Since the Bus Pirate talks to the host at 115200 Baud, and the GPS at 9600 baud, we use 115200.

Debut of the DuckyBots!

Charlotte, Mason and I hopped into Cambridge last Friday for the Mini Maker Faire at the Cambridge Science Festival. They helped me set up a table to introduce DuckyBots! to the attendees. We had probably close to 500 kids (and a few adults) making ducky bots in the 4 hours of the Faire, and almost got into trouble because people didn’t want to stop. We were the last ones to shut down. An unqualified success! (more details after the picture)

Photo by Chris Conners

The idea for duckybots started from a conversation at the Boston Robotics Meetup with Meredith Garniss.  In addition to trying to involve kids in robotics, we thought it would be good to inspire the adult robotics crew to create for kids.

Programs like FIRST robotics, and school programs are already full of people interested in STEM and robotics, and we wanted to find something that would turn kids on to the joys of Science and Engineering.

The basic idea is to use turning rubber ducks into robots as a platform for experimentation, creativity and learning.
We thought we could apply this at many ages and levels. Really young kids can exercise their creativity by decorating ducks (drawing, gluing on.)

The middle level would concentrate on mechanical physics, making ducks move, maybe racing (but also have to offer non-competitive challenges for kids scared of  competition.)

To keep the ideas coming in, we can also have an advanced level, perhaps Sumo ducks (on water!)

For their first appearance, I needed an activity that could be be done by hundreds of kids in a short period of time, so I focused on “making them Move”

Rather than presenting them with a blank slate, I put together some modules that represent different propulsion types.

I created a fan unit from a toy motor, a AA battery box (with switch) and a fan propeller sold as a spare for snap circuits.

I also had some playmobil underwater motors, and lots of Duck(!) tape (especially yellow).

As kids strapped on the motors, and found the ducks tipping over,  presenting an engineering challenge! I also had some closed cell foam (from packing materials) that they could use for floats, and outriggers.

There was lots of inventing, trying, doing things “wrong” (turns out those air fans work fine underwater!)

I was thinking that this was a good test to see if I should spend any more time on this, and I think the answer is yes!

These ducks have legs!

Photo by Chris Conners

 

April Fools

About a week ago, Sparkfun posted a great prank in their weekly new product video. As April 1 was coming up, and I thought the kids would enjoy it, I ordered the bits that I didn’t have, and managed to pull it off.  Sparkfun didn’t give many details, so I thought I’d share my implementation.First here’s a video showing my wife getting pranked. She was a super good sport, (even not minding posting a video of her in her bathrobe!)

NOTE: Someone on google+ pointed out that at 8 amps, these horns could seriously heat up the li-po, and a hot li-po is not a good thing (fires/explosions!) so do this at your own risk. I only pulse the horns for 1 second at a time (twice per activation) so the battery never gets hot, but if you had a programming error, and it was stuck on, look out! Another good reason for the cutout switch and testing without the horns connected.

[youtube]http://www.youtube.com/watch?v=Hn6xDEUDoMw[/youtube]

Here’s what you’ll need for this prank:

  1. Arduino
  2. Accelerometer: I used this one from ModernDevices
  3. Digitally controlled relay. I used the same one they used in the Sparkfun prank
  4. The Horns!
  5. A (nearly) 12V lightweight battery. Sparkfun has this nice 1500 MAH 11.1 LIPO for a good price
  6. A compatible charger. Sparkfun recommends the IMAX B6 This can also be found on Amazon
  7. Wires, connectors, a good way to connect all the parts together

.

Here I wired the battery to power the Arduino, one leg of power went directly to both horns, and the other switched through the relay. I also put a toggle switch inline  with the power to the horns so I could shut off the horns for testing (The relay has an led and also clicks, so you can tell if it’s operating).

I had a proto-screw-shield on hand which was convenient for hooking up both the accelerometer and connecting to the relays.

Here it’s almost all hooked up. The relay connections are made to the analog side of the arduino to simplify wire routing. (Both 5V ground and io pins together.)

I use the button and LED on the protoshield to arm the device and indicate it’s status.

The bolts on the horns were too short to go through 1/4 ” plywood, so I used the supplied mounting plates to offset mount the horns.

Here it is all put together.  Here’s the Arduino sketch, but I recommend you try to program this yourself!

Adafruit Fingerprint Reader on the PC

I just got my Adafruit Fingerprint sensor for a project at work, and it’s super cool!
I’m planning on writing a python library/command line utility for its use with a PC.
I’ve got it hooked up to an adafruit FTDI breakout. The wiring (labels) are reversed from the Arduino, so while the tutorial says to wire white to Digital Pin 0 (labeled RX) it actually goes to TX on the breakout, and green goes to RX.

The one other gotcha, was windows assigned something like com28 to the FTDI breakout, and the windows test program only goes to com16. You can fix this in the device manager, by opening up the appropriate port, go to port settings,advanced, and change the COM Port Number. Then you can assign it a lower number (it would only let me use 1 and 2, as I think the rest were taken up by various Arduinos I’ve plugged in!)
Fire up the demo program, and you’re cooking with gas! I’ll be updating as I develop the code.

 

 

We Interrupt our regular programming….

I made an attempt to improve the SoftwareSerial library to make it possible to use Pin Change Interrupts in conjunction. I made some progress, but it’s not working yet. I’ll share what I’ve learned, and spell out a simple (though Kludgy) workaround.

 

Implementing asynchronous serial without hardware isn’t an easy task, and the Software Serial library is a pretty cool hack. It takes processor resources to implement that protocol though, especially with any speed, and as always there’s often competition for resources.

 

The limitations of Software Serial are widely discussed in various Arduino forums, and there are alternatives such as  Paul Stoffregen’s AltSoftSerial which looks very promising but comes with it’s own set of tradeoffs (it uses one of the timer’s so disables PWM on some of the pins)

 

The limitations of SoftSerial that comes with the Arduino IDE appear to be 2:
  1. Interrupts are disabled during transmit so you can’t transmit and receive at the same time, and it may cause you to miss other interrupts. (Paul’s library deals with this)
  2. It uses Pin Change interrupts in such a way as to eliminate their use for anything else.

 

It  is this second limitation that my friend Justin Shaw of Wyolum labs and I were discussing, and I thought I’d take a look to see if it could be remedied.

 

 There’s one pin change interrupt vector per port (and a mask register as well)
That means if you are using more than one pin from a port for pinchange interrupts, the interrupt handler for that port has to determine what to do.
Interrupts are covered in many fine pages on the web, so I won’t go into details here, but there are two kinds on the arduino:
1. Dedicated external interrupts – tied to pin 2 and 3 each with their own interrupt vector.
2. Pin Change Interrupts – allow’s you to use any IO pin. There are registers to tell which pin(s) you want to watch in each port, and a vector for each set of IO pins (Ports) on an Atmega 328, there are three: Port B, C and D.

 

There are libraries (such as PinChangeInt.h) that handle setting up these handlers, but SoftwareSerial doesn’t use them. It has it’s own interrupt handling routine, and uses the Interrupt service vectors in a very selfish way. It points all the port interrupt vectors to it’s own routine, even if it’s only using a couple of pins from a single port.

 

The code below from SoftwareSerial.cpp sets the interrupt handler for all the ports that are defined (by processor type)
PCINT0 is for Port B (PB0-PB7)
PCINT1 is for Port C (PC0-PC6)
PCINT2 is for Port D (PD0-PD7)
PCINT3 isn’t defined for atmega328p
#if defined(PCINT0_vect)
ISR(PCINT0_vect)
{
  SoftwareSerial::handle_interrupt();
}
#endif
#if defined(PCINT1_vect)
ISR(PCINT1_vect)
{
  SoftwareSerial::handle_interrupt();
}
#endif
#if defined(PCINT2_vect)
ISR(PCINT2_vect)
{
  SoftwareSerial::handle_interrupt();
}
#endif
#if defined(PCINT3_vect)
ISR(PCINT3_vect)
{
  SoftwareSerial::handle_interrupt();
}
#endif

 

So, if you are using PB5 as a softserial rx,
you could comment out the code for PCINT1-PCINT3.
If you are using the PinChangeInt.h library, you’d also want to add:
 #define NO_PORTB_PINCHANGES 
Ahead of your #include PinChangeInt.h
so it doesn’t try to hook the vector softserial is using.