craigcurtin
Posts: 10
Joined: Wed Nov 14, 2012 10:07 pm

Advice on Arduino integration and Weather Grabbing

Wed Jun 05, 2013 5:47 am

Guys,

I have an Arduino that is running my home heating system (i am just in transition to this from a Picaxe based system).

I intend to integrate my Rpi and the Arduino through i2c.

I intend to continue to use the Arduino to provide the heavy lifting and managing of sensors, relays and the like.

I intend to use the Pi to present a Web interface that will initially provide information and longer term provide some manual control of the system.

My heating system is a hydronic based system that heats our concrete slab and concrete walls - it is therefore slow to react to changes - usually lags by about 4 to 5 hours or so.

Currently the system is driven by time based events and also temperature set points - however during the day the vast majority of my heat comes through a solar hot water system (cold days and evenings it is driven by a gas fired boiler).

What i would like to be able to do with the Pi is to grab the local weather data - in particular levels of cloud cover and high and low temperatures for the day - i then want to parse this and provide it to the Arduino through i2c to provide finer grained control than i currently have.

I am new to Linux programming - but would like some pointers on the best way to approach this - from what i have been able to find so far it would appear that Python would be the preferred language to do the web grabbing and parsing and then to push the data across to the Arduino.

I can not find very much on using i2c with the Pi and Python - can anyone give me some pointers or links please ?

regards

Craig

sprinkmeier
Posts: 410
Joined: Mon Feb 04, 2013 10:48 am
Contact: Website

Re: Advice on Arduino integration and Weather Grabbing

Wed Jun 05, 2013 9:40 am

craigcurtin wrote:I can not find very much on using i2c with the Pi and Python - can anyone give me some pointers or links please ?
The Arduino's I2C is running at 5V, the Pi at 3.3V
Make sure to add a level shifter in your circuit else you'll fry the Pi.

Have you considered USB? simply plug in the Arduino and access it as a serial port (/dev/ttyACM0)

craigcurtin
Posts: 10
Joined: Wed Nov 14, 2012 10:07 pm

Re: Advice on Arduino integration and Weather Grabbing

Wed Jun 05, 2013 10:05 am

Yep already go the level shifting happening - not a problem thanks.

I already have i2c in place so no dramas there - easier than parsing text streams etc.

Craig

User avatar
liudr
Posts: 687
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Re: Advice on Arduino integration and Weather Grabbing

Wed Jun 05, 2013 1:09 pm

Don't you just need the PI to enable /add pullups to 3.3V on the SCL and SDA instead of level shifting? The point of open drain is to not worry about the actual voltage, right?
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

craigcurtin
Posts: 10
Joined: Wed Nov 14, 2012 10:07 pm

Re: Advice on Arduino integration and Weather Grabbing

Wed Jun 05, 2013 6:06 pm

I believe that is correct from my reading - AS LONG AS the Pi is the master - but i have read if there are multiple other devices on the bus at 5v then it is a safer idea to have a level shifter. The whole module only costs $3-$4 on EBAY so it is a good insurance option.

Craig

Return to “General programming discussion”