Pages: [1]   Go Down
Author Topic: Using Arduino with 2 pots and an LCD display  (Read 1092 times)
0 Members and 1 Guest are viewing this topic.
Chicago
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys! New to the board and new to Arduino. Hoping someone can help me out here!

I'm building a guitar tremolo pedal, and I wanted to put an LCD display in to tell me how turned up or down the knobs/pots are so I can change the settings between songs and change them back exactly when I need to play songs again.

I'm essentially going for something like this:



So I put this schematic together (basically, each pot goes into a TL072 IC chip, which splits the signals for each lug, one goes into the arduino, one goes back to the pedal circuit) - you can see the original basic config for the pots above, and the new one below:



I would be buying this board:
http://www.amazon.com/SainSmart-Keypad-Shield-Arduino-ATmega328P/dp/B0076FWAH8/ref=sr_1_14?ie=UTF8&qid=1354491071&sr=8-14&keywords=arduino+lcd+shield

and I would be using this code:

Code:
// include the library code:
#include <LiquidCrystal.h>

// intialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int pot0 = A1; //potentiometer on analog pin 1
int pot1 = A2; //potentiometer on analog pin 2

int qty; //Quantity value to read
int length; //Length Value to read

void setup() {
// set up the LCD’s number of columns and rows
lcd.begin(16, 2);
}

void loop() {
qty = analogRead(pot0); //sets value equal to potentiometer “pot 0”
length = analogRead(pot1); //sets value equal to potentiometer “pot 1”

lcd.setCursor (0,0); //Set cursor to column 0, line 0 (line 0 is the first line)
lcd.print(”Length ”);
lcd.setCursor(10,0);
lcd.print(length);
lcd.print(” “);

lcd.setCursor (0,1); //Set cursor to column 0, line 1 (line 1 is the second line)
lcd.print(”Quantity ”);
lcd.setCursor(10,1);
lcd.print(qty);
lcd.print(” “);

}

Here are my concerns:

Can the TL074 chips handle the Arduino signal? Will this affect my signal from the pots to the circuit board? Do I need any kind of resistors between the arduino board and the IC?

I also worry about what I need to do to power the IC - right now I just run from the +9v to a 1n4001 diode and then to the power pin. Something tells me at least another cap is needed in there someplace, if not more.

The pots in question are part of the LFO, so they carry no audio signal, just FYI. I heard arduino is terrible with audio quality. These just affect the LED speed that hits the photoresistors in the trem circuit.

Anyone versed in this stuff enough to see if I'm on the right track?

Lemme know - and thanks in advance!
« Last Edit: December 04, 2012, 10:23:07 am by greysun » Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3422
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Use code tags #, and I dont think your circuit is correct, check the wiring again just to be sure.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Chicago
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry - new to the code thing. Added the code tags.

The basic circuit is right - one is the speed pot, and the other is the fine pot (so one gets you slower/faster, the other hones in right where you want to be).

The circuit with the IC's... that I don't know about. I know that's how the IC splits signals and sends them, per the data sheet.

I just don't know how the arduino would work with an IC as a go between to the pots.

Is there a way to set an output for the pots on the Arduino board so that I could just send the pots directly to the Arduino and then out to the circuit? (again, TOTAL noob here. Haven't even gotten my hands on an Arduino board yet).
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3422
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is there a way to set an output for the pots on the Arduino board so that I could just send the pots directly to the Arduino and then out to the circuit? (again, TOTAL noob here. Haven't even gotten my hands on an Arduino board yet).

The Arduino has analog pins which could be used to read the values from the pots. From there you can do some processing if needed and you can wire a LCD to the board and show the values.

Quote
The circuit with the IC's... that I don't know about.
Yea, I was refering to that setup.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Chicago
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, upon further research, I could probably simplify things. Check this out and let me know if this is do-able... I updated the schematic:



and I would use this code - maybe?:

Code:
// include the library code:
#include <LiquidCrystal.h>

// intialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7); //I checked the schematic of the shield for these numbers

int pot1in = A1; //potentiometer on analog pin 1
int pot2in = A2; //potentiometer on analog pin 2
int pot1out = 11; //potentiometer out for digital pin 11
int pot2out = 3; //potentiometer out for digital pin 3

int speedIn; //Speed value to read "pot 1"
int fineIn; //Fine Value to read "pot 2"
int speedOut; //value out to digital pin 11
int fineOut; //value out to digital pin 3

void setup() {
  // set up the LCD’s number of columns and rows
  lcd.begin(16, 2);
  // initialize serial communications at 9600 bps:
  Serial.begin(9600);
}

void loop() {
speedIn = analogRead(pot1in); //sets value equal to potentiometer “pot 1”
speedOut = map(speedIn, 0, 1023, 0, 255);
analogWrite(pot1out, speedOut);
fineIn = analogRead(pot2in); //sets value equal to potentiometer “pot 2”
fineOut = map(fineIn, 0, 1023, 0, 255);
analogWrite(pot2out, fineOut);

lcd.setCursor (0,0); //Set cursor to column 0, line 0 (line 0 is the first line)
lcd.print(”Speed ”);
lcd.setCursor(8,0);
lcd.print(speedIn);
lcd.print(” “);

lcd.setCursor (0,1); //Set cursor to column 0, line 1 (line 1 is the second line)
lcd.print(”Fine ”);
lcd.setCursor(8,1);
lcd.print(fineIn);
lcd.print(” “);

}

Is that a little more do-able? It's certainly easier than the last one...
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3422
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you familiar with the LCD library? If not, try the example sketches first then work on your project, otherwise you will have a hard time understanding whats going on with the code.

You dont need:
int pot1out = 11; //potentiometer out for digital pin 11
int pot2out = 3; //potentiometer out for digital pin 3

Just input the data and use LCD.print to output the data on the LCD.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Chicago
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

But that code is setup so that the signal goes from pins 11 and 3 to my pedal circuit.

So the pots go into the analog inputs, read on the LCD, then out of 11 and 3 to my tremolo LFO.

If I take that code out, how will I get a signal back to the pedal circuit?
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3422
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So the pots go into the analog inputs, read on the LCD, then out of 11 and 3 to my tremolo LFO.


Oh, my bad.

Uhh, I dont think that will work properly, because even if you use PWM, it still wont output the same data as you put in. The output pin send out either HIGH, LOW, 0 - 255 PWM, or 0 - 1024 using the servo Iibrary.

If your input values are within a decent range 0-255 or 0-1024 then maybe it will work, also you might want to add a capacitor to smooth out the digital signal.

Maybe someone else can give you a better answer, I have never done what you want to do, so I am uncertain it will even work that way.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Chicago
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yea, the digital conversion is what I was afraid of. Anyone have any other ideas here?

The LFO in my pedal circuit all hits an LED - the audio signal is put through a photoresistor.

Is there a way to have a 5 knob arduino wave generator that goes to 1LED? If could get the following from an Arduino, I could just go that route:

Speed: rate of the effect, from a steady swell, to a rapid fire arm
Symmetry: from ramp-up sawtooth, to triangle, to ramp-down. (pulse width when Smoothness is at square)
Depth: amount of effect from barely a shudder to full tremulation. Can achieve silence to blaring loud squarewave chop
Spacing: loud/quiet "balance" waveshaper... adjusts spacing between volume pulses
Smoothness: blend between full on/off squarewave "chop" to smooth buttery sine-tri-round wave

Thoughts there? That's probably way out of my league right there, hehe.
Logged

Pages: [1]   Go Up
Jump to: