I want to connect 40 light sensors to my Arduino .Is there any possibility to connect all together without mega arduino?I really appreciate if any one could give me advice, tutorial or…
Thank you
I want to connect 40 light sensors to my Arduino .Is there any possibility to connect all together without mega arduino?I really appreciate if any one could give me advice, tutorial or…
Thank you
Hi Mehrnoush,
I don't know of a tutorial or project involving so many sensors connected to an Arduino, but just general reading up on I2C or other serial interfaces will show that it is possible to chain up sensors if they are digital serial devices (you may hit an addressing limit, in which case you'd have to implement multiple serial buses on your microcontroller (Arduino or otherwise).
If the sensors are analog, then search for analog multiplexing (would need additional hardware).
Hello mehrnoush
As an whole other option you could maybe look at optimizing your setup so you dont need 40 sensors.
If you have no choice but to use 40 IO Pins, then as Shabaz said above you need to look in to I2C.. For example look at expanding the I2C Port by using TI 8574, 8575, 9555 or MCP 23017
http://playground.arduino.cc/Code/I2CPortExpander8574
http://tronixstuff.com/2011/08/26/tutorial-maximising-your-arduinos-io-ports/
By the time you add the extra hardware to get to 40 sensors and of course the additional complexity of the software, you may find it easier and quicker to use the MEGA
Is there a reason you cant use the MEGA?
Why do you need 40 sensors, you have not described you project so its hard to provide the best advise
Peter
Mehrnoush,
what you need is a CD74HC4067 16 channel analog multiplexor, well actually three for 40 inputs. There is a tutorial on www.tronixstuff.com. Sparkfun used to make a break out board for this IC too. I am assuming you light sensors are analog, something like photosensitive resistors.
As Peter said if you could use the MEGA then 3 of these with 16 channels of analog would give you phenomenal processing capacity and flexibility.. You could link them using I2C and the EasyTransfer library. In the Uk clone Mega's can be bought for about £10 and for less from China. I really doubt you will beat that to achieve a 40 channel system especially when you consider the bulk of the system is already built for you.
Bob