I checked the schematics for the motor driver and the batteries are indeed supplying the power to the whole motor driver even for the comms. The regulator used is a 7508 and has a big dropout so you should use good batteries and at least 6 batteries.
The motor driver also uses an Atmega8 for interpreting the commands, so you can even rewrite the code on that if you want later if you feel like adding some features or making it easier to use.
thanks karen, ill buy a 6 battery case today and new batteries and test it out, then let you know.
I will have to learn about the Atmega8, but I would be up for adding said features to my library
it seems there was a need for a python library for this driver. So hoping I can get this working and provide the community with the library i create/translate.
Do let us know how the driver work with a 6 battery pack.
Atmega8 is similar to the Atmega328 which is used with Arduino so you should be able to write the code for it in the Arduino IDE itself if you ever want to.
It would be great if you are able to get the driver for the motor controller working with the GrovePi. We would be glad to merge it with the GrovePi repository so that others can use it too.
I added 2 aa batteries to the mix and the result is the same. I noticed now that the raspberry pi can be powered by the ic2 input alone. Is this normal/safe?
So my current setup is
8AAs(9v)–Motor Driver --Grove Pi I2C1 port – Raspberry Pi
entering i2cdetect shows my Grove at address 0x04 and my driver at 0x0f. After hitting the command again both addresses are gone. (showing --)
as well as running my code gives an input/output error when trying to read/write
It would be better to power the GrovePi separately and not use the motor controller to back power it.
I am not sure what the problem is exactly. Can you try to measure the voltage on the 9V line and the 5V line to see what it says. Also, do you have and Arduino and a Grove Arduino shield to check if the board works with Arduino. That might be a better test to find if the Shield works or not.
Hey Exadon and Karan, I’m coming late to the party here. Sorry about that. I have a few quick questions, and thoughts.
It sounds like the I2C is getting hung up on the driver. It seems like you ping it once, and the device freezes up.
First, since there’s an Atmega8 on the driver, I wonder if there’s a software error, or hardware error. Have we doubled back and seen if there are any comments on the Seeed site about this? I’m just curious.
Also, because we have multiple devices on the line, with multiple pullups, we might also be pulling the I2C lines high (or they’re getting stuck high). Exadon, do you feel adventurous enough to pull the pullup resistors off the sensor and see if affectss things? I’m leaning even more strongly to this because the behavior when you remove the sensor; it seems to work, and the line seems to be released.
Hey Exadon,
No problems, you have laid a good foundation for someone else who comes looking for the code for the motor driver and this should be a good starting point for others in the future.
Do let us know if you get a chance in the future to test the driver more.
Hey Exadon,
I just checked the eagle design files for the Motor controller and it does not look like that it has pullups at all on the motor controller. This can or cannot be a problem and the only to way to check that would be with a logic analyzer. There are two things that you should try: 1) try connecting that motor controller to the GrovePi with the shortest cable that you have and 2) try connecting the motor shield directly to the raspberry pi on the I2C pins, VCCC and GND to see if that helps.
I have exactly the same problem (IOErrors and I2C bus fail after i2cdetect command) with my setup (motor driver 1.3, GrovePi+, Pi B), with and without external power supply.
We haven’t tried the motor controller again and other users had problems, even when connecting it to the Pi. Can you try the example that we have here and tell us how it goes. Please do read the notes given in the comment section of the program. It is pretty sensitive to errors and commands sent to it, can get stuck.
I have tested it with the example script and, after many failed attempts, managed to get it to work. It is indeed very sensitive and the only reasonably certain way to get my motor to spin is when I reboot the PI, run “avrdude -c gpio -p m328p” to reset the GrovePi and then reset the driver board by pressing its reset button. Make sure NOT to run any i2cdetect commands at any time. If you do, you will have to start all over again.
If you then run the example script it will probably fail with the dreaded IOError nr. 5. If you run it again after a few seconds, it will work correctly and your motor will start to spin. From then on it appears to continue to work fine. Well at least a dozen times or so. Haven’t done more extensive testing.
So it looks like the i2c bus needs a little while to initialize after a clean start or maybe it does so after a failed first attempt to address it.
Not an ideal situation but at least I can continue my project.
Hey @ErPi,
We had seen pretty similar behavior when we had tried it and were and there was not a lot we could do because the firmware on the motor driver was not available to hack around and test. It looks like Seeed has just released that firmware and the next time we are working on the motor driver, we see if there is a way to make it more stable. Not ETA on this though.