OK, so I have a wave shield, a 20x4 RGB+ LCD, and 6 toggle switches. I can't seem to figure out how to wire this all up to my Arduino Uno.
I did get the LCD and wave shield working separately.
I need the Arduino to know which toggle switches are on and which are off (obviously). I also want the backlight color to be controlled by the Arduino.
Thanks!
Edit: 5 of the 6 toggle switches are illuminated (LED) (Product page), and I might want a little LED next to the 6th one to indicate if it is on or off. And I think my problem really lies with a lack of pins.
Wave Shield + RGB LCD + Switches
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88097
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Shield + RGB LCD + Switches
What you need is one of these: https://www.adafruit.com/products/715
It is designed for a 16x2, but it will drive the 20x4 display also. The 20x4 will hang over the on-board pushbuttons, but you can leave those off the board and run wires from the pads to your toggle switches.
The best part is that the whole thing will connect to your Arduino via I2C using just 2 pins (Analog 4 & 5). It is designed to be a shield, but many people leave off the headers and just run wires.
It is designed for a 16x2, but it will drive the 20x4 display also. The 20x4 will hang over the on-board pushbuttons, but you can leave those off the board and run wires from the pads to your toggle switches.
The best part is that the whole thing will connect to your Arduino via I2C using just 2 pins (Analog 4 & 5). It is designed to be a shield, but many people leave off the headers and just run wires.
-
- Posts: 11
- Joined: Sat Jan 26, 2013 7:31 pm
Re: Wave Shield + RGB LCD + Switches
Ok, thanks! Just to clarify, I would use this board to drive the lcd (including color control) and 5 of my toggle switches, and just hook the 6th switch up normally?
- adafruit_support_bill
- Posts: 88097
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Shield + RGB LCD + Switches
Yes. That will work.
-
- Posts: 11
- Joined: Sat Jan 26, 2013 7:31 pm
Re: Wave Shield + RGB LCD + Switches
When I look at the picture HERE, it looks like the LCD will also cover the chip and pot and stuff. The chip isn't an issue, assuming it has clearance (which I don't know if it does). And I'm assuming the pot could just be put on short wires. I just want to make sure that there is clearance for the screen over everything.
Also, what voltage do the buttons operate at? And what is the maximum amperage? I just want to make sure my switches will illuminate properly (LED off/dim when the switch is off, and brightly on when the switch is on).
Also, what voltage do the buttons operate at? And what is the maximum amperage? I just want to make sure my switches will illuminate properly (LED off/dim when the switch is off, and brightly on when the switch is on).
- adafruit_support_bill
- Posts: 88097
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Shield + RGB LCD + Switches
It does interfere if you push the long pins of the header all the way in. But the pins are long enough that you can clear the pot (although you will have difficulty adjusting it). Some also mount the display separately - connected with a short length of ribbon cable.
The pushbuttons use the internal pullups in the port expander to hold them at 5v when open. When the switch closes, the contacts short to ground.
What switches are you using? The illuminated switches we sell have separate pins for the leds and the contacts.
The pushbuttons use the internal pullups in the port expander to hold them at 5v when open. When the switch closes, the contacts short to ground.
What switches are you using? The illuminated switches we sell have separate pins for the leds and the contacts.
-
- Posts: 11
- Joined: Sat Jan 26, 2013 7:31 pm
Re: Wave Shield + RGB LCD + Switches
I am using THESE switches.
Useful quotes from different people on the product page:
"One side has a ground symbol, plus sign, and an symbol with rays coming out of a half circle (LED positive)...If you connect ground to the ground contact, and positive to the LED positive contact it will illuminate. When you flip the switch the plus sign and the LED positive are connected."
"there are only 3 pins but the pin with the ground symbol is not the common pin — it is only connected to the LED. The pin with the plus on it and the LED pin are connected together when the switch is closed."
However, an employee commented "There are only three contacts, with a common ground."
I am going to go do some testing with connecting the switch (no LCD) to see what I come up with. Hopefully then you will be able to tell me if my switch will work properly with your product.
Useful quotes from different people on the product page:
"One side has a ground symbol, plus sign, and an symbol with rays coming out of a half circle (LED positive)...If you connect ground to the ground contact, and positive to the LED positive contact it will illuminate. When you flip the switch the plus sign and the LED positive are connected."
"there are only 3 pins but the pin with the ground symbol is not the common pin — it is only connected to the LED. The pin with the plus on it and the LED pin are connected together when the switch is closed."
However, an employee commented "There are only three contacts, with a common ground."
I am going to go do some testing with connecting the switch (no LCD) to see what I come up with. Hopefully then you will be able to tell me if my switch will work properly with your product.
- adafruit_support_bill
- Posts: 88097
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Shield + RGB LCD + Switches
There are some conflicting descriptions there. It would be nice if Sparkfun had a wiring diagram or spec sheet for it.
But it sounds like the anode of the led is hard-wired to a pole of the switch and that it is designed for 'positive logic'. That makes things a little tougher because you can't use the built-in pullup resistors on the Arduino or the port expander. You will need separate pull-down resistors.
But it sounds like the anode of the led is hard-wired to a pole of the switch and that it is designed for 'positive logic'. That makes things a little tougher because you can't use the built-in pullup resistors on the Arduino or the port expander. You will need separate pull-down resistors.
-
- Posts: 11
- Joined: Sat Jan 26, 2013 7:31 pm
Re: Wave Shield + RGB LCD + Switches
I just did some testing, with the (+) connected to +5v, the (ground) to ground, and the (led symbol) to a digital pin, the LED on the switch only illuminates when the switch is on.
When I run the sketch below, the switch turns on the Uno's built-in LED
Mind you, the wave shield is disconnected. But it shouldn't matter.
EDIT: I didn't use any additional hardware (i.e. resistors).
When I run the sketch below, the switch turns on the Uno's built-in LED
Code: Select all
int ledPin = 13; // LED connected to digital pin 13
int SwitchPin = 2; // Switch connected to digital pin 2
int val = 0; // variable to store the read value
void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin 13 as output
pinMode(SwitchPin, INPUT); // sets the digital pin 2 as input
digitalWrite(SwitchPin, HIGH); // turn on pullup resistor for switch
}
void loop()
{
val = digitalRead(SwitchPin); // read the input pin
digitalWrite(ledPin, val); // sets the LED to the switch's value
}
EDIT: I didn't use any additional hardware (i.e. resistors).
- adafruit_support_bill
- Posts: 88097
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Shield + RGB LCD + Switches
But you did enable the internal pullup:EDIT: I didn't use any additional hardware (i.e. resistors).
Code: Select all
digitalWrite(SwitchPin, HIGH); // turn on pullup resistor for switch
-
- Posts: 11
- Joined: Sat Jan 26, 2013 7:31 pm
Re: Wave Shield + RGB LCD + Switches
I probably should have specified, I meant excluding the internal pullup.adafruit_support wrote: But you did enable the internal pullup:
How would I determine this without tearing apart the switch?adafruit_support wrote: In the OFF position, does the pin with the led symbol get connected to ground?
- adafruit_support_bill
- Posts: 88097
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Shield + RGB LCD + Switches
Use a multimeter and measure the resistance.
-
- Posts: 11
- Joined: Sat Jan 26, 2013 7:31 pm
Re: Wave Shield + RGB LCD + Switches
I'm getting 0L when I measure (led) and (ground) (or anything else besides the (+) and (led) terminals with the switch open). There is also the chance that I am doing something wrong, as its a new multimeter.
- adafruit_support_bill
- Posts: 88097
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Shield + RGB LCD + Switches
0L means no connection. I'm not sure how the circuit works with a pullup then.
-
- Posts: 11
- Joined: Sat Jan 26, 2013 7:31 pm
Re: Wave Shield + RGB LCD + Switches
I have a bunch of resistors, so I can try pull down resistors later today. I've never done pull down before, how would I proceed? Or do you know of any good resources that might apply to this situation?
Please be positive and constructive with your questions and comments.