I²C communication

Hello everyone,

As part of my bachelor thesis, I would like to expand the I²C communication in the firmware. The commands F51 and F52 are already reserved for this purpose. In order to have a more precise idea of how these two F-code commands should work, I would appreciate a more detailed description.

Should all sensors that communicate via I²C be able to be picked up as a tool (like the soil sensor) and then controlled using the commands? Or is the communication not necessarily about sensors?

Many thanks in advance.

Best,
Finn

1 Like

Hi @Finn

That’s up to you. The UTM cable has two wires for I²C communication on 1 bus. They terminate in the UTM on pins I and J so you don’t have to use a detachable tool.

Bear in mind that the UTM Jumpers on the Farmduino for I²C signals may need installing.

The FarmBot Soil Moisture Sensor has I²C for Temperature but I’d be surprised if any users have that working.

Where did you read this ?

Edit: Ok, I found it in the README.md … the Response codes are missing.
Edit: Likely you’ll need additional Parameters and Values in the Write (set) F51 command (?)
Edit: Is I²C across 4.1 metres of wire (XL) usable ?

1 Like

Hi @jsimmonds,

thank you very much for your quick reply. Originally I wanted to write a code to read I²C sensors in general, but I think this is difficult to realize as each sensor has specific register addresses. Maybe I’ll try to write a program for the temperature sensor, since every FarmBot user already has it but can’t access it. Or did you have another idea for the F52 command?

I think if I keep the baud rate low enough, it should work with the 4.1 meter cable.

Do you have a detailed description of the Soil sensor (or the temperature sensor on it)?

Best regards,

Finn

Hi @Finn no but I went looking on FarmBot’s sites and found photos but no schematic.
You could enquire mailto:contact@farm.bot for the parts details I suppose.

Nope.

I believe that the Soil Sensor PCB is only applicable to Genesis and Genesis XL device UTMs.

That’s the temperature sensor on the RHS leg of the Sensor :slight_smile:

See also

Hi @jsimmonds,

thanks! I’ve texted contact@farm.bot and I’m waiting for a reply now. I saw you already discussed this topic in September last year (What sensors are there on the FarmBot?). I would like the I²C temperature sensor to work. I was wondering if FarmBot developed the sensor themselves or bought it from a company so I can get the informations there. I took a picture of the sensor to get more information, but it did not help much. I’m sending you the picture anyway, in case you or someone else knows where it came from.

1 Like

Hi @Finn

No idea, after an hour of web searching and Google Lens-ing :slight_smile:
I believe, due to the opening in the metal case, that the chip inside is likely one of many MEMS Barometric Pressure and Temperature sensors (current or obsolete) having serial digital interface(s).

1 Like

Just popping in here after responding to Finn over email to make the spec sheet for the chip available to everyone: Soil Temperature and Pressure Sensor ICP-10111.pdf (895.9 KB)

2 Likes

Thanks @jsimmonds and @roryaronson! I’m working on a software program to read out the temperature now. If I have any questions or successes I will get back to you :wink:

2 Likes

Hello again,

I found the library of the icp10101 sensor on the TDK website and added it to the firmware. With the help of the library I wrote the F52Handler, which accepts the parameter P and outputs either the temperature in Celsius (P = 1) Fahrenheit (P = 2) or the pressure in pascal (P = 3). I made a pull request at github (Add F52Handler by FinnRoters · Pull Request #167 · FarmBot/farmbot-arduino-firmware · GitHub). Reading my sensor with the Arduino Mega 2560 has already worked, but I still have difficulties reading it with the Farmduino, which I will work on in the near future. Please write to me if you have any suggestions for improvement.

1 Like

Hello everyone,

I would like to connect various I²C sensors to the FarmBot to better monitor the conditions for plant growth. I have already connected the icp10101 temperature sensor (integrated in the soil sensor) and the SCD30 sensor, which can measure CO2 and humidity, to the FarmBot. Next I would connect the AS7341 light sensor.

At our university we have also considered sensors that can measure magnesium, phosphorus, calcium or pH in the soil, but these sensors are usually very expensive and often require maintenance. If anyone here has any ideas for I²C sensors that would be suitable for the FarmBot, I would be very happy to hear from you.

Many thanks in advance.

1 Like