I am connecting these two boards which operate at different voltages via serial for communication. As a test I have two sketches, the first is for the every which sends an integer. The other is for the iot 33 which receives the int and prints it to its local serial. Since the voltages are different, I have a level shifter based on the txs0108e. Currently the iot 33 is not receiving any data and I'm sure i've made a mistake but not sure where. Any tips for troubleshooting would be appreciated.
This project connects 5V to 3V3 volt board via serial, with a circuit diagram. Arduino to Arduino via Serial
Start with a simple echo test on both boards
// hardware Serial1
#define comSerial Serial1
void setup() {
Serial.begin(115200); // fast for debug
for (int i = 10; i > 0; i--) {
Serial.print(i); Serial.print(' ');
delay(500);
}
Serial.println();
comSerial.begin(4800);
}
void loop() {
if (Serial.available()) {
comSerial.write(Serial.read());
}
if (comSerial.available()) {
Serial.write(comSerial.read());
}
}
Open two IDE's and load both boards and open both monitors and type on one to see the chars on the other.
thanks for the help from both of you. I did switch to the serial1 pins for both boards without issue but it did not resolve the problem. Also, the wiring diagram was incorrect and did not match the actual wiring (i was correctly connecting 3.3v and 5v as appropriate to the level shifter an from each board. So there was nothing to fix there other than the diagram. So then I went ahead and ditched the level shifter and tried drmpf's voltage divider serial approach. That works just fine. I am still confused why the voltage shifter doesnt work since it's designed for exactly this situation...
Graphic from website linked from drmpf here. My iot 33 lives in the place of the wemos-d1 shown in the graphic since the point is that it's a 3.3v device.