Code Monkey home page Code Monkey logo

sparkles's Introduction

Project sketch: whispering forest fireflies

Motivation:

Forests are amazing to illuminate but unfortunately most lighting art i have seen in the past years are immediately recognizable as LED strips. Also i’m looking for a technical challenge.

Short description:

build autonomous little waterproof devices that can be hung up in trees. They blink and have a speaker and can triangulate their relative position to each other by using sound. This way we can simply hang them up randomly and know where they are, running light and sound animations through a larger space.

How does this work?

One base station knows its exact location and sends out a timestamp every second or so. During calibration we walk around the forest and produce loud noises, each individual device picks up those noises as peaks and calculates the time difference between the timestamp and the peak, thus collecting a table of runtimes. These runtimes are then sent to the base station and this way we can calculate each position with an accuracy of at least 30cm (which would be 1ms granularity for sound in air) or even quicker. We use ESP-NOW as wifi broadcast for the timestamp and additional commands.

How does the hardware look like?

It’s going to be a custom pcb with a high power led on each side, an esp32, a cheap SMD microphone, a switch and some charging infrastructure, plus a loud speaker You can plug in a lithium polymer battery and an esp8266 dev board to the pin headers. The whole thing needs to be encased in something waterproof but the idea is to smartly use the ESPs sleep functions to keep the whole thing running for the entire week and only work at night.

How do you want to charge 200 devices?

Actually, we hope to get the battery and power consumption set up in a way that the devices can run for a whole week (power down during daylight etc), but the idea is also to have two notches in the width of a model railway track on the PCBs, so we can stick the boards on a long piece of track and charge all of them more or less at once. We might also do a sound installation during daytime and a light installation at night which creates even bigger need for charging infrastructure

What challenges are there?

Many. Getting the math of the audio triangulation right, actually doing some audio triangulation, getting an energy saving way of doing the wifi command stuff, possibly doing our own PWM on the LEDs instead of using WS2812 (e.g. to use brighter LEDs), getting some nice anmations running, also getting the sound animation right, getting all of this done in a cheap fashion etc etc.

Costs?

The cheaper the unit the more we can make. I hope to get a unit including battery for under 10 euros and i hope to get a dream funded that allows us to get 200 units. The cool thing is that every year we could increase the amount of units to make the thing even more sparkly…

sparkles's People

Contributors

hdsjulian avatar blueloop avatar

Stargazers

CJ Yetman avatar Felix Bohmann avatar

Watchers

 avatar  avatar

Forkers

maxgerhardt

sparkles's Issues

Figure out which LED

Optimally; One LED on each side, largest possible angle. As much 'bang for a buck' as possible, meaning that more wattage equals better.
As we basically only have to run 3 or 4 channels (RGB/RGBW, both LEDs run with the same signal, but in different directions) we don't need an on board PWM chip but can rather do PWM ourselves, which allows us to get LEDs with more wattage.

Animations

Either we have one animation and stick to it, or we switch between modes. But how to determine? By time? By external / manual impulse? By day?
Need to think about this more closely.

Design PCB (visual)

Give the PCB a little visual love. possibly turn it into a shape, possibly add a printed finish, make it nice. not necessary but cool.

Changes to the PCB

