Hello,
First of all, i'm using official Arduino starter kit, it is provided with an LCD board.
Perhaps I'm getting too enthusiast with it, my project keeps getting bigger and bigger, pushing it to far.
I'm almost done with my project. I ran into a problem.
The problem is, i'm running out of output ports, none left, and need at least 2 more.
In summary:
Pin 0 -> not used because of RX
Pin 1 -> not used because of TX
Pin 2 for Relay (need 3 in total, so 2 short)
Pin 3 for Dallas temp sensors
Pin 4 not used because of SD shield
Pin 5 for LCD RS
Pin 6 for LCD E
Pin 7 for LCD D4
Pin 8 for LCD D5
Pin 9 for LCD D6
Pin 10 for LCD D7
Pin 11 not used because of SD shield
Pin 12 not used because of SD shield
Pin 13 not used because of SD shield
Is it possible to show only 1 line of text in the display (16x2) by removing some data wires, and therefore getting the 2 needed pins free for my relay board? In this case i have the 3 in total, which i need.
Or is it not possible. In this case do i need to buy a Arduino Mega ? And if so, do i have to buy also an new stackable SD board which can be topped on a Mega or can i use the Itead SD board Model: IM140726001 on a Mega as well?
Hope to hear from you.
Regards Denniske
No. You need all 6 pins to talk to the LCD.
What about the other 6 pins on your board? Digital Pins 14 to 19? (same as analog pins 0 to 5)
Are you using those?
If so, your only option is to talk to the LCD using fewer pins using some additional hardware.
You can get a i2c backpack for couple of dollars.
It will only use 2 arduino pins which are the i2c pins which on an uno are digital 18 & 19 or analog 4 & 5.
Or you can use a shift register like the 595. Depending on how you wire it up it can use 1, 2 or 3 arduino pins.
Using less then 3 pins requires using more than just the shift register chip and using only a single arduino pin requires quite a bit more components.
i2c is pretty nice as it is a bi-directional bus. While the default speed isn't all that fast at 100k bits/sec, since it is bi-directional and a bus, it supports multiple devices with just the 2 wires/pins.
i.e. you can additional i2c devices and not need any additional pins to talk to them.
--- bill
You can use pins 1 & 2 for your relays as long as:
- you don't need the serial port for your program (typically to support the serial monitor).
- you disconnect the relays while you are uploading your program code and reconnect them after the code has been uploaded.
Don
You are not using A0-A5 Analog pins. You could use them for your LCD.
Or use an I2C backpack for the LCD. This will use A4, A5 on the UNO.
As Don says, you can share the pin D1 (Serial TXD) if you want. Likewise, you can share with SPI to a certain extent.
I would choose to use the Anolog pins.
David.