I am using a grove pi with a Raspberry Pi 3, and an Adafruit MotorHat on a Robot. The grove pi is connected to two ultrasonic rangers. We have 4 of the robots running a lot of different cod but they all are plagued with intermittent fails of the grove pi and the orange reset led coming on. We are using Python 2.7. I used the debugger to step through the program to find any problematic code. I captured the attached screen shot. Can you help me figure out what may be causing these errors, IOErrors and TypeErrors.
Can you post a picture of your setup with the GrovePi when you have this issue and also follow this guide , generate a test log and post it along with your reply.
Shoban, Thanks for your reply. I am not using raspbian for robots OS. I am using raspbian. Is there a diagnotic that can run in raspbian?
Yes you can test the GrovePi in Raspbian os , following the instructions given in the ReadME here. Let us know if you need for information.
Thanks. I ran the script and obtained the following data.
log.txt (5.8 KB)
A picture of the set up is attached. IN this case only D3 on the Grovepi is being used. It is running a SEED Ultrasonic Ranger which is not reading back data correctly.
Thanks for looking at this.
What I2C addresses are the other two shields using? Could they be pulling the reset or could the code that runs them be pulling the reset button on the GrovePi+?
JohnC, The motor shield appears to be using 60 and 70 while the grovepi is using 04. I verified this by running i2cdetect and removing the various shields one by one. Does this tell us anything?
The top shield is just a voltage divider and is not using an i2c address… It takes 5V logic and knocks it down to 3V logic. The reset only occurs when the motors are running. They generate a lot of electrical noise. In fact I have been able to reduce the occurance of resets by putting a 2700uF cap on the DC motor supply. Do the diagnostic logs point to anything? What do you think is causing the reset?
Can you do another test, just to confirm that there is no problem with GrovePi. Can you just have the GrovePi connected to your Raspberry Pi and test if your ultrasonic sensor is reading values properly. Also if this works then can you provide us a link to the Adafruit Motor hat that you are using.
Yes the GrovePi works fine if I am using it without the motor hat. Even with the motor hat it works fine. Its only when I turn on the motors that problems happen. I have been able to reduce the IOErrors and misreads of 0 cm for example by adding a 2700uF cap to the the motor supply. The link for the motor hat is as follows:
Any insight into root cause on this that you could provide would be greatly appreciated.
BTW, looks like I have two accounts with you. Both sully and enzo are me.
The logs don’t show anything obvious which might be causing the problem, however your experiments point to the power supply and motors as a culprit.
I did check the design of the Adafruit hat and had a quick question about the power supply you have. Can you describe a bit about how you are powering the Pi, GrovePi, Adafruit HAT and the motor. Also, what do you need the 3.3V from the top shield for.
The GrovePi would reset if something on pin 25 on the header would toggle. Nothing seems to be connected to it right now however a lot of noise on the 5V or 3.3V lines might also cause problems.
It would be really great if you could get your hands on a logic analyzer or a oscilloscope and probe what is going on with the 5V and 3.3V.
Karan, Thanks for the reply.
I have a Zilu 4400mAh, 5V, 2A supply running the Raspberry Pi. Separately, I have 4 total 1.5V AA batteries in series with an ouput of around 6.0V powering the Motor Hat which is controlling two DC motors (DFRobot Mobile Platform) and a 7W audio amplifier. The amplifier is used to run a speaker that makes announcements depending on the location of the robot. The power to the audio amp and the motors is run through a toggle switch.
The 3.3V top shied is used in place of digital ports on the Grove Pi. I have three SEEED IR sensors used for line following and path navigation. I found that if I ran these sensors through the Grove Pi, the 25msec delay (even after changing the default settings in the Grove Pi library) required the robot to run very slowly. So I sense the 5V logic output from the IR sensors using Raspberry Pi GPIO pins, but divide a 5V high down to 3.3V in the 3.3V hat.
Thank you for pointing out the sensitivity of the GrovePi to Voltage levels on pin 25. If I am correct, this should be ground. I wlll get a scope and see whats happening on this pin while the robot is running.