We’re rewarding the question askers & reputations are being recalculated! Read more.

Hot answers tagged

7

Assuming your Arduino has only one hardware serial connection (it's something like an Uno rather than a Mega) you're quite right in using software serial, the Arduino will already be using pins 2 and 3 to communicate via USB to the Serial monitor so you can't use them to communicate with the scanner. However carefully look at your first line of code, you've ...


5

Electrically they are both the same. The difference is what they are used for. DTR means Data Terminal Ready and indicates that the connected device is ready to receive data. Data Terminal Ready (DTR) is a control signal in RS-232 serial communications, transmitted from data terminal equipment (DTE), such as a computer, to data communications equipment (...


4

I had these images lying around so here is an example of "Fab" being sent at 9600 baud: And now a single byte (the letter "F"): A - no data (Tx is high) B - The "start bit". The line is taken low to tell the receiver that a character (byte) is commencing to be sent. The receiver waits for one and a half clock times before sampling the line. C - First ...


4

DTS and RTS are used on esp8266 boards with USB (Wemos, NodeMcu) to reset the board and to set io 0 low for bootloader mode. You can see it in source code of esptool.py. Sometimes you want a reset without going to bootloader mode. RTS = either CH_PD/EN or nRESET (both active low = chip in reset DTR = GPIO0 (active low = boot to flasher)


4

You have a misconception, which signals get's outputted where. If you want to simply read the analog signal of the sensor, you need to use the "control" connector. There you can find the analog signal on pin 2. But this analog signal goes up to 10V, so you need a voltage divider between the sensor and the Arduino, to divide the voltage down to 5V max. ...


3

This is effectively not workable. USB is not a peer-to-peer standard, but a host/device one. Both your Arduino and the USB-serial converter are intended to be devices, so they cannot communicate. While it would be possible to use another microcontroller acting as a host to bridge to serial that would be pointless, as the actually central problem of RS232 ...


3

Note: This is an answer that OP originally edited into his question. I gather the data into an array of bytes data[125]. Then I gather the relevant bytes per value and stack them together: long var = (data[4]<<8) + (data[3]); I shift them so the relevant bytes start first var=var>>3; Afterwards I mask them with the RIGHT mask var=var & ...


3

Setting baud rates in a C program isn't a trivial task. You need to use the low-level open() instead of fopen() and act on the returned file descriptor with ioctl() or tcsetattr() / tcgetattr(). The former method allows the setting of non-standard baud rates while the latter only allows specific baud rates to be used. I wrote a C++ class to deal with it ...


3

You are transmitting data by encoding it using one of probably many Sony Consumer Remote Control formats and expecting to decode it using one of many possible RS232 like formats. You will likely get something between nothing and random values. Instead, consider sending data using only the RS232 protocols. This is what is done in this tutorial. It is ...


2

You're right that 60' exceeds the spec for RS-232. That said, distance specs are often quite conservative (as they should be, the spec is a promise that it will work and needs to account for marginal components and an unfavorable environment). I think the 50' limit for RS-232 was more observed in the breach than in practice. So for starters I'd be inclined ...


2

The solution turned out to be a couple of things, some of which mentioned by others in the comments. Problems that needed to be fixed: My level-shifter was a huge part of the problem. I switched to a MAX232-based chip and then I was a least able to get responses shorted lines 2 and 3 (Tx and Rx). I needed a cross-over cable. I had tried this while ...


2

Yes, perfectly possible. You need an RS-232 interface chip - the most common and well-known of these is the MAX232. You can get them as breakouts on eBay. That interfaces between the DB9 and pins 0/1 (or other UART comms pins) on the Arduino. If you are wanting to program the board through it you will also need to connect (after converting the voltage ...


2

It is never good to base code on delays instead of intervals. This is especially true for faster intervals where the execution of the code its self consume a significant portion of the interval. Also note, some protocols only occasionally resynchronize. RS232 resynchronizes after each byte (about 8 bits of data). So any accumulated delay errors may ...


2

You need to disconnect the Arduino`s RX and TX pins from any device before trying to upload a sketch via USB, because the Serial data is directly wired from the USB chip to these pins. It's as if you're trying to flash the thing behind your RS232 adapter.


2

From the manual: http://dmx.ohaus.com/WorkArea/showcontent.aspx?id=4294974226 The balance will return “ES” for invalid commands. Check to make sure you're using the correct serial parameters that the RX line is wired correctly.


1

As a counter point, industrial systems utilize the UART protocol at much higher rates - 10 Mbits for example. RTS/CTS can prove very useful when a large data set is being received at a higher rate. We have clients using LVDS and RS-485 IO types for the higher speeds. DTR/DSR is occasionally used to see if the other equipment is on-line but this signal ...


1

Can you include all the other calls you make related to setting up the serial port along with asio::serial_port_base::baud_rate(baudios)? Ideally, split that out into a separate function (that takes parameters such as baud rate) that you know is the only thing doing this setup. As I mentioned in the comment, getting back the right number of chararacters but ...


1

Any network of USB devices involves a single host talking to many slave devices. The typical connection to program an Arduino board is, on the USB side: PC (USB Host) <-> USB Cable <-> Arduino (USB Device) On the Arduino board you have the serial side of this communication: USB Serial Adapter <-> TTL serial lines <-> ...


1

I think you just want a normal USB A-B cable, exactly like you'd use on a PC. You probably could use the cable you picture, but you'd need a female DB-9 connector. If you really want to do that for some reason, you need to connect the Tx pin on the DB-9 (pin 2) to the Rx pin on the Mega, and the Rx pin on the DB-9 (pin 3) to the Tx pin on the Mega.


1

This Arduino sketch is a wonderful opportunity for you to learn the very basics of serial communication. You should be very careful scaling the constants given in any baud rate program (whether using a hardware or software UART) as they are normally off by some small percentage, and without understanding the implications you may eventually introduce timing ...


1

And I am wondering if I could control this port with my Arduino (NODE-MCU) and a module like this one? Yes, you can, though choose a board based around the MAX3232 for a 3.3V MCU board. How could I then control the TV? This is the Manuel for the TV at page 124 there are the commands how to control it, but how can I send them? Exactly as they show in the ...


1

It worked with changing AT+HTTPARA="URL","http://api.thingspeak.com/update?api_key=MY_KEY&field1=VALUE" (from https:// to http://)


1

You are attempting to talk to your peripheral via a second serial UART implemented in software on arbitrary pins, which should leave the hardware UART free for uploading and debug or other runtime communication between the Arduino and a PC. However, the "arbitrary pins" you choose to use to connect the peripheral are the same pins as used by the hardware ...


1

Generally there are (or could be many) USB Devices and (only one controlling) USB Host. The differences are discussed in this stackexchange.com question. Briefly, USB Hosts are usually very complex hardware and software devices that may know about many many different types of peripherals. They are usually only found on computers. USB Devices are usually ...


1

In the comments I see that is not clear how you connect the module in your arduino. The native mode is PS2 (old mouse and keyboard) you can use that directly with your arduino (PS2 protocol is 5v too), for this, you need implement a clock/data protocol. If you use the rs-232 converter, notice that RS-232 as a amplitude from -12v ~ 12v this burn your arduino, ...


1

You can get 5V TTL USB serial adaptors. The classic being an FTDI one. Also you can get the MAX chip level converters as a tiny module, if you already have a normal RS232 adaptor. I would recommend connecting the GPS to your PC as a reality check. The garbled that you are seeing is typical Baud rate issues. Also there can be polarity issues with the signal. ...


1

I looked up the datasheet and product specs for the GPS device. It says that the output is RS-232. Note that RS-232 is NOT compatible with the Arduino levels. Arduino "talks and listens" at 5V or 3.3V depending on which board you're using. So what you need is a RS-232-to-TTL converter. Now, TTL speaks Arduino. So Arduino will be able to understand that. So ...


1

In Arduino terms: Serial will be committed to receiving data from the PC. Connecting Serial1, Serial2, and Serial3 via RS232 will be easy. Adding a 4th Software Serial (or NewSoft Serial or AltSoft Serial) via RS232 will also be straightforward. If you need high speeds for the 4th port, than a UART with SPI (or I2C) interface to the Mega might be a ...


1

No, but it is possible to use 3 of them. The reason being that one of them is the connection to the computer. The hard part is in the programming. You will need not only a suitable sketch on the Arduino (the easy part), but also some software on your computer that presents three COM ports to the operating system and forwards the data through to the Arduino ...


1

You could also take a look at this github project: https://github.com/ukos-git/arduino-eurotherm2416 It is specifically designed for the purpose you ask for. It basically includes Module named Temperature and a possibility to set or read it: Temperature.set(100) t = Temperature.getTemperature() Look at https://github.com/ukos-git/arduino-eurotherm2416/...


Only top voted, non community-wiki answers of a minimum length are eligible