I'm working with a circuit that should control the intensity of several LEDs using the CTL and REF pins on a buckpuck driver part number 3021-D-E-1000. I'm using an AD5204 digipot configured as a rheostat between the CTL and REF pins on the buckpuck to modulate the current seen at the CTL terminal, which in turn modulates the current the buckpuck sends to the LED (the higher the current seen at CTL, the lower the LED output). I'm using an Arduino to control the AD5204. The complete circuit I'm investigating is pictured below:
I believe the pertinent part of the circuit is:
I can't get the LEDs to turn on. The switches (SW-SPDT) and the BJTs (Q1-3) are both used as on/off for the LEDs, while the digipot is supposed to control the intensity of the LED output.
My initial thought was that I wasn't communicating properly with the digipot, but I've confirmed with a logic analyzer that I am sending the correct SPI commands to the AD5204. This is the code I'm using (the Arduino 7,8, and 9 pins are written high to put the BJTs in cutoff, and the mechanical switches are connected to the Arduino pin, not to GND, so theoretically the current at CTL should be dictating the LED output):
#include <SPI.h>
int cs = 10;
int address = 1;
int potval = 10;
void setup() {
pinMode(7,OUTPUT); digitalWrite(7,HIGH);
pinMode(8,OUTPUT); digitalWrite(8,HIGH);
pinMode(9,OUTPUT); digitalWrite(9,HIGH);
pinMode(cs,OUTPUT); digitalWrite(cs,HIGH);
SPI.begin();
}
void loop() {
digitalWrite(cs,LOW);
SPI.transfer(address);
SPI.transfer(potval);
digitalWrite(cs,HIGH);
delay(10);
}
So I'm beginning to doubt that communication with the AD5204 is the problem, but that leaves me pretty lost. I'm not sure why the LEDs aren't turning on, especially since even if I weren't communicating with the AD5204, by default all pot values should be set to midrange (5kOhm).
At that point the LEDs should be on, as far as I understand. Is there something I'm overlooking in the rest of the circuit?
I've tried to be thorough with the information I've provided, but sorry in advance if I've left things out, and I'll try to add information as soon as possible if I have.
EDIT
Okay, so a couple things I've found:
(1) I don't seem to be changing the wiper value on the digipot--it remains at the default value of 5kOhm no matter what value I try to write to it. So that's one problem I need to figure out.
(2) At the same time, when the rheometer has a value of 5kOhm, the LED should be on. I've confirmed this on a breadboard with the same buckpuck I'm using on the PCB and a mechanical rotary pot--at 5kOhm the voltage at the CTL terminal is ~1.23 V, and the LED is at its brightest.
(3) On the PCB with the full circuit as pictured previously, I'm getting 4.3V at the CTL terminal for each RDAC on the 5204, which doesn't accord with (2).