Hi guys,
I’ve been working on a personal design project for my Bachelor Degree; the drum machine that I’m designing is a hybrid between hardware and software and I’d like to have ribbon bars as sample playback triggers and as pitch controls.
I would read the output of each ribbon bar with an Arduino and process the rest in Max/Msp.
The ribbon bar looks like this:
To build the ribbon bar I carefully followed this tutorial, but the controller doesn’t work.
Each bar (for a total of 5) is part of a small circuit that roughly looks like this:
I thought that, since the ribbon bar works as a potentiomenter, it needs an input voltage fed into one of the two side pins, as well as another pin connected to ground/negative side of the battery.
R1 is used as a protection for the ribbon bar, while R2 would be a Pull-Down resistor to clean the signal for the microcontoller - resistors’ values are random -.
However, when reading the output of the Ribbon Bar I get a very small voltage - between 0.1 mV and 3 mV -. The output also varies quite randomly.
Thus, I replaced the bar with a normal 50k potentiometer to read it’s ouput, which this time was correct and showed me the voltage drop across the circuit on the multimeter.
Does anybody have a clue of what might be going on?
This is NOT a potentiometer, I don’t even understand why he put two “ground” solder points.
It is a variable resistor with just two connexion points.
This explains why you only measure a few mV, because it is equivalent to this schematics :
In the following schematics, the red bar represents the conductive plastic, which should be isolated from the two “ground” terminals (it looks to ne like at least the left one on your picture touches the plastic)
The bump in it is where you are touching it, it will slightly bend and touch the big ground plane at that point.
The length of the green arrow will determine the resistance of the ribbon controller.
This schematics is useless, as the voltage will always be the same as the ground plane, because of the high impedance of the voltmeter, or, later, the arduino analog inputs.
You only need to use two of the “pins”, one ground and the wiper.
That instructable is not very good, it gives you only two of three pins you are expecting (2 are ground), which can work for some things (like the resistor in a 555 circuit) but less than idea for other (ADC sampling with microcontroller or Control Voltage for a vco)
Oh, I thought that the ribbon bar would act as a voltage divider based on a constant voltage input fed into one of the two side pins.
As far as I understand now, the bar is provided with voltage input when I press on the plastic sheet (velostat) which, once pressed down, touches the big ground plate. Is it correct?
Yes, that’s correct.
To transform it into a potentiometer, look at the link posted by @JaggedNZ .
The ribbon/velostat must have the two “extreme” connection points, the big plate will be the slider.
So when you press at some point along the ribbon, it will make contact with the plate and put it at some voltage depending on the spot you press.
This way the ribbon will be the RB in your original schematics, and the plate will be OUT.
You still have to take into account the fact that OUT is floating when you don’t press on the ribbon.
Then if I understood correctly, the controller should have:
one pin touching the bigger copper plate. This pin is connected to ground on the Arduino
one pin isolated from the bigger copper plate. This pin is the output
a ribbon foil touching only the output pin. It does not touch the ground pin and the bigger copper plate unless pressed. Whenever a contact is made between the ribbon foil (velostat) and the bigger copper plate, a voltage is output from the output pin. The value of the output voltage depends on the point where the contact is made along the bigger copper plate
The way @eric describes it is the way to go ahead.
Could you measure the total resistance of the piece of Velostat that you are using?
So without connecting it to the arduino, measure the resistance from one end to the other? That way it will be possible to calculate what the voltage range will be that the arduino should be able to read from it combined with R1 and R2.
The instructables tutorial states that I should “isolate the ground from the velostat and the other copper strip. It’s important that the ground is fully isolated from the rest of the build or your ribbon controller won’t work.”
Is that relevant?
I got it!
First of all, I decomposed the ribbon bar; thus, I was left with only the ribbon laying on the table.
Later on, I clipped two alligator clips at each end of the ribbon. Each alligator clip is plugged into Arduino via jumper wires (one to the GND and the other to +5V).
Now, another conductive probe (alligator clip + jumper wire) is plugged into one of the Arduino’s Analog pins. Thus, I’m able to read the output variable voltage in the Arduino software when I apply some pressure on the ribbon with the conductive probe.
Later on, I added the big copper plate being careful that the ribbon is lifted from it and, whenever I apply a pressure with the probe, I’m able to read the variable voltage output. When the ribbon is lifted, the voltage oscillates between 0 and +5. So it works!
Ideally, if I would clip the probe onto the copper plate and apply a pressure with my finger it should give the same result right? However, it doesn’t.
Do you know why?
The copper bar is nice and shiny and the ribbon is conductive on both sides.
Atm I eliminated the copper bar and the copper terminals and I use the ribbon in this configuration
White cable → output reading probe (plugged into A0 of Arduino)
I have one major problem, being that when no contact is made the output voltage oscillates between 1V and 3V ca. at a quite fast rate (other times between 0V and 5V)
Have you enabled the pullup resistor on the pin the probe connects to?
pinMode(ribbonPin, INPUT_PULLUP);
If not then the probe voltage is ill defined when it’s not touching the ribbon. With the pullup enabled you’ll read about 1023 when the probe isn’t touching anything and a lower value when it is — the range you will read will depend on the ribbon’s resistance, but it’ll max out somewhere below 1023.
@analogoutput at which point in the code should I insert it?
Obviously, if I copy “pinMode(ribbonPin, INPUT_PULLUP)” to the code it tells me that “ribbonPin” wasn’t declared.
I’m using the example code ReadAnalogVoltage:
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
float voltage = sensorValue * (5.0 / 1023.0);
// print out the value you read:
Serial.println(voltage);
delay (100);
}
here is a screenshot, maybe visulaizing the colors helps
My problem is also that I can’t get the voltage division if I clip the “white probe” onto one point in the ribbon and slide my finger on it. In this case should I just plug the resistor into pin A0?
Looking at you code ribbonPin is A0…
pinMode(A0, INPUT_PULLUP)
This is normal…
Your finger isn’t conductive (not conductive enough, but enough in other contexts).
You red and black probes are fine.
Now current flows thru the velostat, and there is a voltage gradient along it.
With the white probe you where able to pick up and measure this voltage at the point you touched the velostat.
Now imagine that white probe being the length of the ribbon, parallel to it but not touching it.
If you press on the velostat at some point so it touches that big white probe there, you just replicated what you did with the real white probe. It touches the velostat at a single point.
That imaginary big white probe is the copper bar…
See now how that works ?
Yeah, I totally get it now!
Yesterday evening I understood a bunch of things while experimenting with the tools I’m using for this project:
the ribbon foil itself is enough to serve to my purpose
one of the reasons why the full ribbon controller didn’t work is because the aluminium tape I’m using isn’t conductive on both sides (sticky face = not conductive)
Based on these discoveries, I created a simple circuit allowing me to control the brightness of an LED using the ribbon - just to demonstrate that the ribbon would work as a voltage divider, and it did! -.
The schematic looks like this:
However, when I tried to rebuild the whole construction (including the bigger copper plate and the two terminal pins*), the controller didn’t work anymore. I assume that the problem is given by the fact that somehow the ribbon makes constant contact with the bigger copper plate.
However, I tried various configurations without positive results. I guess that I’ll need to fiddle around with it for some more time.
*it’s probably worth mentioning that the combination of ribbon + terminal pins works
Regarding the code, it works! When no contact is made the voltage stays still (not on 0 but rather on 4.87, which is weird because I’m feeding 3.3V atm. But at least it is still, thank you!)
Now I have other two questions:
Do you have any idea of why the controller doesn’t work when I include the bigger copper plate?
Once the LED experiment proved to be successful, I tried to control the pitch of my Behringer Crave using the ribbon. I read on the manual that all Crave’s CVs accept ± 5V, thus I fed the circuit with Arduino’s 5V output. However, the controller didn’t affect the pitch in any way. Why is that the case?
Either you had an unwanted contact somewhere, or the opposite, a bad contact somewhere .
Which Arduino 5V output ?
To get an analog out from the Arduino, you need to use PWM.
Google that and you’ll find everything you’ll need.
Don’t forget a simple low-pass filter on the output.