WiFi网格同步LED棒

6,726

5.7

5.

Introduction: WiFi Mesh Synchronized LED Bars

一种bout: A Maker since childhood with all the classic symptoms, a robot builder, and an Internet software CTO/Tech Product Manager.

该项目是一个带有可单独控制的数字LED(WS2812B“Neopixels”)的LED杆集合。它们允许动画在它们跨越它们而无需将它们连接在一起。他们使用WiFi网格相互连接,动画适应网格中的更多或更少的条。

灵感是一对鼓专业,为圣诞节游行装饰迈出的迈出/棒球菌。它们之间的LED动画是同步的。LED也可以是股线而不是条带。

The other use is for an LED art installation where you do not want to run a data wire between all the LEDS around a room - all they need to do is be plugged in individually.

对于这个项目,它们没有连接到互联网。他们设置了自己的私人WiFi接入点和Web服务器。因此,该项目不依赖于外部网络,并且可以在远程位置运行。他们在5V上运行,因此可以轻松地由外部手机电池供电!

Step 1: Parts

The following parts were used in the project for each strip:

  • 一种luminum channel带盖子和端盖的LED条带。有许多型材可以选择。这一个足够宽的WS2812B LED条(12mm)和低轮廓。

  • 铝棒- 频道宽17毫米,所以1/2“宽铝棒是一个很好的尺寸。它应该是1/16”厚度和6“,每个酒吧都是你所做的。

  • 双面泡沫胶带- 1/2" wide.

  • 1000UF电容器- recommended for each strip, to help prevent voltage spikes from damaging the LEDs.

  • 连接线。这条26个仪表硅丝非常柔韧,有助于将电线从LED条带上拉动焊接垫。当你用烙铁触摸它时,它也不会融化。我还使用伺服电线也非常灵活,但硅胶电线是我最喜欢的电线。您只需要每种颜色的6英寸(红色,黑色,黄色)。

  • 跳线电线- 母红色,黑色和黄色用于连接CPU。如果您是自信的排序,您可以将其直接跳过这些并将其焊接到电路板上。

  • 一种330欧姆电阻降低LED条带数据线中的噪声。

  • 一种1N4448信号二极管或类似于允许3.3V处理器可靠地驱动5V LED条带。

  • 3mm heat shrink tubing- 您只需要大约5英寸。

第2步:建立栏

The construction for the bars is the same as in thisprevious Instructable。There are similar step-by-step pictures here from a recent build, and the discussion can be found on that other Instructable.

一个新的尖端将LED粘贴到铝通道:有时LED条上的双面胶带比LED电路板略短,并且您将在LED条带上看到轻微的扣。如果您只需在该位置切割磁带,它将置于平坦。

I also used some drops of紫外线胶水锁定电源线和未留下的LED条带的任何部件。

而不是粒子光子控制器,project used used WeMos D1 Mini boards, based on the ESP8266 chip set. These are nice and small for an LED project. I used male headers to allow room for the female jumpers. Reversing the connectors will not fit in the enclosure. This approach is also easy to solder. I have also used 20 gauge solid core wire with crimped on female connectors, and that works too, but is more effort.

这些杆使用相同的牺牲LED方法为第一个LED。在实践中,它真的不明显。此外,前两者之间的微小间隙也几乎是不明智的

If you intend to use the clips to mount the aluminum channel, the aluminum bar connecting the channel to the project box may get in the way for directly mounting the clips to a wall, so you may need to put some washers or a loose nut under there to stand them off by 1/16".

Step 3: Mesh Code

Each of the LED bars is running the same code. The basis of this project is the painlessMesh Library athttps://gitlab.com/blackedder/painlessmesh.。That library handles most of the low level work of establishing Access Points, Web Servers etc. Each bar is a mesh node.

该网格具有一个控制器,并且动画更改通知被广播到所有节点/ LED条。对于大型网格,消息传递可能存在一些延迟,但对于我工作的规模,它并不明显。

On startup, the node assumes it is the controller, but then the changedNodes message triggers an evaluation. The lowest # chip id in the mesh becomes the controller. This usually takes a second or two for all the nodes to settle down and assume a single controller. You could put more effort into re-synchronizing faster (mid-animation), but those change messages are fairly chatty, so it takes a bit for the network to settle down anyway. In practice, once they re-synch, they stay very solid.

对于跨条的动画,代码获取节点的列表,对其进行排序,然后仅绘制当前节点是被绘制的节点。它们排序芯片ID顺序,因此您可以执行将保持一致的动画,无论它们启动。此外,动画将适应丢弃的节点。

动画代码出现在三个地方。第一个是acceptcallback函数,栏已收到新的动画命令。这是相当简单 - 只需设置动画的时序步长并重置计数器。第二个地方是循环函数。在那里,代码检查是否已完成当前动画,并移动到下一步。动画代码的最后一个地方是Sequianimation函数,其中所有图形都已完成。

系统使用Millis Timer更新 - 避免使用延迟功能,因为它阻止了一些库。Millis代码应该正确翻转。

Note that I had issues with the NeoPixel library and painlessMesh with more than one LED, so I switched to FastLED.

这是Githib上的代码, and it is also attached here. You pretty much load it on all the bars and you are ready to go on LED animation coding!

无线Contest

参加了这一点
无线Contest

LED Contest 2017

参加了这一点
LED Contest 2017

是第一个分享

    建议书

    • 一种nything Goes Contest

      一种nything Goes Contest
    • 阻止代码竞赛

      阻止代码竞赛
    • 使它真正的学生设计挑战

      使它真正的学生设计挑战

    5.Discussions

    0.
    sysop

    2年前Step 3

    this is exactly what I have been working on! I gave up on easyMesh about a month ago and jumped to FastLED about 2 weeks ago. then I found this.

    Many thank yous.

    0.
    CarlS

    2年前回复

    谢谢!祝好运!

    0.
    制造商佐贺

    3年前

    This is incredibly awesome!

    You've got my votes.

    0.
    CarlS

    3年前回复

    谢谢!