Connecting schematis


#1

Hello,

I have a RPi and Arduino. I was wondering, if GrovePi uses the same chip as Arduino Uno therefore I can “convert” Arduino to GrovePi. Is there a diagram, or schematics that would show witch pin from RPi goes to witch on ATMega328. That would be so great!

Rok


#2

Hi Rok,
The pinouts on both the GrovePi and the Arduino is almost the same. The difficult part is getting the level conversion right. The Raspberry Pi runs at 3.3v and the Arduino at 5V. You’ll need proper level conversion so that both can talk to each other properly otherwise there’s always a danger that you can end up destroying both your boards.

If you just want to access the pins from the Raspberry Pi, then Arduberry( http://www.dexterindustries.com/Arduberry/ ) might be something that you might be interested in.

All our hardware is open source so you can check out the details here: https://github.com/DexterInd/GrovePi/tree/master/Hardware .

Thanks,
Karan


#3

Ok, so if have level conversion solved, witch pin from ATMega328 goes to witch GPIO. Where can I find that documentation?


#4

Hey Rok, I think that would totally depend on the design you’re trying to make. Are you trying to use the Arduberry or the GrovePi?


#5

Hi, I’m trying to make GrovePi.


#6

Hey Rok, are you trying to make the GrovePi yourself? The schematics should be available for doing that.


#7

Yes, I’m trying to make it myself. So … do you know, how to connect GPIO pins to ATMega, because I can’t find the schematis?
Thanks


#8

Hi Rok,
The GPIO pins that are connected to the AT328 are the Serial, I2C and the SPI lines with proper level conversion. Other pins are not connected.

Instead of individually controlling each pins, the Raspberry Pi sends the GrovePi a command to do an operation. The GrovePi receives the command interprets it and performs the action.All this hapopens on the I2C line. We have SPI also connected for uploading the code.


#9

Hello,

  1. I have seen Arduino Mini 5V 16Mhz being powered at 3V3 and still run smoothly. So instead of a level converter, I can directly power the Arduino Mini from the 3V3 power of the raspi and direct connect all the I/Os between raspi and arduino. Is it possible this way?

  2. Since the arduino is being programmed via ICSP (ISP lines), does it still need the arduino bootloader?

  3. Can I program the arduino mini (with the bootloader) with the latest GrovePi firmware as shown here (https://github.com/DexterInd/GrovePi/blob/master/Firmware/Source/v1.2/grove_pi_v1_2_6/grove_pi_v1_2_6.ino) ?

  4. I havent looked in the code yet, is it similar to firmata? And communication is done by i2c?

  5. I have seen Firmata using serial, is the serial line now free to use?

  6. How to use i2c on other devices that uses i2c?

regards,

Victor


#10

Hey Victor,

  1. On paper you can run the GrovePi at 3.3V but we have never tried and and don’t recommened it too because the Atmega328 is rated to work at 12Mhz at 3.3V, it might become unreliable after that. Also, all the grove sensors expect 5V, so they might also become unreliable and the Pi 3.3V supply can give max of 50mA which is not a lot.
  2. It does not need the bootloader, though you can still use it if you want, but ISP is much better.
  3. Arduino mini with the GrovePi firmware should work. Be a bit careful wit the pin assignment
  4. Yeah, the GrovePi is similar to firmwata in terms of how it works with the exception that everything is optimized to work on I2C
  5. Yeah, serial is free to use
  6. You can connect any I2C device on the I2C lines which does not use the address 0x04.

-Karan


#11

Hello Karan,

Thanks for the prompt response.

I was able to test the nano on 3v3 and it working fine. I flashed the firmware version v1.2.6 via USB (of course) and interface only the i2c lines to the Rpi.
I am planning to buy this http://www.banggood.com/I2C-IIC-Level-Conversion-Module-Sensor-5V-3V-System-Compatible-p-922095.html.

I am evaluating the usefulness of GrovePi and wyliodrin in my father’s house to send predermined messages (that one I am still thinking what to use, email or other similar strategy). Also I need to send messages between 2 Rpi to flash a few sets of LED to depending on what button my father pressed (which in this case tells me what kind of problem he is having). Though, flashing LED can b done by Rpi via wyliodrin.

GrovePi is used extensively in Wyliodrin and also useful for kids to learn programming. I am also considering Modkit to teach my kids to learn programming.

I got curious by GrovePi and wanted to build one for my self becoz I want to try the buzzer program in the Wyliodrin example as show below;

=============================
from wyliodrin import *

import os

from time import *

from threading import Timer

if os.getenv (“wyliodrin_board”) == “raspberrypi”:
grove = 300
grovepiSetup (grove, 4)
else:
grove = 0

pinMode (5, 1)

def loopCode():
analogWrite (grove+5, 20)
digitalWrite (grove+5, 1)
sleep (1)
analogWrite (grove+5, 50)
digitalWrite (grove+5, 1)
sleep (1)
analogWrite (grove+5, 100)
digitalWrite (grove+5, 1)
sleep (1)
digitalWrite (grove+5, 0)
Timer(1, loopCode).start()
loopCode()

It seems the IO is only sending high low in interval of 1sec. Do you have that kind of buzzer?

So I modified the code and increase the freq:

=================
from wyliodrin import *

import os

from time import *

if os.getenv (“wyliodrin_board”) == “raspberrypi”:
grove = 300
grovepiSetup (grove, 4)
else:
grove = 0

pinMode (5, 1)

for count in range(1000):
digitalWrite (grove+5, 1)
sleep ((1)/1000.0)
digitalWrite (grove+5, 1)
sleep ((1)/1000.0)

Thanks again and best regards,

Victor


#12

Hey Victor,
Great to hear that the setup is working. That level converter should work form the looks of it but I cannot guarantee it.

If you are looking for something for your kids, we have two other robots: http://www.dexterindustries.com/GoPiGo/ and http://www.dexterindustries.com/BrickPi/ and also have a ciricullum around the GoPiGo http://www.dexterindustries.com/gobox-robot-subscription/.

Do let us know if you have any more questions.