Introduction: Wi-fi Enable a Lava Lamp (or Almost Anything)

Picture of Wi-fi Enable a Lava Lamp (or Almost Anything)

If you have never used Blynk before, you should check it out. This creation can be used for a lot of things - not just a lava lamp. You could have it turn on your coffee maker in the morning or make an automatic night light. Really though, I just made it for fun.

For a complete list of materials and other cool stuff, take a look at this project's website!

Step 1: Set Up the App

Picture of Set Up the App

For this project you will need to have both the Arduino IDE on your computer, and the Blynk app on a smart phone or tablet.

This page has full documentation about how to get yourself set up. (If you have used Blynk before then you can probably skip this step.)

Once you gain an understanding of the app, follow these steps to set up your project.

  1. Open the widget box (+ icon)
  2. Add a button
  3. Set the button's pin to V0, and the other two boxes to 0 and 180 (in that order).

Step 2: Set Up the Device

I am using a SparkFun Blynk Board, but you can really use any Blynk-enabled device. If you are using a Blynk Board, then SparkFun has a tutorial about how to get it set up and get started. The second link is about how to set up your board to allow its code to be edited in the Arduino programming environment. (again if you already know what you're doing, you can skip these):


If you have made it this far, here is the code you should use:

<p>/*You will need to replace these three things with your own information:<br>char BlynkAuth[] = "yourauthcode"
char WiFiNetwork[] = "yourwifinetworkname"
char WiFiPassword[] = "yourwifipassword"
*/</p><p>#include 
Servo myservo;</p><p>#include 
#include </p><p>#define BLYNK_PRINT Serial</p><p>char BlynkAuth[] = "yourauthcode";
char WiFiNetwork[] = "yourwifinetworkname";
char WiFiPassword[] = "yourwifipassword";</p><p>void setup() {
  Serial.begin(9600); 
  myservo.attach(12);
  Blynk.begin(BlynkAuth, WiFiNetwork, WiFiPassword);
}</p><p>void loop() {
  Blynk.run();
}</p><p>BLYNK_WRITE(V0) {             
  int pinData = param.asInt();
  myservo.write(pinData);
}</p>

Step 3: Build a Contraption

Picture of Build a Contraption

Instead of using something more complicated like a relay, I made a relatively simple contraption: for this you can either buy a plug-in-switch like the one in the picture just use a wall switch (for your house lights). I used a large servo motor, some popsicle sticks, a hot glue gun, and some plastic toys to create a proof of concept for this project that can easily operate high voltage devices.

Step 4: Put It All Together

Picture of Put It All Together

The lava lamp (or other appliance) has to be plugged into the electric switch which is operated by the servo motor that needs to be connected to the blynk board, and the board needs power.

  1. I used a phone charger and a usb cord to supply power
  2. The servo's wires are connected as follows: red to Vin, black to Gnd, and yellow to pin 12
  3. Plug everything in to a wall outlet
  4. Use blu-tac to keep things from dangling - unless you don't mind it
  5. The servo motor needs to be manually calibrated: experiment in the app to find out what numbers should be set in the button widget (instead of 0 and 180) to successfully manipulate the light switch.

Open the app and turn everything on to give it a try. You could also try automating it by using some of the app's other widgets like the GPS or the timer.

Remember to comment with any questions and to check out the project's page!

Comments

MTKapp27 (author)2017-12-07

You should 3D print out an enclosure for that project. Thanks for sharing.

About This Instructable

198views

8favorites

License:

Bio: I'm millerman4487, and I like waffles and robots. I usually upload a new instructable about every two weeks, or whenever I get inspiration.
More by millerman4487:Arduino Jazz ImproviserWiFi Santa Detector (or a Security System)Wii Nunchuck Full Functionality
Add instructable to: