Working on an escape box (basically escape room in a box) and part of the prop is when the player gets some sort of combination right (such as plugging wires in a certain order) I want it to trigger a raspberry pi zero W media player to play a certain video. I am using a guide for the raspberry pi zero found at [ Build a button driven video player using a raspberry pi | The Wond'ry | Vanderbilt University ]. I have never used a raspberry pi and was wondering if it was possible to instead of using the buttons to trigger the video play, an Arduino sending something over serial.
certainly possible - the RPI pico has
// Serial is the USB serial for program loading and serial mointor
// there are two hardware serial ports UART0 and UART1
// Serial1 is mapped to UART0 on Rx pin GP1 Tx pin GP0
// Serial2 is mapped to UART1 on Rx pin GP5 Tx pin GP4
not tested a Pico W but the pin out looks similar
be careful the RPi PICO uses 3.3V logic the UNO 5V logic - use level converters or potential dividers when interfacing
maybe better to use a device when uses 3.3V logic such as a ESP32 - could then uses WiFi to communicate between the two??
@horace looks like OP has PI Zero Linux SBC, not PI Pico
Yep, sure is possible. The tricky part is the Raspberry Pi stuff if it's all brand new to you.
I don't think you need an Arduino, that would only make things more complicated than they need to be.
Raspberry Pi has GPIO pins and could detect the plugging of wires. You can write C/C++ code and run it on the Pi. There are even libraries available that let you use digitalRead(), digitalWrite() on the Pi's GPIO pins. Alternatively you can write the code in Python.
correct ! I miss read title
the zero does appear to have a UART on pins 14 and 15
I assume it appears as a UART in directory /dev/tty****
still need to take care connecting 3.3V and 5V logic
EDIT: thinking again the zero has a Micro USB OTG port - possibly plug the UNO into it and use port /dev/ttyUSB* - certainly works with the RPi 3 and 4 - zero may have problems powering the UNO
Why not just use your Arduino to switch relays, with the contacts connected in place of the raspberry pi buttons.
That way you don't have to work out how to modify the raspberry pi code to use serial instead of buttons.
the UART on the RPi zero is on 14 Tx and 15 Rx and appears as device /dev/ttyS0
you need to enable the UART using raspi-config
install minicom and the run it e.g.
sudo apt-get install minicom -y
minicom -b 115200 -o -D /dev/ttyS0
test connecting RPi zero UART to a FTDI 3v3 serial cable
Minicom on RPi displays
and teraterm on PC displays
alternatively if the UNO USB is plugged into the RPi Zero USB (e.g. via a USB hub) it will appear as /dev/ttyUSB0
running the following program which echo characters entered on the UNO
void setup() {
Serial.begin(115200);
Serial.println("UNO echo test ");
}
void loop() {
if(Serial.available())
Serial.print((char)Serial.read());
}
minicom displays
Talked to some people on discord, i am using a 3.3v esp32 so from what they have said i should be able to write the GPIO pins high instead of the buttons. Reason im using arduino instead of pi is just because of familiarity.
so long as you are outputting 3.3V logic signal from the ESP32 to the UNO to emulate the buttons there should be no problem - the UNO will recognize a 3.3V level as a logic level 1
the problem occurs when the UNO outputs a 5V level to the ESP32 - it may damage the ESP32 - hence the requirement for level converters or potential dividers - if you are not outputting signals from the UNO to the ESP32 no problem
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.