亚历克斯控制了亚当·萨维奇

简介:亚历克斯控制的亚当野人南瓜

关于:我是大城市里的一个小女人,我喜欢做东西。手工艺是一种生活方式,我的宗教是乐高,我像一个巴姆夫十字绣。

我家里所有的灯都是智能的,所以我已经习惯了大声叫它们开关,但当我对着一盏不亮的灯大喊大叫时,结果会让我看起来很傻。当我对着蜡烛大喊大叫的时候,我看起来特别笨。

通常这不是什么大问题,但到了万圣节,我总会有一两个南瓜雕刻被烛光照亮。所以我想,为什么不换掉模拟光源的低效火灾隐患,制作一个高科技南瓜,由LED灯供电,由Alexa控制。

你需要什么

  • 雕刻南瓜
  • LEDs
  • LED电池
  • 晶体管
  • 电阻对
  • 实验板很方便
  • WiFi enabled micro-controller (I used Adafruit feather M0 WiFi, but other boards would work. It just needs to be able to connect to the internet)
  • Battery for board
  • Accounts on IFTTT and Adafruit IO

实现最终结果的方法有很多种,但这是我认为最简单的方法,所以我将解释这一点。

第一步:雕刻南瓜

所以我的想法是逆势而为。每个人都是there carving villainous pumpkins, why not a hero pumpkin? Since this was a tech project, it seemed appropriate to choose one of my making heroes. I decided to carve a likeness of Adam Savage.

I already made an Instructable explaining how to turn a photo into a pumpkin carving stencil, which you can find here: //www.smiletrl.com/id/Carve-a-Vampire-Pumpkin-Selfie/

In fact, I have one showing you how to turn Donald Trump into a a stencil, and another demonstrating how to do the same with your own face. Wow. Thinking about it, I currently have 3 Instructables, all of which are about pumpkins. Niche much?

Anyway here's a few photos outlining the major stages in the process for this particular design. The idea in general is to reduce your image to three colours, black, white and grey. White areas are cut all the way through the pumpkin, black areas are left alone and in grey areas you just remove the skin of the pumpkin.

不管你是自己设计还是从网上选一个,都要记住一件事,那就是尽量减少你切南瓜的地方。因为我们要在里面装一些电子产品,不管我们怎么做,它们都是不显眼的,通过任何孔都能看到。看到一个电池盒偷看可能会打乱你的设计,或者至少破坏你教你的智能家居设备与元素集成,关闭一个真正的蜡烛的幻想!

第2步:电路

对于电路,我想要一些由微控制器上的一个引脚控制的LED。这似乎是复制蜡烛的一种简单而明智的方法,但无可否认还有其他选择。

I chose to go with a separate power source for the LEDs, and something to act as an electronics switch so that the pin on my board could be set high or low to make or break the circuit between the LEDs and their power source.

As for the power source, I am a firm believer in the old adage: "the best battery is the one you have". I'm overrun with 9Vs so that's what I ended up with, although it's admittedly not necessarily the optimal one for this purpose, it's what I had to hand and THAT'S FINE, OKAY?! Can we please end the battery wars now?

接下来我计算了我的led和它们的电源之间的电阻。网上有这方面的计算器(http://www.ohmslawcalculator.com/led-resistor-calculator),它基本上取决于电池的电压、LED的数量及其规格。我用了3个红色的发光二极管,因为我觉得它的亮度和我放在南瓜上的茶灯差不多。

如果你买了看起来像蜡烛的闪烁发光二极管,就可以获得额外的积分。因为我没有。

For my electronic switch, I used a 2n7000 transistor/N-channel MOSFET. I use them for most of my switching needs since I inexplicably have a whole bunch of them. Just power the gate at around 3v to switch it on, making them fine for our purposes – the output from the pin on the micro controller I used was sufficient to turn the transistor on and off, and the transistor can handle the voltage of the battery I powered the LEDs with. (It can handle more, in fact).

I keep reading online that when using MOSFET transistors, you should use a gate resistor (a resistor between the gate and ground), "to be sure the MOSFET will be off if the thing driving it is letting the output float". Basically, I stuck one in for good measure.

第三步:概念

为了让事情变得简单,我使用了一些免费的在线服务来处理让Alexa和我的南瓜说话的部分过程。

第一:如果是这个,那么就是那个。如果您还不知道,IFTTT允许您连接您使用的其他帐户和服务,然后创建由触发器和操作组成的配方。一旦检测到触发器,操作就会发生。在我们的例子中,我们将使用Alexa作为触发器,这样IFTTT可以连接到Alexa,并在我们对她说特定短语时使其他事情发生。

至于动作,我用了adaio。通过在Adafruit IO上创建一个帐户,您可以通过他们的网站或API访问一堆数据源。这意味着您的微控制器可以读取和/或更新这些数据源。我让IFTT在feed中保存一个1或0来表示打开或关闭南瓜的请求。

So if you're following along, go make an account with IFTTT and Adafruit IO. Set up a feed in Adafruit IO called "pumpkin", then create two IFTTT applets – one that saves a 1 to the pumpkin feed if you say something like "pumpkin on", and one that saves a 0 to the pumpkin feed if you say something like "pumpkin off".

Step 4: Code

这真的是我第一次公开分享代码,尽管这基本上是Adafruit网站的一个示例草图,但我还是很紧张(https://learn.adafruit.com/mqtt-adafruit-io-and-you/arduino-plus-library-setup). 好点?

(很明显,您必须将占位符换成真正的WiFi凭据等)

Adafruit IO has a HTTP API so it'd be possible to get your board to make and process HTTP requests to read yours feeds, if that's something you know how to do or are more comfortable with.

我只是碰巧使用了一个使用mqttapi的简单示例,mqttapi只是一个不同的轻量级协议,设计用于小型传感器和物联网类型的设备。这张素描很不言自明。它所做的只是检查Adafruit IO上的feed,并根据它在feed上看到的是1还是0,将微控制器上的单个pin设置为高还是低。此高/低引脚将打开和关闭晶体管,打开或关闭LED。

Step 5: Put It Together

Lastly, you need soemthing to protect the electronics from the pumpkin guts. Lithium batteries don't like being wet. Not a lot of batteries do... or electronics... heck, unless I'm on holiday somewhere tropical I'm not especially a fan of it so I can't say I blame them.

My improvised solution was a paper plate covered in a few layers of plastic wrap. I'd advise using something better than this. Do as I say, not as I do. Go for some Tupperware or something, to protect from pumpkin on all sides, including drippy pumpkin guts. I can think of a range of solutions, from enclosing the electronics to plasticising your pumpkin, but really, the main thing is don't leave it unattended. No method is totally safe and you don't want any accidents....

I also made a video on the whole process if you fancy watching rather than reading.

https://youtu.be/NrzRmXAaJOc

多学科竞赛

参加了
多学科竞赛

第一个分享

    建议

    • 微控制器竞赛

      微控制器竞赛
    • 自动化竞赛

      自动化竞赛
    • 让它发光比赛

      让它发光比赛

    讨论