Motor Shield v2.0

Moderators: Voyager, BertB, rtenklooster, Stuntteam, grovkillen, TD-er

Post Reply
Message
Author
kirelam
Normal user
Posts: 10
Joined: 04 Apr 2016, 12:10
Location: Westervoort

Motor Shield v2.0

#1 Post by kirelam » 11 Mar 2019, 10:12

Dear users,

I have bought 2 motor shields V2.0 now (Aliexpress versions)(both failed). I tried to use it through I2C to my D1 Mini.
To do this i had to cut the logic line to 5v and make connection from the center pad to the 3.3v pad next to it.

I got I2C adresses, but there it is! E
very time i refresh, i get a different I2C adress, where this should be 0x60.
Anyone got an idee how and why this is, or did i just break it?

Supplied 12V to the power inlet and connect neatly through the D4 and D5 (Cl and DA)
I just want to use 1 stepper motor for my chicken feeding system (Gause worm system).

Regards,
Kirelam

ThomasB
Normal user
Posts: 222
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Motor Shield v2.0

#2 Post by ThomasB » 11 Mar 2019, 18:32

Code: Select all

Supplied 12V to the power inlet and connect neatly through the D4 and D5 (Cl and DA)
According to the Wemos Mini D1 Wiki, the I2C SCL is D1 (GPIO-5) and SDA is D2 (GPIO-4).
https://wiki.wemos.cc/products:d1:d1_mini
https://steve.fi/Hardware/d1-pins/

- Thomas

kirelam
Normal user
Posts: 10
Joined: 04 Apr 2016, 12:10
Location: Westervoort

Re: Motor Shield v2.0

#3 Post by kirelam » 12 Mar 2019, 08:35

good awnser. i wrote it the other way arround. I tried switching them, but then offcourse you get no signal.

So i would like to know if other people have this problem en if so, what did they do to get arround it?


ThomasB
Normal user
Posts: 222
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Motor Shield v2.0

#5 Post by ThomasB » 12 Mar 2019, 16:50

very time i refresh, i get a different I2C adress, where this should be 0x60.
Regarding the random i2C address when you refresh, do you mean you are using ESPEasy's I2C scanner? If that is the case then maybe that tool is broken. I'm not saying I know for a fact it is broken, but it is possible. Every release seems to add new challenges, so you have to be fast on your feet and expect the unexpected.
So i would like to know if other people have this problem en if so, what did they do to get arround it?
For full transparency I've never used it. The Wemos Motor Shield plugin is a recent addition, so not a lot of history to go by. You might be one of the first end-users to try it out.

FWIW, see the wiki link posted by TungstenE2, who I believe created this plugin. The wiki mentions reflashing the motorshield's firmware.

Lastly, use short wire connections to SDA and SCL to minimize I2C signal degradation. For initial testing I suggest no longer than 2-3 inches. After it is working you can try using longer wires if necessary.

- Thomas

TD-er
Normal user
Posts: 1194
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Motor Shield v2.0

#6 Post by TD-er » 12 Mar 2019, 22:56

That motor shield is a bit strange with regards to I2C.
If the number of bytes sent to it isn't a multiple of 4 bytes, then it will lock the I2C bus.

kirelam
Normal user
Posts: 10
Joined: 04 Apr 2016, 12:10
Location: Westervoort

Re: Motor Shield v2.0

#7 Post by kirelam » 13 Mar 2019, 09:33

Lock the I2C bus? What does that meen, As in not usable for that moment?

I ordered the Wemos motor shield (Thanx) Hope it will support Stepper motor.
If so i will report the whole proces and project as it is here for future review.

ThomasB
Normal user
Posts: 222
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Motor Shield v2.0

#8 Post by ThomasB » 13 Mar 2019, 18:18

Hmm. It seems there's some overall confusion about the hardware you purchased.

The ongoing comments have been for the Wemos Motor Shield clone that is sold by AliExpress. This one:
https://www.letscontrolit.com/wiki/inde ... otorshield

But there is another motor shield sold by AliExpress that is a clone of the Adafruit Arduino Motor Shield. This one:
https://www.letscontrolit.com/wiki/inde ... ield_v2%22

These two boards are completely different designs and use different ESPEasy plugins. The Wemos motor shield uses an STM processor that has buggy code that is known to crash the I2C buss (may require power cycle to clear). This issue can be solved by reflashing the board with updated firmware, per the plugin's info stated in the letscontrolit wiki.

But maybe you have the Arduino Motor Shield instead of the Wemos motor shield? Please confirm by providing a link to the AliExpress board that you are trying to use.

If you have the Arduino Motor Shield then it does not suffer from i2c lockups due to bad STM firmware. That is because it uses a PCA9865 PWM driver chip instead of the poorly coded STM processor.

So after rethinking the situation (with the Arduino Motor Shield in mind} this list summarizes the situation:
1. You have modified the motor shield for 3.3V logic (cut trace, jump 3.3V pad).
2. You connected SDA and SCL with jumper wires. Note: These must be short wires!
3. Powered the motor shield with 12V.
4. Powered the Wemos D1 Mini by USB.
5. Motor shield does not work. I2C address is randomly reported by I2C scan (?).

But it is unknown if you have connected a common ground wire from the motor shield to the Wemos D1 Mini. The common ground is required. Have you done this?
Edit: Also connect 3.3V from the Wemos to the Motor Shield 3.3V pin. I do not know if the Wemos VReg can reliably provide the necessary current for this.

For more help please post good photos that clearly show how you have wired everything. The little details matter.

- Thomas

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests