Page 1 of 1

Interfacing ATmega 32 with RaspberryPi 3

Posted: Mon May 08, 2017 7:40 pm
by vaibhavcrane
Hello, I want to interface 4 ATmega 32 microcontrollers with RaspberryPi 3. These controllers will be placed in various rooms and monitoring various sensors. So I was planning that atmega will read the data and pass it to raspberry pi using i2c.
Is it possible to interface atmega with RaspberryPi or is there a better way to do it?

Re: Interfacing ATmega 32 with RaspberryPi 3

Posted: Mon May 08, 2017 8:48 pm
by mikronauts
I2C is the wrong choice for wiring between rooms.

Google "RS485" for a good choice, and there are plenty of RS485 interface chips.
vaibhavcrane wrote:Hello, I want to interface 4 ATmega 32 microcontrollers with RaspberryPi 3. These controllers will be placed in various rooms and monitoring various sensors. So I was planning that atmega will read the data and pass it to raspberry pi using i2c.
Is it possible to interface atmega with RaspberryPi or is there a better way to do it?

Re: Interfacing ATmega 32 with RaspberryPi 3

Posted: Mon May 15, 2017 12:39 am
by HardwareJon
Additional info:

mikronauts is absolutely correct. The I2C bus is designed to allow components to communicate when they exist on the same PC Board. There is some leeway on that but not room to room and certainly not when the power supplies are separated.

John

Re: Interfacing ATmega 32 with RaspberryPi 3

Posted: Mon May 15, 2017 3:36 pm
by MarkDH102
I do something very similar.
I have 6 ATMEGA328P devices dotted around my house and summerhouse. They are all connected to various sensors AND RF transceivers (433MHz). They are all battery powered (I build the units myself on veroboard to keep power requirements down)
There is a 7th ATMEGA328P with a transceiver. This gets messages from all the other units. It sits right next to a PI Zero and is connected via a SPI interface (6cm of cable). The Pi then handles all the logic and emailing and alerts and displays various graphics on a connected touch screen. If it was a Pi2 or Pi3 it would be easy to find a spare USB to connect a standard Arduino UNO and communicate that way.

Re: Interfacing ATmega 32 with RaspberryPi 3

Posted: Tue May 16, 2017 9:35 pm
by spich
You might want to check out the work at lowpowerlab.com. The fellow there has what MarkDH102 describes already set up for low power and wireless network connectivity. The idea is that each location of sensors is a "mote" (GarageMote, SwitchMote, ...) that talks back to the host (PC, RPi,...) via another "mote" acting as a gateway. Each mote is an Arduino compatible ATmega board. The motes all communicate using radio based on the RFM69 (and other) transceivers. He has lots of examples of both hardware and software.

- spich
(I have no affiliation with LowPowerLab)