The PCB needs multiple changes for V2
These are as follows:

  • Rename the blue and the red channels for the LEDs (R = B and vice versa
  • Place the blue channels on other pins to not interfere with USB Comms
  • Remove the GND connection from the back of the LED
  • add a full copper pad on the back side of the LED (to attach a heatsink)
  • Make the Board larger to fit a battery (specs tbd) - or make it as wide as possible so that the LED doesn't throw a shade around the battery
  • Add a USB port
  • Change the four connection pins to be GPIOs (to attach stuff if necessary)
  • Add a micro sd card slot footprint (no placement)
  • Change the JST Connector socket for the speaker to fit the actual speakers we're going to be using (tbd)
  • Figure out if there are cheaper MOSFETs
  • Either deepen the charging notches or come up with a different solution
  • connect usb power to charging
  • add this mic https://jlcpcb.com/partdetail/Goertek-B4013AM423093/C233790 plus a pre-amp (plus basically this schematic https://files.seeedstudio.com/wiki/Grove_Sound_Sensor/res/Grove%20-%20Sound%20Sensor%20v1.6%20Schematic.pdf ) instead of the current mic. Position ought to stay the same
  • make sure the LED pins have the right Rs.
  • decide which ESP to use. make sure pinout is right (pins 23-27 aren't the same between S2 and S3)
  • choose slightly more powerful Voltage Regulator.?
  • [x ] add C after Voltage Reg.
  • place the switch at the bottom

Figure out the finalized BOM list

So far:

  • 1 large LED for each side
  • Pin headers to attach an ESP board (final board needs to be set)
  • 2 pin JST connector (for battery)
  • switch (turn on device)
  • smd microphone
  • lipo charging infrastructure (what is needed?)
  • MAYBE: button (switch modes?)

Changes to the PCB (Schneider edition)

  • Why not use a 4 layer pcb that has two ground planes in the middle and nice broad lines for power? Probably not that more expensive and would benefit stability and wifi.
  • Connect the ground planes with VIAs
  • BAT+, VBAT (and VDD) are way too thin
  • Decide whether to actually do cell protection on the board or leave this to the battery
  • The charging regulator has a very long and thin line to the battery
  • Build something to measure the battery voltage, so that you can see what the batteries are doing, maybe just attach VDD_REF to the ADC
  • Make sure those LEDs are being cooled
  • C1 should be 47 uF
  • That switch might not be strong enough. According to spec it is maximally 1A.
  • The board will be using .15 mA no matter what the ESP32 is doing. just FYI
  • The ESP wants more free space around the antenna. Best is probably that the antenna actually pops out of the PCB
  • U6 has an unconnected pad. thats probably for cooling and should connect to a copper plane
  • C5, C6: The package (0603) ist too small for the capacities (470 uF, 100 uF)

Describe the math and triangulation mechanism

The math for triangulating the devices needs to be described and figured out. There is basically an optimization problem between the easiness of triangulation (manually measuring as little as possible) and the complexity of math.

Generally the triangulation should happen with a loud sound source being moved through the forest. This can be a starting clapper used in athletics or a boombox emitting loud bursts of white noise

There are so far multiple options:

  • Option A: Knowing one location of a master device and clapping at also known positions measured in angle and distance from the master device (such as walking 10 meters north, clapping, then turning 90 degrees, walking 10 meters, clapping...
    Disadvantages: This might prove imprecise really fast if you are walking through a dense and uneven forest

  • Option B: Knowing multiple locations and clapping next to them. This could for example be done with strings that are spun along trees. Clap at known points on the strings and measure distance and angle along the strings.
    Disadvantages: This requires quite a bit of manual effort and knowledge.

  • Option C: Lots of math. Computing error function.
    Quote:

initialize each device position at (0,0,0)
repeat until good enough:
1.for each device and for each clap:
1.wiggle position in each of the six directions
(+/- x y z) a tiny bit.
2.compute error function the entire system, with
that one little change applied.
3.compare how each wiggle in each dimension
improves or worsens things a little. call
that improvement dx for the x direction,
dy for y, and dz for z.
4.from those, form a vector (dx, dy, dz) that
this position would need to move in order
to improve the error
2.update each position by adding a * (dx, dy, dz)
to the current position, with a being tweakable
speed parameter should be a rather small value.
(maybe have two different speed parameters for the
device positions and the clap positions, with the
speeds for the claps being lower).
3.compute overall error function again. compare to
the error in previous iteration. if the error is
almost zero, or if it doesn't change much,
you are done.

Disadvantage: i'm personally not sure how this works. Will update.

PCB Design (technical)

Design PCB.
Requirements:

  • Has one LED on each side
  • Has pin-headers on back side to attach an ESP Board (which one needs to be finalized)
  • has SMD microphone on front side
  • Has switch on side of the pcb
  • has two notches (distance 16.5mm) that allows the board to be set on model rails (H0) for charging

ToDos for the code

  • message handler with state machine
  • implement universal timecode
  • implement synchronous blinking
  • come up with calibration protocol (how to exactly do it?)
  • implement peak detection
  • can i come up with an adaptive system for writing animations?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.