I am working on a project that will involve 10 subcomponents each containing an Arduino Nano and two 28-BYJ48 stepper motors each with ULN2003 driver. There will also be an Arduino Uno that sends commands to each of the 10 Arduino Nanos over a shared I2C bus.
Overall, I'm estimating the peak current draw will look something like:
20 motors x 0.24A per motor = 4.8A
10 Arduino Nanos x 0.03A each = 0.6A
1 Arduino Uno x 0.04A each = 0.04A
Total= 5.44A
So let's estimate 6A as our peak current draw.
My question is how I should power this project. My original plan is to share power from a single 7V, 10A-rated power adapter, hooking each of the above components (for the motors, the driver has power pins) onto the same power supply, of course with considerations for the wire gauge to safely supply the 6A peak.
However, I have been wondering if powering motors, drivers and Arduinos from the same supply is problematic due to voltage fluctuations caused by the motors. I'm curious if this would pose problems in terms of the arduinos getting damaged or not operating as intended, and also want to know if there are any circuits/parts I should use between the Arduinos' power inputs and the shared power line.
Very nice schematic! I think you will be OK. The on board regulators will do a lot in cleaning the power for the processor. This is my prefered method of powering the Nano. Your power supply appears a little oversized on current which is good, that will help in keeping the electrical noise down. If you can get the voltage to 8V that will help a lot giving you some headroom for the onboard regulator.
Don't use the TX pin.
Why not four motors per Nano (A0-A5 are also digital pins).
Seems a nightmare to write/maintain code for 11 Arduinos.
This can all be done with a single Nano and TPIC6B595 port expanders (no ULN either).
Leo..
Two constraints that went into the decision to use many Arduinos:
subcomponents need to be assembled / boxed / tested separately due to how the mechanical parts are put together
we want the motors to move close to synchronously and at high speeds and we weren't sure if that would be possible with a shift register
I think the 4x motor per Arduino setup might be doable, but I'm not sure about the port expanders especially since it doesn't look like we can use libraries like accelstepper for it. The project budget definitely allows for using multiple arduinos if necessary, but it remains to be seen how well the I2C system will work.
Regardless, what do you think about the power supply situation? Much of the load is the motors anyway so regardless of 1 arduino vs. 11 arduinos I still am open to comments on how to power the setup.
How far will these Arduinos be apart. I2C has distance restrictions.
More than a few metres total could be problematic.
Synchronous is not a problem with shift registers.
Load a new single step for all motors in the shift registers, and then give a step pulse.
All motors take that single step at the same time.
I think synchronous I2C would be much more of a problem.
Accelstepper seems a bit silly for an 28-BYJ48.
You can get these motors beyond about 12RPM, even with acceleration. Will post a link to control 48 steppers with a single Nano later. Look at the goPos() function in post#86 here.
Leo..
I second the concern about running I2C over distances longer than a foot or two. It will work up to a point, but don't know how reliable it will be.
As far as powering them from a single supply, I don't see a problem. I have a 1kW power supply under my desk that was removed from an instrument that had approximately 40 stepper motors, although they didn't all run at the same time.
Have you considered CAN, it will be very fast, up to 1Meg. Also no overhead for the bus if you use something like the MCP2515 CAN module. I bought a few and they were about $4.00 ea. Cory Fowler wrote a library that works with Nano, no problem I have about a dozen of them running. I simply combined the Send and Receive into one sketch, works great. If you get the modules set up two, one for send the other for receive. No wiring differences between them. Be sure the termination jumpers are in and the bus is a few feet long. As it grows the termination is on the physical ends of the bus, nothing in the middle. You must have a second on the bus as it must acknowledge the transmission. Nothing for you to do about that, it is part of the protocol. Nice part you can extend it up to several thousand feet and no problem adding a monitor to it if you want.