Using CH375 module to read Optical Mouse data.

Hi, i just bought the CH375 usb shield after reading this article on how to get mouse movements.

The article: Interface USB Mouse to your Arduino using CH375B

The problem is that, after uploading the code the serial Monitor constantly outputs a value (37 to be specific).

I'm using an Arduino Nano Board with the new bootloader.

Normal/expected behaviour- It should print out the X and Y movement of the mouse.

The code that i used

#include <Arduino.h>
#include "SoftwareSerial_fix.h"
#include "MeUsb.h"

MeUsb usb(10,9);

void setup() 
{
   Serial.begin(115200); 
   usb.init(USB1_0);
}

void loop()
{
  if(!usb.device_online)
  {
    usb.probeDevice(); 
    delay(100);
  }
  else
  {
    int len = usb.host_recv();
    if (len == 4){
      Serial.print(usb.RECV_BUFFER[0],DEC);
      Serial.print(',');
      Serial.print(usb.RECV_BUFFER[1],DEC);
      Serial.print(',');
      Serial.print(usb.RECV_BUFFER[2],DEC);
      Serial.print(',');
      Serial.print(usb.RECV_BUFFER[3],DEC);
      Serial.print('\n');
    }
  }
}

Is there something i should change or I'm doing wrong?
Or can you help me out with the usb Module. I want the X and Y movement of the optical Mouse (Usb not ps2).

Is there something i should change or I'm doing wrong?

Yes, you failed to post the wiring diagram of your setup and a link to the exactly used hardware. The CH375B can be operated on 5V or 3.3V depending on the circuitry on the board. If you bought the wrong board (p.e. for 3.3V) you have to use level converters for the serial interface.

The problem is that, after uploading the code the serial Monitor constantly outputs a value (37 to be specific).

Post the exact output you get. Just a value of 37 is impossible using the posted code.

These are the Connections that i made:

  • +5V of Arduino Nano to +5V of CH375B

  • GND of Arduino Nano to GND of CH375B

  • D10 of Arduino Nano to TXD of CH375B

  • D9 of Arduino Nano to RXD of CH375B

  • Link of the Module i Bought- Amazon.in

  • And the serial Monitor constantly outputs "37" again and again.

  • Can i use Nodemcu in case it's a 3.3v Module? Or a resistor network?

Link to the pinout that i used for the RX and TX connections- images (97).jpeg - Google Drive

Link to the picture of the exact module that i have- https://drive.google.com/file/d/10FN0xFNZuqcN6E53VAjZNIRdTYeLAYlM/view?usp=drivesdk

Update: The onboard led is for power indication?, I can't see it blinking or still. Is it possible that i burnt the board after providing 5v power?

Link of the Module i Bought- https://www.amazon.in/dp/B08GG7Q167/ref=cm_sw_r_cp_apa_fabc_MV92B9N5GTV9T07THZ7J?_encoding=UTF8&psc=1

Unfortunately that product comes with absolutely no documentation. I would never buy such a product, you have no chance to use it correctly. The only way I see is that you reverse engineer all the connections on the board and draw your own schematics of it.

+5V of Arduino Nano to +5V of CH375B

There is no +5V pin on the CH375B board you posted a picture of.

And the serial Monitor constantly outputs "37" again and again.

You're sure about this? No ",", no newline character? We need exact outputs, details may be important!

Can i use Nodemcu in case it's a 3.3v Module?

Yes, but how do you find that out?

Update: The onboard led is for power indication?, I can't see it blinking or still. Is it possible that i burnt the board after providing 5v power?

That's possible but it's not very probable that this also fried the LED. The chances are higher that you got a faulty product.

Thanks for all your support. I placed a refund for that product, this time i ordered the usb host Shield 2.0. I think it's a better module with some documentation.

This is the exact product Amazon.in

I hope this will allow me to read the mouse data.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.