Physical Controllers

From Experimental Game Cultures
Revision as of 14:21, 19 July 2023 by Georg (talk | contribs)
Jump to navigation Jump to search

Hand holding sensor

Measure the voltage - could be a chain of humans that hold hands, Arduino measure the voltage and smoothes it out with a capacitor. The LED is just to show the difference in voltage:

The Arduino connects to 5Volts, Ground and Analog 0

The Arduino connects to 5Volts, Ground and Analog 0

The Breadboard, purple wires are for holding in your hands. Capacitor to smooth out the voltage.

The Breadboard, purple wires are for holding in your hands. Capacitor to smooth out the voltage.


The code

File:Touch.zip

RFID Tag Reader

Can be used to read RFID Cards/ or write to them. Uses a ~3 Dollar RFID Reader (RC522) Worked best with Arduino Uno.

RFID Wiring RFID Wiring

The Code: File:Rfid.zip

Musicplayer with DFPlayer Mini

A simple module that allows to connect a SD card with mp3/wav files and play them via a small speaker. Uses the 5 Volt USB Input that feeds the Raspberry Pico (3.3V) in order to get a louder sound. For more volume, a dedicated amplifier and speaker would be required.

Audio Player Wiring

The Code: File:DFPlayerRaspberryPico.zip

Stepper Motor

Using a A4988 Stepper Motor Driver, Arduino and a Stepper Motor from StepperOnline ( Nema 17 Bipolar 42Ncm 1.5A ). Setup the Driver as in this diagram File:POLOLU-2128.pdf, using this video tutorial: https://www.youtube.com/watch?v=psI3aN0A-OA Be sure to use a capacitor to avoid electricity to leak back into the Arduino and make sure to set the current limit on the Driver as described in the stepper driver document. For me it was 0.6v as I wanted a maximum of 1.5 A of current through the Stepper. Arduino code was here: File:StepperCode.zip

Stepper Motor with Arduino

Microphone Sensor

Using a Raspberry Pi Pico with Micropython - Takes a Microphone input and then outputs a gradient on LEDs. This could be of course also be used for a sound sensing controller - move the player only when you make a sound or so.

EGC Microphone Sensor Kit

The wiring:

Wiring in Fritzing

On a breadboard:

Microphone Wiring


File:Lautstaerke.zip

Infrared Sender/Receiver

Using an IR Receiver Module & Infrared LED, works pretty easily - with the right library. Some things to watch out for - the Infrared LED requires a lot of current (mA), the Raspberry Pico as well as the Arduino can't supply that directly. That's why we use a transistor as a switch to turn on/off the LED - this way we can get the full range and power for the LED. Works like a typical TV remote, can send small packets of data (like numbers or hex codes).


SEEDUINO XIAO

A super small Arduino/Micropython device. About 15 Euros.

Seeduino

Connecting it to Arduino IDE: https://wiki.seeedstudio.com/Seeed_Arduino_Boards/

Unfortunately did not work the first time I used it, may just have been a faulty device..

Reading Serial Data in Unity

In order to read data from Arduino to Unity, you can simply print out text to the Serial port. Then receive this in Unity with this script:

File:SerialReader.zip

Important that the Serial Monitor is not open when trying to read. May require plugging in/out the USB sometimes. Also, you need to set the correct Port (COM + Number).