- 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.
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?
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.
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 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.
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.