Home › Forums › Environmental Sensors › Connecting Arduino MEGA or NANO with Teros 12 Sensor
- This topic has 10 replies, 2 voices, and was last updated 2025-01-21 at 1:19 PM by Shannon Hicks.
-
AuthorPosts
-
-
2025-01-14 at 6:12 AM #18821
I’m new when it comes to SDI-12 sensors. Can someone help me connecting Arduino Mega or Nano to the Teros 12. A basic pin configuration & which code to run to check whether the data is being read would be really helpful.
-
2025-01-14 at 11:27 AM #18822
-
2025-01-14 at 7:43 PM #18823
How many sensors are you wanting to connect to your Arduino board? Do you have a Mega, or Nano, or both? What sort of termination is on the end of your sensors? Are you just wanting to display instantaneous sensor data on your computer or are you trying to build a logging device?
-
2025-01-15 at 12:50 AM #18824
@shicks For now I want to connect one Teros 12 but in future want to connect four. Also I have both Mega & Nano with me. The output is an audio jack for which I have bought a trs 3.5mm breakout board. I just want to display the sensor data on my computer & use a esp module to display it on some website for future purposes
-
-
2025-01-15 at 4:20 PM #18827
I’ve attached a screenshot from Meter Group’s Teros 12 Integrator Guide. It shows the wiring scheme for the bare-wire version and the 3.5mm stereo plug version. If you’ve got the sensor with the 3.5mm plug, then you’ll need to compare this diagram to whatever breakout board you’re using to match the tip, ring, and sleeve to the power, ground, and data lines.
Then you can connect those 3 lines to whichever board you’re using. Power to Vcc (3.3v or 5v, depending on your board’s operating voltage). Ground to Ground. Data to a digital pin. We usually use D7 in our example sketches because that’s the line on the Mayfly’s dedicated SDI12 Grove jack. If you’re using a different board, you can select the pin, as long as it’s free and not used by anything else in your sketch or on-board circuitry.
The sketches you could use to communicate with the sensor can be found on our Github repo here: https://github.com/EnviroDIY/Arduino-SDI-12
Note that Meter Group’s sensors always get shipped to you on SDI12 channel 0 (zero). They MUST be changed to something other than 0 in order to make the sensor respond to SDI12 commands. Otherwise, they are stuck in their default TTL serial mode, which isn’t great if you want to use more than one sensor on the same bus. So use the example sketch named “b_address_change” to set the channel on your sensor. Once you do this the first time, you won’t have to do it again, the sensor will remember this preference until you manually change it at a later date.
How you can use any of the other examples for the SDI12 library to query the sensor and display the data to Arduino IDE’s Serial Monitor. If you want to integrate other hardware like a wifi board or other telemetry module, you’ll have to write your own sketches, since all our other examples are mainly written for the EnviroDIY Mayfly Data Logger board, which has a onboard microSD card socket, realtime clock, and xbee socket for compatible telemetry modules like wifi, cellular, LoRa, etc.
Attachments:
-
2025-01-21 at 9:02 AM #18834
@shicks I had a doubt related to the baud rate mentioned in the example sketches which is “115200” but for SDI-12 configuration of TEROS 12 its “1200”. Should I change it? Also if I change the address of the sensor will I be able to obtain data from the data logger provided by METER or do I have to set it to “0” each & every time I have to access the data logger?
-
2025-01-21 at 10:10 AM #18835
The baud rate in the example sketches is usually 57600 or 115200, which is the rate for the Arduino board’s serial output port that it uses to communicate with your computer, not the sensor. For whatever rate you choose, you have to manually change your IDE’s baud rate to match, otherwise you’ll just get gibberish on the monitor. The baud rate of the SDI12 sensor port (pin 7 in most examples because of how the Mayfly board is wired) is hard-coded to 1200 in the library files and can’t (or shouldn’t) be easily changed by end users.
If you use a Meter sensor on a Meter logger, it MUST be set to channel 0. Their logger will not communicate with any sensor that has an address other than 0. So if you change your sensor address to 1 (or A, or x, or any other valid SDI12 address) to use with your Arduino board, in the future if you want to put that sensor on a Meter brand logger, you’ll have to use your Arduino board and the b_change_address sketch again to change it back to 0. Alternatively, if you think you’ll be doing this switching a lot, it would be worth it to get one of the ZSC modules from Meter. It’s a low cost device that uses a bluetooth connection and an app on your phone to read and configure Meter sensors. It’s great for reading live sensor data and changing SDI12 addresses.
-
-
2025-01-21 at 12:08 PM #18836
@shicks When I try the “b_address_change” its giving some gibberish output. What could be the reason?
113:12:30.112 -> ��fx������~��<code>���x�f~������怘�</code>f�f�f�f~~�ffx����憆���������f�~fxf���~����fx�������~f�<code>�x��������怘��f����f���~��x</code>��fx�����������f~f�fx怘�������f<code></code>f���ff��fx��xx��fx���<code>���x���fx�������~��xfx��~��x</code>��fx���怘�f��<code>fx�f�~��x</code>��fx����怘 -
2025-01-21 at 1:14 PM #18837
Did you make sure the sensor is properly wired to your Mega, (tip to 5v, sleeve to GND, and ring to data) and that the pin number in the sketch matches whatever pin number you connected the data line to? If all the wiring is correct, then it might be an issue with the latest SDI12 library that a few people have reported. You could try replacing all of the latest SDI12 library files you downloaded (the entire folder) and replace it with a stable legacy version (v2.1.4) from a few years ago (https://github.com/EnviroDIY/Arduino-SDI-12/tree/v2.1.4) and see if that fixes it.
-
2025-01-21 at 1:16 PM #18838
@shicks Its working now. Thank you. But the issue is with the b_address_change sketch. This is the output.
113:12:30.112 -> ��fx������~��<code>���x�f~������怘�</code>f�f�f�f~~�ffx����憆���������f�~fxf���~����fx�������~f�<code>�x��������怘��f����f���~��x</code>��fx�����������f~f�fx怘�������f<code></code>f���ff��fx��xx��fx���<code>���x���fx�������~��xfx��~��x</code>��fx���怘�f��<code>fx�f�~��x</code>��fx����怘-
2025-01-21 at 1:19 PM #18840
That means your IDE’s Serial Monitor baud rate is not the same as the baud rate in your sketch
-
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.