Multiple Interrupts on One Board

Hi Folks,

I'm running a series of 12 Geiger counter boards, and I'd like to be able to read from them all on the same board. Only thing is, I need to use their signal as interrupts, and there aren't many boards that can handle that many interrupt pins.

I was using the Feather M0, which has 12 or 13 interrupt pins, but you can't use them all at the same time :-/. You just have the option of using any one of those 12 or 13 pins.

Can anyone recommend a board that is capable of reading that amount of interrupts at once?

Thanks!

On the Uno, or any other ATMega328-based board, external interrupts can be triggered by the INT0 and INT1 pins or any of the pin change PCINT23...0 pins. To use a pin change interrupt requires you to first determine which pin caused a particular interrupt.

See Gammon Forum : Electronics : Microprocessors : Interrupts

Clarifying,

I currently am using an M0 board which has at least 13 pins capable of interrupt. I have 12 signals going into 12 different pins, however when I declare 12 interrupts, the board actually can't handle it. It can maybe handle +/- 3 declared interrupts on the board at once. Something to do with timers overlapping.

I need to find a solution for a board that can read a minimum of 6 interrupts on 6 pins in the same firmware, but ideally 12.

Reply #1 points you to ~20 interrupt inputs.

2 External Interrupt Request 0 (pin D2) (INT0_vect)
3 External Interrupt Request 1 (pin D3) (INT1_vect)
4 Pin Change Interrupt Request 0 (pins D8 to D13) (PCINT0_vect)
5 Pin Change Interrupt Request 1 (pins A0 to A5) (PCINT1_vect)
6 Pin Change Interrupt Request 2 (pins D0 to D7) (PCINT2_vect)

Ok, so the external interrupts are pretty straightforward, but not so much with the pin change. From what I can tell there are three overlapping interrupt requests for three sets of pins. What I can't grasp is how you would be able to tell what pin it came in on? The guide just says something like, "obviously more code is necessary."

Google will lead you to Arduino PCI (pin change interrupt) libraries that do this for you.

Or, you could read a port, save its state, and compare that to the port state when a pin change interrupt is acknowledged. 3-4 lines of code.

Cool, I'm going to try the pin change library tonight, thanks for the info!

You should rethink your approach.

Interrupts add overhead, under heavy load on 12 sources you probably don't have time for that.
And if interrupts will not work under heavy load conditions, why would you use them in the first place?

What maximum rate are you expecting from your Geiger counters?
Will an Arduino work in hard radiation environments?

The Arduino itself is probably not radiation hardened indeed.

Each interrupt will take maybe 50 instructions total to handle (interrupt call; check which one interrupted; increment counter for that one). That would put a limit of about 320,000 counts per second for all 12 counters together. The Arduino would not be able to do anything else, though.

Now assuming you want to do something like counting the rate and show the results on a display, cut that number by half, or even less.

Maybe you need multiple Arduinos to interface with the Geiger counters and a master Arduino to collect all the data.

...R

I was hoping to avoid multiple arduinos for simplicity, but if it's unavoidable, I'll go that route.

I think 320,000 per second should be okay...all the arduino is doing is reading the interrupts and serial printing a timestamp over to an attached computer.

It's not going to be in a radiation heavy location, just reading background radiation.

Whandall:
You should rethink your approach.

Interrupts add overhead, under heavy load on 12 sources you probably don't have time for that.
And if interrupts will not work under heavy load conditions, why would you use them in the first place?

What maximum rate are you expecting from your Geiger counters?
Will an Arduino work in hard radiation environments?

What would rethinking the approach look like? It seems that interrupts were made to be used in instances like this where you have short impulses that could be missed unless they were interrupts.

Interrupts are most likely the appropriate way here. The question is: how many pulses a second do you expect to get at the most, per sensor and total? You need to know that first.

320,000 counts per second for all 12 counters together

For typical Geiger tubes, that count rate (even divided by 12) would be in a radioactive hazard zone.

jremington:
For typical Geiger tubes, that count rate (even divided by 12) would be in a radioactive hazard zone.

Yup, that sounds pretty deadly. From what I remember with the testing, it's about 3-6 counts per minute.

In my area, at 190 meters elevation, an LND712 Geiger tube produces about 12 CPM.

I'm at 30ft elevation, could be more than six cpm, but definitely not thousands of cpm.

Why do you want to use 12 Geiger tubes to measure background radiation? What are you expecting to happen?

That's what I'm also wondering: why 12 tubes? That doesn't sound like background radiation measurements to me. More like some kind of scientific experiment involving a lot more radiation.