Pages: [1]   Go Down
Author Topic: Remote configuration  (Read 609 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


I'm just looking for ideas here. My project is still in the conceptual stage. It will be a controller for a greenhouse. I will need to collect measurements from many different locations and control a number of fans, vents, valves, etc. There are way too many for a single controller, so I envisioned driving an array of Arduinos from a Raspberry Pi. I thought I would use I2C since that leaves the most pins available.

The RPi would send each Arduino its pin configuration at initialization time, and the Arduinos would configure themselves from that info. During operation, the Arduinos would relay all measurements to the RPi, and the RPi would do its calcs and send back control info which the Arduinos would execute.

Since the Arduinos would just be message passers, they could all run exactly the same sketch. Except for one problem. They each need a unique I2C address. I really don't want to have to modify the sketch for each one just for its address. I also don't want to tie up any more pins than the I2C ones. The RPi needs to know each Arduino's address, preferably by assigning it from the database.

My first thought was to have the RPi reset each Arduino one at a time. During the init, it could tell the Arduino (over I2C with an initial address) which address to use and it could change to that address. The problem with that is that it would have to call wire.begin(<addr>) twice, and I'm not sure if that is allowed.

I also thought about multiplexing some of the digital pins and using them for config on startup, then switching them to their normal function for operation. I think this would restrict them for input only during operation, but I'm not sure about that.

I am open to any creative ways to do this. Any ideas?

Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 86
Posts: 3445
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could maybe look into CANbus communication. Not sure how many pins it uses though.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You dont say what area you have to cover, or how many points you have to collect data from, or which media,  but from my little bit of playing  the wireless modules , it sounds like a job for a mesh network ?   you could use Xbee or the cheaper RFM22B or SIM20 ??

Perhaps each Arduino can service its sensors and outputs in its immediate zone, and you could poll each in turn from the main unit?
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not familiar with mesh networking. I plan to co-locate all of the arduinos in the office where the environment is more electronics friendly. That puts them in close enough proximity to use I2C.

If I have to modify the arduino sketch for each individual, it's no major problem. I just wanted a way to mass produce and have some spares ready to go for additions and replacements.

I will probably have several dozen growing stations, each with monitors for soil moisture and incident light, and control for watering valve and grow-light intensity. The entire space will be monitored for temperature and humidity, and will control air vents, fans, misting systems, etc.
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you plan to wire  every sensor / solenoid / relay through to the office ?
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, they will all be wired through.

None of this is set in stone. I could possibly be persuaded to distribute the controllers throughout.
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


I am trying to choose a wireless module for my project, the RFM22B has 500m range but is rather confusing to set up and use,  but I am now looking at the XRF module that works straight out of the box, but you can configure it as a network/mesh.
You could possibly use these combined Arduino ( variant ) and radio module  at various places around your greenhouse :-


http://shop.ciseco.co.uk/radio-arduino-compatible-starter-kit-lowest-cost-in-the-world/



   (I havnt tried one yet )
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Boffin1. I'll check that out.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 200
Posts: 12773
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I thought I would use I2C since that leaves the most pins available.

RS-422, RS-485, CANBUS, LINBUS, and Ethernet are likely better choices.  It's a question of your expertise, your time, and your money.  If you have the knowledge and ability to get I2C working reliably over about 20 meters then it may be a good choice.  Otherwise, pick something else.

Quote
They each need a unique I2C address.

Store the address in EEPROM.

Quote
I am open to any creative ways to do this. Any ideas?

You don't need anything particularly creative.  People have been doing similar things for decades.  Store the minimum configuration in EEPROM (the address in your case).  Use an appropriate physical layer.  The rest is just sitting down and doing it (or stealing it).
Logged

Pages: [1]   Go Up
Jump to: