Faster Sensor Reading Speed / Non RPi-compatible products


#1

Dear GrovePi and fellow Grovers, how are you all?

I have two questions

  1. I´m working on a (Raspberry Pi 3 + GrovePi) project where I am using the single axis gyro where different actions are triggered depending on the rotation speed of that sensor. How do I increase the speed of which the sensor data is read and displayed in the Python Shell? I have disabled all the time.sleep() in the GrovePi.py library, but this does not work. Does anybody know how I could do this?

  2. I bought the Grove DMX-module and the 3-axis gyro module, not knowing they were not compatible with the RPi. Is there some workaround to make these modules work on the RPi?

Thank you,

Liam


#2

Hey Liam,
The grove single axis gyro uses analog reads to read the data from the GrovePi and there is an inbuilt delay in the GrovePi library which lets the grovepi have enough time to read the command, take some action and load the results back into the buffer. I think that would be too high when using the analog gyro and you would be limited by some time delay. You might be able to use I2C Gyro’s which feed data directly to the Raspberry Pi bypassing the GrovePi. You can use a sensor like this: http://www.seeedstudio.com/depot/Grove-3Axis-Digital-Gyro-p-750.html?cPath=25_133. We don;t have the library for it but there is a library available for it here: https://github.com/beli-sk/IMU_sensors/blob/master/itg3200.py which would work.

The DMX is also not supported right now and after looking at the arduino implementation on the wiki it looks like it might be too difficult to integrate it in the GrovePi firmware.

There is a workaround to using both the sensors but that would require a lot of technical work. If you look at the GrovePi, it is nothing but an Arduino connected to the Pi which uses I2C to communicate to the Raspbbery Pi and SPI to upload the firmware. What you can do is come up with a firmware which would work on the GrovePi and do all the computation on the GrovePi itself. You can send data to the Pi once is a while using I2C when you want to communicate with it externally. If you want to take a dive into this, do let us know. I can send you some links which can help you get started with this.

-Karan


#3

Thanks a lot for the reply. I will have a look at the links you posted. About the DMX, it would have been a nice extra but I was planning to get a DMX table before I stumbled on this so I will return to plan A. Cheers!


#4

Karan, I would be interested in the links your were suggesting for liam37 that would help get started in writing firmware for the Arduino. Can you send them to me? I am hoping for an easier solution to the delays I am seeing in reading sensor data from the GrovePi but would be interested in looking at these just in case.
Thanks!


#5

@sully: We have had a couple of interesting posts on the forums dealing with updating the firmware and software. You can read more about them here, here and here.