2144Views6Replies
how to make digital potentiometer as mechanical potentiometor using arduino?
connection between digital pot x9c103p
INC - Arduino pin
* U/D - Arduino pin 3
* VH - 5V
*VSS - GND
* VW - Output: 150 Ohm resistor -> LED -> GND
* VL - GND
* CS - Arduino pin 4
* VCC - 5V
and the code i used
#include <DigiPotX9Cxxx.h>
DigiPot pot(2,3,4);
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.println("Starting");
for (int i=0; i<100; i++) {
Serial.print("Increasing, i = ");
Serial.println(i, DEC);
pot.increase(1);
delay(200);
}
for (int i=0; i<100; i++) {
Serial.print("Decreasing, i = ");
Serial.println(i, DEC);
pot.decrease(1);
delay(200);
}
}
what is error in that and how can i make sthing varry between 1k to 4k if i have digital potentiometer 10k
Comments
7 years ago
These things won't drive LEDs ! The maximum current is only permitted to be 8mA. On a 5V supply, you may have burned out the "track"
Answer 7 years ago
+1
Use an Op-Amp
see the NON INVERTING AMP on pp8
7 years ago
ok can i ask you other question:
when i use potentiometer and apply wave like sawototh bot has zero at negative cycle and connect the two other pins together and measure output , it give me pwm signal
vary with pot , how can i generate sth like that arduino, you will ask me why i need that, i need that because i have rc helicopter have this connection and i wanna make same connection using arduino , i tried to give it true analog voltage and im trying digital potentiometer now
7 years ago
You will have to measure the wiper voltage instead.
7 years ago
you don't even name the pot you have used. how can we guess?
what does it not do?
Answer 7 years ago
x9c103p