I've been using an MH-ET scanner for a project. I'm not able to establish a connection between NodeMCU ESP8266 and the scanner. I'm powering the scanner directly from the NodeMCU.
Also I've seen this one person establish a proper connection using D5 and D6 pins. My connections are the same. Any help would be appreciated.
Complete schematics of Your build is requested.
Which kind of connection are You trying to use?
Please extract and post useful information from what that linked person shows. Unknown links are not opened by my most helpers.
As you can see from the demo-video
He connects the UART-pins on the TTL-side with the camera module
From where do you know that the microcontroller is an ESP8266 ?
The specs of the scanner say voltage 5V.
An ESP8266 is a 3V device. You should not directly connect a 5V-device to a 3.3V device.
The 3.3V device is in danger to get damaged by 5V
Sure you can find videos and tinkerers that do so with ESP8266 but it is bad practice
best regards Stefan
I'm trying to use a MISO SPI protocol. On NodeMCU ESP8266 I've connected the D5 (GPIO14/HSCLK) with S-Rx so it receives the clk and D6((GPIO12/HMISO) pin with S-Tx respectively so the scanner(slave) can transmit back to master and provided input voltage and GND from the NodeMCU to the scanner.
In the link( facebook video link, so no harm) , the person has establised the same connections using an ESP8285(it looks the same as my ESP8266 but the person has a tab open for ESP8285).
A glimpse at the code at 2:05 shows that the person also uses D5 and D6 pins to input the data.
I've also tried the following code, but I'm unclear whether its a problem with incorrect interfacing of the devices or whether I've used the wrong code for reading or maybe both.
#include <SoftwareSerial.h>
SoftwareSerial barcodeScanner(D6, D5); // RX, TX
// D5 is clk so d5 is transmitted
// d6 is MISO, so it receives data -> gets connected to tx
void setup() {
Serial.begin(9600); // Initialize serial communication with the Serial Monitor
barcodeScanner.begin(9600); // Adjust the baud rate based on the barcode scanner's specifications
Serial.print("Started!");
}
void loop() {
// Serial.println("Received from barcode scanner: ");
delay(1000);
if (barcodeScanner.available()) {
String receivedString = barcodeScanner.readStringUntil('\n'); // Read until newline character
if (receivedString.length() > 0) {
Serial.print("Received from barcode scanner: ");
Serial.println(receivedString);
}
}
}
I'd like to follow the same SPI protocol for communication as whenever I connect the NodeMCU using the UART0 pins with scanner, my pc gives a "disconnected" sound and then I'm unable to upload any code to the module( which I'm assuming is caused by confusion from using RX/TX pins while connecting to pc.
He has used the middle two pins, if we look at the top side, it might seem like the person has connected UART pins, but those two pins are Serial pin ( S-Tx and S-RX) and are connected to the NodeMCU not to the camera module.
For reference the bottom side of the scanner module looks like this:
I first took the impression that it was an ESP8266 as it looked the same as my module but a look at one of the browser tabs from the video shows he has an ESP8285 tab opened, so it is infact an ESP8285 which I've read from a this source is the same as ESP8286 except for the 1Mb builtin flash.
I'd be happy to follow the advice but I don't have the resources at the moment to connect it with any other power source, its bad on my part but I'll have to continue this until I get a better alternative.
You were asked to post schematics.
Sorry but You'll have to wait untin the day comes when those device will be used here.
The lowside of the scanner PCB has some letters printed on it
There is UART and there is SDA / SCL
UART means serial which is something completely different than SPI
SDA / SCL indicate a I²C-interface which is again something completely different than SPI and as UART
From the picture that shows the upside of the scanner PCB it looks like if this guy has connected the I²C-interface
correction
the middle serial UART-pins
pins to the arduino
Best thing would be if you buy a 24 MHz 8 Ch logic analyser for $15 to analyse what kind of signals is on what pin
As for the power-supply
trying to power this scanner-module from the ESP8266 Vin-pin might be dangerous for your computer if the current execeeds 500 mA
Trying to power it from the 3.3V pin which would mean behind the 3.3V voltage-regulator will surely overload the voltage-regulator
best regards Stefan
on arduino-IO-pins 0,1
there is NO SPI-interface !
it is UART which is something completely different than SPI !
UART is serial either hardware serial (Arduino-Uno pins 0,1
or
software serial
can be used with almost any IO-pin
The picture with the code-snippet shows software-serial
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.





