Skip to main content
Arduino

Timeline for Reading multiple bytes from *software* serial

Current License: CC BY-SA 3.0

11 events
when toggle format what by license comment
Mar 16, 2014 at 19:36 comment added Alexander I have dedicated relay board - dx.com/p/202361 - it has flyback diodes. By mistake I've ordered 12V board, not 5V - so I am powering it from Vin pin of my Arduino - so it gets unregulated power supply. Relay board is not a problem - it is probably the 220VAC power lines being close to Arduino's 5VDC lines. Will need to spread them farther, as I wrote above. I'll need to figure out how to insulate 5V lines though - I believed using wires in twisted Ethernet cable would be fine, but it looks like I need to switch to some shielded cable.
Mar 16, 2014 at 13:05 comment added jfpoilpret Just to be sure, you also used flyback diodes on relays right? How do you command your relays: directly from Arduino pins, through a transistor, a Darlington, a MOSFET?
Mar 16, 2014 at 12:28 comment added Alexander I've added decoupling caps everywhere I could, it reduced the problems but didn't fix them entirely. Probably I will have to physically separate relays and Arduino to two different boxes, and will add separate AC-DC power supply unit for relays. I'll also order relays with optocoupling instead of existing relay board.
Mar 16, 2014 at 11:45 answer added Cybergibbons timeline score: 3
Mar 16, 2014 at 11:38 comment added Cybergibbons Noise bad enough to cause Serial to corrupt is likely to cause other problems on I/O. Fixing the commands won't fix other issues, and it's likely you system would fail in another way.
Mar 16, 2014 at 9:09 comment added jippie As @jfpoilpret mentions, investigate the cause of the noise. It is usually easier to fix the cause than to remedy the data corruption.
Mar 16, 2014 at 8:19 comment added jfpoilpret Providing a schematic of your circuit would help. The best way to solve your problem is to first try to reduce the noise, this has to be done electronically.
Mar 16, 2014 at 7:39 comment added Alexander I've replaced today the wire connected to Serial1 (I've used piece of Ethernet Cat5 twisted pair patch cord) with Bluetooth dongle - it didn't help, I still see garbage in log and Arduino still acts weird - it receives "phantom" keypresses from "debug" console.
Mar 16, 2014 at 7:33 comment added Alexander Yes, they are totally random: here is tiny example from my debug log (notice the garbage as the 'Inlet' valve turns off and the current inducted by AC coil messes with power supply): [3819448 void turnOff_pin_Inlet()] WкК•╧╠•я² [3819570 void checkTempSensors()] DS18B20 on Door failed!
Mar 15, 2014 at 23:52 comment added microtherion Serial1 on a Leonardo is not "Software Serial", it’s arguably more "hardware" than Serial. How does the noise on your serial port manifest? Are the characters injected truly random?
Mar 15, 2014 at 22:38 history asked Alexander CC BY-SA 3.0

AltStyle によって変換されたページ (->オリジナル) /