I have odd "ground" and a weirder [non} solution -info, please?

Hi all.

I was trying to use a digital potentiometer (MCP4131) to control the brightness of a LED using a clone UNO.

I followed this Tutorial (Code 2):

I hooked up my MCP4131 using this datasheet:

I used this Code:

#include <SPI.h>

byte address = 0x00;
int CS= 10;

void setup()
{
pinMode (CS, OUTPUT);
SPI.begin();
}

void loop()
{
for (int i = 0; i <= 128; i++)
{
digitalPotWrite(i);
delay(10);
}
delay(10);
for (int i = 128; i >= 0; i--)
{
digitalPotWrite(i);
delay(10);
}
}

int digitalPotWrite(int value)
{
digitalWrite(CS, LOW);
SPI.transfer(address);
SPI.transfer(value);
digitalWrite(CS, HIGH);
}

... and I got just a dim glowing LED that was reluctant at best to change brightness -- or it would do nothing.

AS I WAS CHECKING MY CONNECTIONS, it magically started working. I was happy, BUT then I removed my finger and it stopped working. After playing with the wires for a minutes, I discovered the culprit was the wire connecting the SDI/SDO of the MCP4131 to the MOSI (pin 11) of the UNO.... SO, I pressed on the wire again, thinking maybe I had a bad connection, and it started working, I pulled my hand back and it stopped working.

I changed holes in the breadboard to see if that would help, but got the same result: as long as I had my finger on the INSULATED wire, it worked - but only if my finger was on the insulated wire.

Thinking I was adding some vague resistance in some way to the wire, I decided to put a 330-ohm resistor in the MOSI/SDI wire then connect to the UNO - didn't work.

My next thought is maybe my finger was creating a ground in the wire, so I wrapped the INSULATED wire with one leg of a tube resistor, then connected the other leg to ground -- WOW!! THAT works perfectly.

Someone want tell me what's going on? I KNOW this is NOT a viable circuit, so how do I correct it? Meanwhile, she's working perfectly -- perfectly weird!

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png

A diagram is worth more than a thousand words.

Can you post a picture of your project so we can see your component layout?

Thanks.. Tom.,.. :slight_smile:

This is my circuit. I do NOT show the "Weird wire," which is a resistor with one leg to ground and the other leg wrapped around the insulation of the blue wire.

THAT IS NOT A 555 TIMER!!! That is an IC chip to represent my MCP4131!!

*TBH, the "Weird wire is not working so well anymore, but touching the INSULATION the blue wire with my finger makes it work. *

ALSO,
touching the Blue wire close to the UNO doesn't work. I have to touch the blue wire close to the MCP4131.

Hi,
Sorry but no circuit visible.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.

Tom... :slight_smile:

sorry about that, try this link:

And forgive me If I wade some error that is covered in the "How to use this forum." I'm uncertain which protocol I Violated...

Hi,
Ops image, its best to attach it to your post, rather than use links.

Sorry but a proper labelled circuit will be better, this is a Fritzy type picture and does not convey anywhere near the information needed.

Why are you trying to use the RESET pin to power the protoboard?

Even a hand drawn and labelled circuit would suffice.
Please label pins etc.

Tom... :slight_smile:

Digital pots aren't designed for power, just for signals (very little current). The MCP4131 is
rated for an absolute maximum of +/-2.5mA through the A/B/wiper connections.. An LED
is overloading the chip.

You are lacking a decoupling capacitor for the MCP4131 - all digital ICs need decoupling.

I presume the connection to RESET on the UNO is a mistake - best not to share diagrams
you haven't checked over (electronics is all about double-checking everything as it only
takes one error to prevent something from working (or fry a chip))

Strange operation like: "It works when I touch it!" may indicate that the circuit is oscillating at a high frequency.
Try adding the decoupling capacitor and changing to a good power input pin.

"Works when you touch it" is also sometimes due to breadboards or jumpers which are old, worn, or oxide coated. Plug-in breadboards are great from the standpoint of convenience, but not so great from the standpoint of robust and reliable connections.
S.

TomGeorge:
Why are you trying to use the RESET pin to power the protoboard?

I'm not, that should be on the 5V pin, I'll correct it and re-post

MarkT:
Digital pots aren't designed for power, just for signals (very little current). The MCP4131 is
rated for an absolute maximum of +/-2.5mA through the A/B/wiper connections.. An LED
is overloading the chip.

You are lacking a decoupling capacitor for the MCP4131 - all digital ICs need decoupling.

So this gets to the root of my problem... I am NOT wanting to run and LED, it was just the "practical" method to getting the concept working. the LED is actually representing a SyRen 50 Motor Controller (https://www.dimensionengineering.com/datasheets/SyRen50.pdf. I will be using this circuit to control a 24V 3/4HP DC motor to power a small cart carrying several hundreds of pounds - slowly.
It is possible to control the Syren50 with an arduino, but ultimately, I will not be using an Arduino, but a ESP32, so as to control the cart via Wi-Fi/webpage. The Syren50 will not accept the 3.3 volt logic from the ESP32, but it will accept control via potentiometer.
I had tried to get the Digital Pot to work with the ESP32, but was not having any luck, so I decided to make sure i COULD work this method (Syren50 controlled via Digital pot), then I would just have to work out getting the Digital Pot to respond to the ESP32.

Given your info on the amperage output of the MCP4131 and it's inability to power a simple LED, I'm curious to find out if this IC will power the Syren50....

Unfortunately, a "Decouplng capacitor" for this scenario is above current skill level. I tried to web search it, but if someone would like to guide me a bit, I'd appreciate it..
I have an awesome capacitor kit, so I probably have the one I need, just don't know how to hook it up. From what I'm reading, it seems I'd add one between Vcc and GRD, but how will that increase the power to my LED?

Update:

I added a 10V 43uf capacitor! Long leg between the "blue wire" and the MCP4131 and the short leg to an empty set of holes in the breadboard -

IT WORKS!!!!

if i detach the "short leg" from the board, the circuit doesn't work! If I connect the short leg to 5VDC or GRD the circuit doesn't work --

Pretty sure THIS is not correct electrical practice, but thsi is what it looks like:

What's the blue wire part of? Signal to your device?

I'm thinking you have a problem with digital noise (or RF coupling ) and a capacitor is helping to clean up the signal/information.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.