Hello,
After burning out the Arduino Due I decided to go to with the mega. I am making a project where a stepper motor heats up and I measure the temperature with a thermistor. Then based on that I run fans and open ventilation doors using DC and Servo Motors. I had a question if the mega has enough pins to do this. I have the sanssmart motor shield and a LCD display I would like to use.
Since I can not directly stack those two shields. I want to place them on bread boards and run wires from the mega to the breadboard.
Can someone explain to me how many pins the motor shields use (Analog PWN)?
Can someone explain to me how many pins the LCD shield uses (Analog PWN)?
The tutorials I have seen all just show just to plug it in
Also the SDA the SCL ports are they needed for both?
Any explanation or resources would be greatly appreciated. I see most documentation for the uno and not the mega.
Regards
The pinout Diagram for MEGA
Sanssmart Motor Shield (Reviews mention pins being used)
LCD display
http://arduino-info.wikispaces.com/LCD-Pushbuttons
I am no expert but this sounds like a good use of a shift register chip(s) and relays. Don't understand how you burnt out the Uno? The mega has more inputs/outputs yeh, but do you need?
A shift register chip will allow you to (typically) control eight devices on one chip and I am sure there are bigger ones.
I find that when I run out of pins, it is very easy to "extend" any Arduino with a Nano, or ProMicro. They cost about $2.00, take up twice the space of a postage stamp, and can be tied to the main processor with a simple serial link. If your main processor has its serial link already devoted, Software serial works fine.
A list of the things you are planning on running may help.
It is a bit spurious at the moment. Do you really need more than one motor to open vents :|?
The Mega (according to the schematic here: Mega PinOuts
Has 15 ish PWM pins...which is a lot!
SDA and SCL are I2C ports, so you can connect up to 256 devices that use I2C on those pins (as long as they have a different address). So technically no issue there.
I think I2C is limited to 128 devices (7 bits of addressing), since 8th bit is used to select read/write to/from an address.
Apparently a few are also reserved, bringing the total to 112.
http://www.i2c-bus.org/addressing/
Less common equipment may support 10-bit addressing.
You don't need a Mega for this. It has more than 50 pins and I estimate you are using around 12, depending on how many motors you want to operate.
Yes, you can stack the shields. Unsolder the pins on the motor board and put on stackable headers instead. This may make some of the motor outputs un-usable as they will be taken by the LCD but it comes back to "how many motors?"
Don't forget analog pins can be used as digital too.
const in MyMotorPin = A1;
void setup() {
pinMode(MyMotorPin, OUTPUT);
}
void loop() {
digitalWrite(MyMotorPin, HIGH);
}
CrossRoads:
I think I2C is limited to 128 devices (7 bits of addressing), since 8th bit is used to select read/write to/from an address.
Apparently a few are also reserved, bringing the total to 112.
Addressing - I2C Bus
Less common equipment may support 10-bit addressing.
Ah yeah! Forgot about that pesky bit.
This may help: shieldlist