Tag Archives: a/d converter

My GrovePi Adventure

19 Nov

Here we go again . . . another story of following the instructions for a project exactly and failing miserably.  A while back, I got a GrovePi and a bunch of sensors.  It would be perfect for adding inputs to the Raspberry Pi since it has temperature, pressure, flame, light, sound, knock, distance, and more sensors.  So, first, I decided to try the joystick.  I went to the website for GrovePi and found instructions there (dexterindustries.com or seedstudio.com).  Wait . . . what?  The kit didn’t come with any cables.  Huh?  The one in the picture has a white plastic connector with four pins.  Mine has no connector and 5 pins!  What’s going on here?

I found out that the sensors that I bought on Amazon are not GrovePi sensors at all.  They are compatible . . . sort of, but they are not the GrovePi sensors.  They came with some connector wires (that don’t fit) and a ribbon cable (which is pretty useless).  The little instruction book only has a picture of each sensor and no instructions whatsoever.  There is an instruction manual online, but it sounds like it was written in another language and translated by a 4-year old.  Here are a couple of quotes:

“13 comes with digital interfaces of the LED, the shock sensor access number 3 interface, when a sense of shock sensor”

“The reason why we feel that infrared is really a wonderful thing, it is because we are invisible, intangible, but Okay, we do not need that, too, can control it and make it serve us, in fact, we are more magical, Is not?”

“The amount of points we can hand to block receiver module, see also the normal communication between them do? The following is the receive window Ah, looked at the window, and we all know it. . .”

I don’t mean to make fun of anyone and their English ability, but these sentences are so confusing that I cannot figure any of them out.  And it’s only written for Arduino (yuck!), not Raspberry Pi.

The reason for all of this is that I purchased a kit on Amazon called the SunFounder 37 modules Raspberry Pi Sensor Kit.  This kit is no longer available, but there are still Arduino kits like this one.  You can still get the old kit at Amazon.de, but I wouldn’t recommend it.

Bottom line is that the GrovePi is a great product.  It has solved all of the issues that I blogged about before with using analog sensors on the Raspberry Pi (here).  The GrovePi library has all of the code for accessing the analog ports on the GrovePi with simple code.  But I would highly recommend buying actual GrovePi sensors (like this one), not SunFounder sensors.  Support for GrovePi sensors on the Raspberry Pi is pretty good, but the software comes with sample code that can easily be modified to use most of the sensors and there are a few cool projects on their website (here).  (Note: This kit no longer says on the advertisement that it works with GrovePi and it comes with an instruction book.  I don’t have the book, so I cannot tell you if it’s good or not.)

I’ll blog later about how I used the code for the analog temperature sensor to make the SunFounder analog sensor work and then modified that code to make the Photo Resistor Sensor work with very few changes.  I’ve added some error handling that people on a forum told me about, so the program doesn’t crash anymore.  My ultimate goal is that some of the students at my school are planting an experimental citrus grove and we want to use moisture sensors to automatically trigger an irrigation system.  So, it would have about 40 moisture sensors and a couple of relays to trigger water pumps connected to a tank of reclaimed water.  We might also get a water flow meter to measure how much water we’ve used and track whether the system is working.

Raspberry Pi and the Science Fair

31 Jan

This will be my third year participating in science fair.  So far, I’ve won at the school and district and I’ve won medals at the county science fair the first two times.  This will be the first year that I can go to the state science fair!  “What should I do for my science fair project?” I wondered to myself.  I’d love to use my Raspberry Pi!  My dad showed me a “Sound Pressure Meter” that he has to measure how loud sounds are.  I wish I could turn my RPi into one of those and enter it into the Computer Science and Mathematics category.

I have a couple of USB microphones, but I don’t know how to connect to USB in Python.  So, I could connect a small microphone to the GPIO pins, but I think I’d need an analog to digital converter to do that.  I’d like to light a small LED if the sound level gets too loud.  Then, I can go around and test bus stops, bathrooms, school concerts, and headphones to see if they’re hurting our ears.  Also, I think that once I did this, then I could replace the microphone with a digital thermometer, Geiger counter, magnetic sensor, gyroscope, and other things using very similar programming.

I just ordered my mcp3008 analog to digital converter from the Adafruit store (https://www.adafruit.com/products/856).  I also snuck a wireless usb device in there too.  Right now, my TV is too far away from my router to be on the internet and on graphical Linux at the same time.  So, I either have to be online and ssh from the laptop to command line or connect to the TV and not have any internet access.  That’s a pain!  Now, I can be graphical and online at the same time!  I can’t wait for them to arrive!

What advice do you have for me as I work on my project?  What tutorials do you recommend?