LCD shield button problem when stacked on motor shield

I have an Uno R3 and am using it to control a motor via input received from an LCD shield.

Stacked together, I have the Uno, then the motor shield (Deek Robbot Motorshield R3), then the DFRobot LCD shield v1.1.

The problem is that with the LCD shield connected through the motor shield, the ADC values I get from the input buttons are much lower than they are when the LCD is stacked directly on the Uno.

This means when I press, say the 'Select' button it will give an actual ADC value of 174 instead of something over 800. Then the 'Left' button gives an ADC value of 173 - which is far too close to 'Select' and results in spurious input when the values fluctuate.

I'm new to Arduino and am wondering if I'm missing something? How should a motor shield and an LCD shield be used together if the button values can't be reliably read? What am I doing wrong?

Thanks for the help!

Cheers,
Peter

Welcome to the forum.

I like links (a lot of them).
I can not find the Deek Robbot Motorshield R3. Is that a copy of this DFRobot shield: https://www.dfrobot.com/product-1395.html (links to a schematic do not work).
DFRobot LCD shield: https://www.dfrobot.com/product-51.html (with a schematic).

You bought cheap stuff :wink: That's only thing that you did wrong.

Reading 5 buttons with a single analog pin is a bad idea. I am very against it. If it works, then it is only a matter of time before there are troubles with it.
That motor shield uses a L298P, that is very old. Today, mosfet drivers are used.

I think one of the pins does not make good contact (because it is so cheap), or perhaps you don't have enough power (for example when using a 9V battery). It could be something else, but I can't find a schematic of the motor shield.

Thanks for the quick reply!

The motor shield is this one: https://www.amazon.co.uk/dp/B01LVXM0JS/ref=pe_27063361_487055811_TE_dp_f1 - looks like it is a copy of the DFRobot shield you linked to.

The LCD shield is this one: https://www.amazon.co.uk/dp/B006D903KE/ref=pe_27063361_487055811_TE_dp_f1

I'm not keen on the way the keypad works either, seems error prone! You're probably correct about the cheap components then. I'm supplying good 12v power, and the motor is running well.

So, looks like I'll upgrade the components. Would you recommend a motor shield and LCD shield that would work well? I just need to do basic selections from a menu that affect motor operation (direction, speed, time). The motor I'm running is a 12V/30RPM geared motor - not a stepper motor.

Thanks again,
Peter

:+1: A good seller selects good components, does not cheap out on decoupling capacitors, shows a schematic, and sometimes even a tutorial, and sometimes a forum to ask questions.

:-1: Bad quality causes problems when you don't expect it. For example a SD card socket that does not have good contacts, or a noisy board that stops working with another noisy board, a fake sensor that breaks at a certain temperature, a soil moisture sensor that lasts only a week, a rechargeable battery that is overloaded, and so on, the list is endless.
Maybe we should have a poll: what percentage of AliExpress/Ebay/Amazon cheap electronic modules is really really bad. My guess is 50%.

Start with real Arduino things.
Hmmm :thinking: I didn't know that Arduino has the same motor shield: https://store.arduino.cc/products/arduino-motor-shield-rev3
Or make a step forward with the MKR boards. Add a MKR Zero to this shield: https://store.arduino.cc/collections/shields/products/arduino-mkr-motor-carrier

Have a look at Adafruit, they make the best tutorials.
This is their well known motorshield: https://www.adafruit.com/product/1438

Sparkfun has this motor shield, simple and good: https://www.sparkfun.com/products/14451

Pololu is specialized in power and motor drivers: https://www.pololu.com/category/11/brushed-dc-motor-drivers

The most important thing is the stall current of your motor.
If you motor is 500mA average current, and the stall current is 10A, then you need a motor shield (or "driver" module) that can deal with 10A and you need a power supply that give 10A.

In the photos, the pins seems like good square solid pins. Do they look the same on your shields ? If I were you, I have a good look at the shield and if they look okay, then I would use them.
Do you have a multimeter ? Then you can measure the voltage at the analog pin and check why it changes with the motor shield.

Maybe you need a normal LCD module/shield anyway. This is a normal LCD shield: https://learn.adafruit.com/assets/36490.
There are probably cheap clones of that shield on Amazon. But if you have to throw away the cheap rubbish because it works only for a day or two, then you better aim higher and spend some money.

Sorry for the long post :face_with_raised_eyebrow:

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