invader7:
Hello , i want to start a new project and i will need:
1x LCD (16x2 - characters and numbers)
1x Keypad (1-9 only)
1X GSM Shield
2x Fan
1x temperature sensor
1x water sensor
1x co2 sensor
40x leds
Are there enough ports on arduino UNO R3 for my project ? Thanks...
The LCD needs 6 pins, but 5 of these can be shared with other devices. The keypad is probably a 3x3 matrix, so it will need at least 3 input pins, which can't be shared because you have no other push buttons or switches etc. The fans may need PWM output pins if you want to control their speeds. The temperature sensor, water sensor and CO2 sensor can probably be done with 1 input each.
For the 40 LEDs, it depends on how you need to control them. A 5x8 matrix is probably the way to go, if you are prepared to write the multiplexing software.
So we're left with:
1 LCD enable pin (even if you can share the other 5 LCD pins with the LEDs)
3 keypad input pins (the other 3 pins can be shared with either the 5 remaining LCD pins or the LED pins)
2 fan output pins
3 input pins (CO2 sensor, temperature, water)
13 LED control pins
? GSM shield pins
That comes to a minimum of 21 pins plus however many the GSM shield needs. This is more than a Uno has. It will be much simpler to use an Arduino Mega than expand the outputs of a Uno with shift registers or other devices.
I haven't worked with any cellular shields, but I'd guess they have an SPI interface, which requires 4 pins (3 of which are shared with other SPI devices).
Getting a Serial LCD is much easier to work with both from a pin # and wiring perspective.
Arrch:
Getting a Serial LCD is much easier to work with both from a pin # and wiring perspective.
Thanks for the advice about the lcd , i found that a serial lcd is more expensive and i think the code is complicated comparatively to other lcd http://www.arduino.cc/en/Tutorial/LiquidCrystal ... But it's much easier at wiring you are right !
Anyway , it doesn't make any sense because if i completely remove the 7 digital pins of the LCD (if i was right at my last post) my pins will be 18 - 7 = 11 , but i need an lcd and i have only 3 digital pins left (UNO has 14) , so i have to go with MEGA.... i think...
Arrch:
Analog pins can be used as digital pins too
O thanks i didn't knew that , im new to arduino , it has 6 analog pins , the 3 pins will be my 3 sensors so i will have another 3 free analog pins to use as digital , do you believe it's a risk to go with so little free pins or i will make it ?
I think arduino mega will be more "safe" in order to be sure i could connect all of them...
invader7:
anks i didn't knew that , im new to arduino , it has 6 analog pins , the 3 pins will be my 3 sensors so i will have another 3 free analog pins to use as digital , do you believe it's a risk to go with so little free pins or i will make it ?
I think arduino mega will be more "safe" in order to be sure i could connect all of them...
It's your budget.
There are tricks to getting more input/outputs with additional hardware, but if you want to play it safe and you have the budget for it, go for a Mega.
The only think that bothers me its that im at very beginning , every tutorial so far is for UNO , and i will not have much time to search "how this and how that works" so i think UNO is safer.... etc the gsm shield , i dont know if it is working good and easy with the mega as with UNO...
Finally i will need something to open and close some very light cardboard windows... something that will go from A to B and from B to A , not continuously , only when i will tell it to do so... like cd rom tray ! (maybe a servo?) I think it will have 1 pin... i dont know... so i have 14 pins
Can you "see" something wrong in my thoughts ? UNO seems good to handle them and will have some pins free just in case...