Questions tagged [serial]
Serial communication is the standard USB connection between the Arduino and a computer with a standard USB A to B cable or through the TX/RX pins using a USB to serial converter. It can also refer to the serial library.
2,159
questions
2
votes
2
answers
545
views
Arduino Uno Serial.write() how many bits are actually transmitted at once by UART and effect of baudrate on other interrupts
With Arduino Uno Rev3, I am trying to maintain a delicate timing while handling data transmission. I want to send 6 bytes at a time, which takes around ~44 us when I time Serial.write(). The time it ...
-1
votes
1
answer
39
views
Arduino R3 hangs Raspberry Pi 3B+ when plugging into USB ports, with multiple sensors on board (Node Red) ,Temp Humidity, volts, shunt [closed]
I would like some help please.
I am setting up an environmental monitor to monitor my RV (caravan to us in the UK). I have created the code, some by finding, some by programming and some by luck, but ...
-1
votes
0
answers
56
views
Can I do active low for my Arduino TX output [closed]
I am using an Arduino MKR Zero and I want the TX pin to connect to ground for its 1s and to 3.3V for 0s. So a normal signal of 1001 is now 0110. Is this possible?
I want to use the already in place ...
0
votes
1
answer
28
views
Send 07 C6 04 08 00 8A 08 FE 95 to Serial Port
I'm reading a scanner documentation and I need to send an instruction to the serial, to fire a manual reading. The instruction is 07 C6 04 08 00 8A 08 FE 95.
The scanner is connected by UART, RX/TX ...
0
votes
0
answers
25
views
Serial Communication Integration - Python and Arduino ECG Simulator
I'd like to ask for help with following issue.
I'm building an ECG simulator that works in the following manner: the computer sends data through serial communication with a Python script to an arduino ...
0
votes
1
answer
39
views
Arduino TFT Touch Screen Interface Only Returns One Button Option
I'm trying to create an arduino code that returns a value for the button that was pressed as the user choice. However, whichever button I press the only return is 2. Also, whenever pressing other ...
2
votes
1
answer
58
views
Common Ground Between Arduino and ESP32 - Can I Re-use the ESP32 GND Pin for a Potential Divider
I am trying to connect an ESP32 to an Arduino Mega via Serial Communication using the UART 2 ports on both microcontroller boards.
There needs to be a common ground between the ESP32 and Arduino. ...
1
vote
1
answer
39
views
Interpreting Analog Output from Aalborg Mass Flow Meter GFM
I am attempting to connect this device to my computer via RS232.
I am debating the simplest way of going about this and was inquiring if my Uno R3 could come into use, turning the analog symbols of 0-...
2
votes
1
answer
181
views
Hardware serial baudrate inconsistent between Arduino nano and standalone 328P
I have a 328P (328P-AUR to be specific, [link]), and in the schematic below is how I've implemented it to a PCB:
Uploading a program works fine, but I hink there is an issue with the clock source, ...
3
votes
0
answers
51
views
Why RTU bridge timeout even though answer is received?
I'm testing the following code as a bridge between https://sourceforge.net/projects/qmodmaster/ and https://pypi.org/project/pyModSlave/.
As hardware, I'm using a NodeMCU 1.0 and a USB/TTL converter.
...
0
votes
1
answer
111
views
Send data with Serial.write() hex values
I'm using ESP32-C3 as hardware and Arduino IDE as my software core.
I receive a data from MQTT server and want to send it to another board using serial port as a hex number. However, it gets sent over ...
0
votes
1
answer
87
views
Arduino Nano spontaneously stops working and disconnects from computer [closed]
I'm trying to implement an Arkanoid game on a 16x16 RGB matrix (the library is Adafruit_NeoMatrix). The blocks are 2x2 squares, and there are 3 rows with 8 blocks in each. The current state of the ...
0
votes
1
answer
42
views
Problems sending data to my Arduino from Python using pySerial
I'm trying to send a '1' or a '0' to my Arduino in Python using pySerial so that from my Arduino I can read whatever the Python program sends and then turn a relay on and off depending on what it ...
0
votes
1
answer
73
views
Interfacing A9G with Arduino for AT commands testing
I am trying to hook up to an A9G Pudding GSM board via an Arduino. I intend to use the onboard UART chip to facilitate TTL-UART conversion between PC and A9G.
I have initiated a software serial ...
1
vote
1
answer
188
views
Why does filling up a large char array cause a crash? (ESP8266)
Here's the code in question:
void setup() {
Serial.begin(115200);
Serial.println();
char test[5000];
int i;
for (i = 0; i < sizeof(test)-1; i++) {
test[i] = 'x';
Serial....
-1
votes
1
answer
385
views
ModuleNotFoundError: No module named 'serial' when compiling for ESP32 in Arduino IDE [duplicate]
I'm new to ESP32 development and I'm trying to compile a program in the Arduino IDE to record the vibrations by an ADXL345 sensor. However, during compilation, I encounter a "ModuleNotFoundError: ...
-1
votes
1
answer
31
views
Fail to discard the character T from my transmitter Arduino
I wrote code for my transmitter Arduino. I want to send the data to the receiver Arduino through Tx and Rx serial.
The issue is that I could not discard the char "T" and it appears as output ...
1
vote
3
answers
281
views
Serial.println printing just after the previous string in same line
I wrote serial.println in my code but the string was printed in same line on serial moniter.
#include <WiFi.h>//for connecting esp32 to a wifi
#include <TinyGPS++.h>//to obtain gps data ...
1
vote
1
answer
67
views
Arduino board with StandardFirmata doesn't respond to C# and Python client
I have a Seeeduino XIAO board with Firmata running on it. I'm currently trying to write C# client to communicate with this board.
I have tried using Iot.Device.Arduino, SolidSolis.Arduino and ...
1
vote
1
answer
68
views
Bad symbols in the serial monitor when connected via USB 3.0
I tested DHT11 + Arduino Uno with a very basic example sketch.
The Arduino board was connected to USB 3.0 and sometimes I saw incorrect symbols in the serial monitor, e. g. "Humidit?: _7%" ...
2
votes
2
answers
164
views
interrupt from a button and wait until serial port 1 has a message
I'm a little bit loss because I'm learning how to use the interruptions on Arduino.
I'm creating a program to read an RFID code that arrives if an RFID transmitter is close to the antenna (a little ...
0
votes
0
answers
44
views
Controlling dynamixel servo from Arduino-Mega
I was trying to control a dynamixel servo from Arduino Mega. The protocol for the communication is half duplex, and I successfully sent data to the servo motor and got it actuated/turned the LED on ...
1
vote
1
answer
51
views
Having issues with RS232 UART wiring to a physical PC connection
TL;DR: Attempting to connect UART2 on ESP32-WROOM to a physical PC RS232 results in odd behavior and ESP32 crashes or errors. Suspect electrical design problems. Wondering if I need special ...
0
votes
1
answer
50
views
Sketch halts if button is pressed on boot
I have a KY-040 rotary encoder with a push button wired to an ESP8266. My objective is to be able to detect if the button is pressed or not on boot.
In the below code, if I hold the button down and ...
1
vote
1
answer
60
views
Can't get serial port's attention once sketch is running
This sketch is supposed to listen for a single character sent to the serial port, as a means of starting and stopping data collection (which in this example is mocked by printing some register values)....
1
vote
1
answer
196
views
Multiple symbol definition related to USART_RX_vect from Serial
When trying to compile the sketch below, I get this error when using either the IDE or the CLI:
HardwareSerial0.cpp.o (symbol from plugin):
In function `Serial':
(.text+0x0): multiple definition of `...
0
votes
1
answer
95
views
How does the serial monitor know where a string terminates when we use Serial.print instead of Serial.println?
EDIT: I thought I had to parse the things coming into the program but the speed it is running at makes it indistinguishable to the eye that the word is being printed piecewise.
I am trying to create a ...
0
votes
1
answer
840
views
Construct Strings with UTF-8 characters from data
I am printing some ASCII art to the Serial monitor from Arduino UNO, with some success. However, using string literals uses more memory than I would like. I wanted to try constructing the strings/...
0
votes
3
answers
160
views
Arduino interrupt for serial data on digital pin, that is too large for the serial buffer
I am using an Arduino Nano in combination with a NEO 6m GPS module. The GPS module is sending data, consisting of a few hundred chars, every second. Since I am communicating with my PC over the ...
-1
votes
3
answers
70
views
Shared memory space for locally defined buffers?
Within a class I have a method that is using a basic char buffer to print some data, something like
char buffer[64];
sprintf(buffer, "%s: some text: %u, %u, %u %u", string_var, u_var1, ...
0
votes
4
answers
274
views
UART - Different results between logic analyzer and an Arduino
I would like to decode a serial communication.
I have already found out how the protocol works. I can also send serial data with my logic analyzer and control the device this way.
I would like to ...
0
votes
1
answer
67
views
UCSR0B equivalent for ESP2866
I'm trying to convert an Arduino Uno program for use with the ESP2866. I've converted most of the program successfully, but there are a few lines I can't seem to figure out. For example,
UCSR0B = ...
0
votes
2
answers
76
views
Which sketch was this?
With ESP32 being so plentiful here (3 more for Christmas) I am at a loss to determine which sketch I used for a particular unit. Has anyone devised a record keeping scheme or even a serial monitor ...
0
votes
2
answers
347
views
Why I always see while(serial.available() > 0) as the standard way of reading serial data?
Examples online always show this code to read bytes from the serial interface:
while(serial.available() > 0)
{
char receivedByte = serial.read();
}
But I don't understand why it works.
The ...
-1
votes
1
answer
158
views
Reading serial data from Arduino in Python continually
Using a stepper motor and a range finder (TFLuna), I am trying to build a "Lidar" (like a Radar, but with light). Here is the algorithm:
Turn motor one step, calculate angle, measure ...
-1
votes
1
answer
117
views
Compilation error: 'Serial' does not name a type [closed]
#include <IRremote.h>
IRrecv IR (11);
Serial.begin(9600);
void setup() {
// put your setup code here, to run once:
IR.enableIRIn();
}
void loop() {
// put your main code here, to run ...
-1
votes
1
answer
89
views
Arduino not reacting sometimes when reading serial commands
When I am sending hex numbers via computer to the arduino leonardo, it sometimes won't react, but the serial monitor says that it was sent. My code;
void setup()
{
Serial.begin(9600);
pinMode(...
-1
votes
1
answer
242
views
ESP32 cannot serial monitor [closed]
I use esp32 devkit v1 .
I code follwing this picture.
const int vavle = 1;
int d = 1;
void setup()
{
Serial.begin(115200);
delay(2000);
while (!Serial);
Serial.println();
pinMode(vavle,...
0
votes
0
answers
722
views
ESP32 S3 Same code works on Serial1 but NOT on Serial0 for RS485 module
I have designed a test board to understand ESP32-S3 working pins. I am using USB interface D+, D- for programing so Serial0 is free to use.
This is my test circuit for testing an RS485 converter. For ...
1
vote
0
answers
1k
views
esptool.py error Cannot configure port, something went wrong. PermissionError(13, 'A device attached to the system is not functioning.', None, 31)
When trying to upload my firmware to an ESP8266 board using Arduino IDE 2.2.1 I get
A fatal esptool.py error occurred: Cannot configure port, something went wrong. Original message: PermissionError(13,...
-3
votes
1
answer
106
views
RF24 if statements are not reading properly, even if an "if" value is wrong, it still follows the associated code [closed]
My code is taking values from a remote and transmitting the state of it. Right now the states are just 1 and 0, on or off, and is writing over the serial monitor on the transmitting Arduino. On the ...
0
votes
2
answers
67
views
Serial Buffer stays empty as soon as it becomes empty once
I have a question regarding serial buffer readout.
At program start, I send a serial command to a sensor that 1. activates him and 2. let him send data - that works.
When I unplug the sensor, the ...
0
votes
1
answer
305
views
Python script cannot connect to serial port
I want to control the LEDs with my hand, for this I used the repository https://github.com/paveldat/finger_counter/tree/main. I want to control the LEDs with my hand, for this I used the repository. ...
5
votes
3
answers
2k
views
Arduino to Arduino communication
When I send data to an Arduino Uno via the serial monitor, the serial data goes down the same USB cable used to program the Arduino. So there must be a device on the Arduino board like a FTDI or USB-...
-1
votes
1
answer
45
views
Wolfram Mathematica reads but closes stream feeds from Arduino Serial port after a few data sets
This is a Wolfram Mathematica / Arduino serial feed problem , but I am posting here just in for any suggestions on enhancing the Arduino code or the Mathematica notebook. The original post is here ...
-1
votes
1
answer
503
views
convert string representing a binary number to binary
I have a serial input "1111111" and I would like to convert this to a binary B1111111 that I can send to a led matrix.
I tried to search, but, all the results were misleading, led to full ...
0
votes
0
answers
308
views
Arduino Uno RFID-RC522 won't scan any card or tag
So I bought a RFID-RC522 module with a blue tag and a white card, and I searched for tutorials and found this library that I used it.
and here is my code :
#include <MFRC522.h>
#include <SPI....
-1
votes
1
answer
88
views
Read byte and time into EEPROM, then display with a comma between the time and the value?
I have bytes of natural numbers 1-60 coming in at random times:
Example of send data
// Uno send
void setup() {
Serial.begin(9600);
int integersToSend[] = {1, 22, 30, 4, 50};
for (int i = 0; ...
-1
votes
1
answer
68
views
Reading a string from the serial port and comparing to another string
I'm using an Arduino Mega 2560 and writing a really simple piece of code that doesn't work.
String a, letra;
#define led 13
void setup() {
Serial.begin(9600); // opens serial port, sets data rate ...
1
vote
1
answer
221
views
ArduinoJson reading `null` from Serial
I have a setup that reads from serial when I sense that there is something to be read (and always assume that what is sent to the arduino is valid json):
void setup(){
Serial.begin(9600);
...