General Arduino

SKU: SEN0554 UART Non-contact Optical Turbidity Sensor HOW TO SET UP

userHead Stephen.Slocombe 2024-11-04 22:24:48 69 Views1 Replies

Hi,

Just a general question on set up. It seems that the bare wires from the sensor have to fit into the grey blocks on the DFRobot cable Adaptor module V2.0

How does one do this? it seems that the lugs on top are designed to either move up or move down but neither action seems to work and I'm applying a reasonable amount of force. I don't want to break it. Presumably the wires go into the holes but at what angle? Is the process of fitting the wire irreversible? Not been able to find any videos out there on assembly of this relatively new product - any links please? Any assistance would be much appreciated.

Thanks,

Steslo

 

2024-11-05 00:52:34

Hi,

I can answer this question myself now. You will need 3 hands. One to hold the adaptor still. One to insert the wire in the hole upwards against the metal. One to press down on the lug (could be with a small flat-bladed screw driver). You will feel the wire give and move forwards and you then let go of the lug and it will grip the wire. Thus far there does not seem a way of knowing for certain if it is gripping the wire or the insulation, the other ends of the wire are embedded into the sensors.

 

Here's some observations: there is a switch on the DFRobot cable Adaptor module V2.0 for 3V3/VIN. I assume it should be thrown to VIN on the right as depicted in the photo (https://thepihut.com/products/uart-non-contact-optical-turbidity-sensor-for-arduino?srsltid=AfmBOooEnY6gGOuqB9TnJQjm42XiRV0ozgLIwEHrOgE1uGRbc9cYvc21) on the Pi hut site.

 

On the DFRduino UNO v3.0 I have the VIN and GND plugged into the Red Block (POWER) at 5V and GND. Meanwhile IO1 and IO2 are plugged into the larger of the green blocks (digital) at respectively 11 and 12. This is using pin to pin extension wires that I had to order that were not in the original kit.

 

The UNO board is plugged into the PC via a USB/D cable. Running with Arduino IDE 2.3.3

 

The code supplied by the Pi hut wiki is uploaded and compiled (message: done uploading, done compiling). So far no data is being collected on the serial monitor or serial plotter however, so some troubleshooting is required.

Any comments much appreciated.

Thanks,

Steslo,

 

PS the code:

 

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

unsigned char str[5] = { }; //Serial receives data

unsigned char col;

unsigned int distance = 0;

unsigned char a[5] = {

  0x18,0x05, 0x00, 0x01 ,0x0D

};

void setup()

{

  Serial.begin(9600);

  mySerial.begin(9600);

  // put your setup code here, to run once:

}


 

void loop() {

  // put your main code here, to run repeatedly:

 mySerial.write(a, 5);

  while (!mySerial.available());

  while (mySerial.available() > 0) //Detect if there is data on serial port

  {

      for (int i = 0; i < 5; i++)

      {

        str[i]=mySerial.read();

        delay(5);

      }

      Serial.println(str[3],DEC);

      mySerial.flush();

  }

  delay(500);

}


 

 

 

userHeadPic Stephen.Slocombe