2016-01-08 at 10:44 AM #1339
I see that much effort has been invested in connecting off-the-shelf SDI-12 sensors to an Arduino-based datalogger, and for good reason. I have the opposite challenge: integrating a custom sensor (a smart sensor with an Arduino brain) with an existing off-the-shelf SDI-12 datalogger already deployed at a field site.
Before expending the effort to write a SDI-12 “slave” library for Arduino, I thought I would inquire if anyone has already done so or has other relevant experience.
2016-01-26 at 11:00 AM #1347GSParticipant
Have you seen this project:
2016-01-28 at 5:11 PM #1371
Thanks! It will be a few weeks before I get a chance to try out this library live, but at first glance it appears to be almost exactly what I was planning to make.
2016-05-20 at 2:22 PM #1495
Update: I have succeeded in making an SDI-12 slave device on an Arduino Nano, but I have more work to do before my code can be generalized and distributed.
The project linked by GS is not really a slave-side library but rather an attempt to build a sketch implementing an SDI-12 slave with the SWRC’s SDI-12 master library. This did not work for me right out the box (for two reasons I’ll address shortly), but it did make me change course slightly. Instead of writing a new library, I added necessary functions to the SWRC SDI-12 master library to allow implementing a slave in my .ino.
The two “blocker” issues were:
– A master never has to listen for an unsolicited reply, so the master reverts to HOLDING state (which sets its SDI data pin to OUTPUT/LOW) after an action. A slave must default to LISTENING (data pin INPUT/LOW). There are several ways to accommodate this, but the least invasive is to add a public void “forceListen()” function.
– The linked example attempts to use “sendCommand()” to send a response to a command. While this does transmit the character stream per spec, there are problems: (1) wakeSensors() should not be called in a response and (2) a valid SDI-12 response requires first pulling the data line LOW for 8.33 ms. I added a public void sendResponse() function to accommodate these changes.
When I have time, I will work with SWRC to make a production version of the master/slave library and a generalized example implementation sketch. Since there’s no telling how long that will be, I thought I’d at least make the above info available to the ambitious developer. This, combined with the bones of the example sketch linked by GS, should get you started in the correct direction.
2016-08-09 at 1:26 PM #1697
2017-03-07 at 11:53 AM #2060
Update 3: Looks like EnviroDIY has merged my backward-compatible slave-side additions into their main library, so you don’t need my fork if you have the latest version. See example “g” for a slave implementation.
2017-03-08 at 9:59 AM #2061Anthony AufdenkampeParticipant
Danny, thanks for all your work on implementing these slave-side additions to our Arduino SDI-12 library (https://github.com/EnviroDIY/Arduino-SDI-12)! We really appreciate your contributions!
As you mentioned, @srgdamiano has been very actively working on all of the Arduino libraries that our Mayfly depends on for communicating with environmental sensors. See https://github.com/EnviroDIY/Libraries.
These libraries make it quite easy to use the example and workshop sketches in https://github.com/EnviroDIY/EnviroDIY_Mayfly_Logger.
The most exciting stuff, however, is in a new Modular Sensors library that we are developing not just for the EnviroDIY Mayfly but also for other Arduino-compatible boards (but we haven’t tested any of those yet!). See https://github.com/EnviroDIY/ModularSensors.
2017-03-24 at 4:34 PM #2110
2017-03-28 at 4:21 PM #2122Sara DamianoModerator
I’d love any feedback you have on the modular sensors library! Feel free to post GitHub issues or post comments in the forums.
The Libraries repository doesn’t actually have anything new on its own, it’s just a bunch of links so anyone can download some of the more helpful libraries all at once. Do let me know if you think there are any crucial libraries that are missing!
- You must be logged in to reply to this topic.