Due or Mega boards? Connecting 100+ simple IR sensors & DC motors

Building application which will have 100+ IR sensors & same amount of DC motors. I plan to use several boards choosing what to buy.

Now I have Arduino Uno and started building, passed projects book to get used to Arduino. I have a background in physics & coding but my experience with boards is limited still I believe from boards point this project is pretty easy.

I plan to connect all sensors to the external power supply and connect only data wires to Arduino.
I plan to connect all motors to the external power supply also & use transistors to turn them on/off with Arduino.

I plan to connect Arduino to PC which will send commands how many items to drop & engines will engage, IR sensors will count and send progress info to host PC using Firmata.

So, not sure what I need, better have a slower 5V Mega board or more speed with Due but 3.3V?

Thanks

How fast do you need to sense IR?

With a 10x10 matrix you should be able read a row at a time using 2 port reads and some logic in about 1us.

With input shift registers on SPI bus the read rate is slower but still fast, and only needs 4 IO pins even with reasonable growth.

You get motor controller-drivers for motors to fit the needs of your motors. Some boards will run many motors. Shop.

First of all, thank you for the answer :slight_smile:

IR has to be fast enough to detect falling 1cm-10cm size item, I think it's more in ms scale than µs. While prototyping I use this sensor: KY-033 IR module Screenshot by Lightshot and it works perfectly. I ended limiting object detection to one per 100ms because otherwise it sometimes counted couple times same item if it bounced. My items fall one at the time, once per 150-200ms.

This sensor has gnd, vcc and out connections. It would use only 1 pin. Motor would use also only 1 pin - to turn on a transistor which would turn on the motor.

What's wrong to turn on/off motor with a transistor? Why do I need drivers for motors? Motor is 6V, 100ma https://goo.gl/C3zseK

As for speed, I'm worrying what will happen if I will take Mega board and will connect 35 IR sensors and 35 motors to it at once. Will it be fast enough to read from all IR sensors and keep active communication with PC at once. Trying to find how many bits I can expect to send/receive from it.

P.S. I can't find if Due is supported by Firmata. Seems like there are issues with it, at least there were issues some years ago. Can't find any good place talking about it. Johny-five does not list Due on support list either so probably I just have a single choice here :slight_smile: http://johnny-five.io/platform-support/ Now thinking if a single Mega board or 2 Uno boards are better. With Uno I may have issues on PC side to communicate with many boards at once.

This sensor has gnd, vcc and out connections. It would use only 1 pin.

You will need to connect the sensor GND to Arduino GND otherwise the signal signal will have no point of reference and the Arduino will not be able to interpret it

UKHeliBob:
You will need to connect the sensor GND to Arduino GND otherwise the signal signal will have no point of reference and the Arduino will not be able to interpret it

Sure, will do. How about the transistor? Is it ok to use just it to turn on/off the motor? Why bother with motor drivers?

"Many boards" is usually a beginner's mistake.
A single Uno should be able to control 100 motors and read 100 IR sensor outputs.
The solution to your problem is port expanders, not more processors.
A TPIC6B595 could drive eight 100mA motors (one direction), and 13 of them would only use three Arduino pins.
There are 16-input port expanders that can use the same three pins.
Leo..

Oisie:
Sure, will do. How about the transistor? Is it ok to use just it to turn on/off the motor? Why bother with motor drivers?

Drivers let you control the speed and direction of the motor and they handle the back surge when the coil fields collapse.
Motive devices use inductive fields. When the field is not fed it collapses into a current surge.

You can do the latter with a diode if speed and direction are always the same. Some FETs have protection diodes built in. For low power motors you could use ULN280x Darlington Array driver chips that also have protection diodes.

Edit: The ULN280x chips would let you run 7 or 8 small motors from 1 chip, 500mA total with a smallish heat sink.

Wawa:
"Many boards" is usually a beginner's mistake.

Agreed - but in this situation a multi-board solution may be a good one. It makes it more modular, as all these motors and sensors are apparently independent pairs that do not need to communicate with each other, just follow incoming commands. Sets of say 10 motor/sensor pairs, times ten sets, may be easier to build/maintain/install. Easier to expand as well, if needs be.

But what the best solution is... I really can't say with the provided information. Motor drops an object, sensor detects it falling (why? You know already it's falling as the motor dropped it). Commands given by a computer - Serial? That's getting a bit more tricky if you want to use multiple boards.