I try to develop a pretty complete meteorological station based on Arduino Mega2560. I included a wide variety of sensors, but now i require many interrupt pins... Let me explain what sensors i have:
- TSL230R to measure irradiance (requires 1 interrupt pin)
- DH21 to measure air temp/hum
- BMP085 to measure atmospheric pressure (use SDA and SCL pins, what in arduino mega 2560 are interrupt pins)
- QRD1114 to measure wind speed (requires 1 interrupt pin)
- Rain sensor (requires 1 interrupt pin)
- Rain gauge (requires 1 interrupt pin)
- Waterflow sensor to measure the consume on irrigation water (requires 1 interrupt pin)
- Water level sensor to prevent the irrigation water deposit to be empty (requires 1 interrupt pin)
- Device wake up button to check the device bythe user (i do not use LCD of things like that) (requires 1 interrupt pin)
- Start/Stop water pump button forthe irrigation tasks (requires 1 interrupt pin)
- RTC alarm to wake up automatically the station to measure the parameters (requires 1 interrupt pin)
So, this complete station requires 9 interrupt pins, but Arduino mega2560 "only" have 6, but two of them are already in use for the I2C communications with the barometers and the RTC, and one more on capture the alarms from the RTC. So, only 3 free what i could use for 3 of the sensors, but i still need other 3 more interrupt pins.
I know the "Pinchangeint" library, but i do not completely understand it,and i do not know how to apply to arduino mega, because the examples are for arduino uno board. So, i don´t know which pins to use for what sensor (and other electronic components not explained here such a rgb led, bluetooth communications,...). I neither know if i could use at the same time normal interrupts (typical attachinterrupt)and interrupts managed by this library..
So, i am really lost, because all the sensors work perfectly individually, but i don´t know how to solder all toguether into an shield because i don´t know to which pin should i use and how to write the code respect the interrupts.
Could you give me some ideas and help? Thanks so much!