r/ArduinoProjects • u/TastyCollege9639 • 10d ago
Showcased Project Compiled fruit-fly connectome circuits into 5 fixed-point C99 / Arduino reflex libraries + live browser WASM simulator (NeckLink v3.0.0)
Plain-English Overview: Think of these libraries as fast, sub-millisecond integer "reflex instincts" for small robots and sensor nodes (zero floating-point math, zero malloc(), and no PC neural-network training step). Instead of hand-tuning weights, they compile mapped neuron-to-neuron wiring tables from an adult fruit fly into plain C integer arrays:
- 2WD / 4WD Robot Car (
NeckCompass, 352 B RAM): Feed raw 9-axis IMU + wheel-speed ticks so an indoor or yard rover ignores brief motor magnetic spikes, tracks its straight-line vector back to where it powered on, and steers home without GPS. - ESP32-CAM Rover or Micro-Drone (
NeckSight, 14.3 KB RAM): Feed a tiny32x32grayscale camera thumbnail + gyro rates to catch thin chair legs or poles expanding rapidly toward the lens ("looming") that ultrasonic sensors miss, triggering an immediate brake or left/right dodge. - 18-Servo Hexapod Walker (
NeckCord, < 1 KB RAM): Pass a forward/turn command and let cross-leg inhibition lock 6 legs into a smooth tripod walking gait and output the 18 integer servo angles without hardcoded gait state tables. - Workshop Gas or Vibration Alarm (
NeckSense, < 6 KB RAM): Let aBME688gas sensor or 3D-printer/pump accelerometer observe 5 to 10 seconds of normal background at boot, then flag unfamiliar smoke/solvent odors or new bearing-rattle patterns right on the board. - All-in-One Wrapper (
NeckLinkCNS, 24 KB RAM): Optional single-tick bundle chaining all four reflexes together.
Technical & Connectome Details
Sharing an open-source (MIT) side project I just updated to v3.0.0: NeckLink, a set of five fixed-point ANSI C99 and Arduino/ESP32 libraries that run ~33,000 synaptic weights extracted from the adult fruit-fly connectome (BANC v888, 157,789 neurons) inside 24 KB of static RAM, paired with NLTP for lossy ESP-NOW / UDP telemetry.
You can try the compiled C99 core live in your browser (compiled to a 107.5 KB WebAssembly module, with optional webcam input to test the optic-lobe collision neurons):
https://indian-aman.github.io/necklink/
What is in the repo (packages/*/arduino/):
- NeckLinkCNS: 4-organ reflex controller + MAVLink v2 output in
24,024bytes of zero-float C99 RAM. - NeckCompass: 9-axis ring-attractor compass and GPS-denied homing (
352bytes base RAM). - NeckSight: 32x32 looming obstacle detector (
LPLC2+LC4cells) with integer gyro derotation (14.3 KBRAM). - NeckCord: 6-leg hexapod gait coupling + 18-servo integer IK + rotor/thruster fault allocator (
< 1 KBbase RAM). - NeckSense: mushroom-body sparse integer novelty detector (
< 6 KBRAM in tiny mode).
For v3.0.0 we also tested all 39 biological weight tables against 100 degree-preserving rewired connectomes and standard engineering baselines (EKF, SVM, optical flow). Specific fly wiring makes a huge difference on compass homing (100% arrival vs 4.7% shuffled) and emergent tripod gait (0.855 vs 0.411 shuffled), ties random sparse wiring on gas novelty detection, and still trails symmetric engineering baselines when you need zero biological drift (so both weight modes are included). Right now the connectome controllers are research-beta (compiled for esp32dev and tested in MuJoCo / WASM simulation; physical robot bench testing is next).
Full source, Arduino libraries, and Python (pip install necklink) packages: