Skip to content

Have fun pricking the eyes of a ape (no real animals will be harmed).

License

Notifications You must be signed in to change notification settings

zettrik/Affenkopp

Repository files navigation

Affenkopp

This project is about reading button states with a nodemcu and use the values in unity3d for fun and fame and the whole family. Push the buttons to control mapped eyes of an ape.

Hardware Setup

  • 3x 3,7V 18650 (from old notebook batteries)
    • in series (11,1V max. 12,8V)
    • battery case
  • 1x nodemcu (8€)
    • remember to disconnect the batteries before you hook up USB cable!!!
  • 2x arcade buttons with LEDs (3€ each)
  • 2x 1kOhm resistor

Optional For Battery Monitoring

  • 330kOhm + 22kOhm resistor (voltage divider)
  • 1x mini LED Voltmeter 3-30V (3€)

wifi access point

  • its ssid & password must be hard coded in .ino file
  • also acts as mqttbroker

Small Computer Which Runs Unity3d

Projector Mapping An Ape Shape

Buttons

Protection, Voltage Regulator

Sleep Mode

330-1kOhm resistor between GPIO16 and RESET

Connection

Two ways to transmit the buttonstateinfo...

Wifi Client

nodemcu connects as client to wifi access point

  • no long wires needed for buttons
  • needs power supply
  • needs separate wifi ap

USB

  • no extra power supply needed for nodemcu

Software

How does the information of a pressed button reach the unity pc?

use "Serial.print(...)" on nodemcu via USB to computer

Nodemcu As Simple HTTP Server

Nodemcu As HTTP Client, Webserver On PC/Unity?

MQTT Messages Via Broker

MQTT Broker On Debian Stretch

aptitude install mosquitto
cp path_to_this_git/mosquitto.conf /etc/mosquitto/conf.d/
mosquitto_sub -d -h localhost -t "buttons" -t "node"

MQTT Broker On Openwrt

opkg update; opkg install mosquitto-nossl
vi /etc/mosquitto/mosquitto.conf

Websockets

Unity on Linux

https://forum.unity3d.com/threads/unity-on-linux-release-notes-and-known-issues.350256/

Power Consumption @ 3.3V

  • NodeMCU in wifi station mode 90mA
  • NodeMCU with wifi suspended 40mA
  • 7-segment voltmeter 12mA
  • LED in button 35mA (12V)

li-ion accu

  • high voltage 4.2V
  • low voltage 2.75V

About

Have fun pricking the eyes of a ape (no real animals will be harmed).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages