Simple lighting control


#1

Article describing simple lighting control with Arduino UNO, W5100 and MQTT.

  1. What you need:
  • Arduino UNO
  • Arduino ethernet shield W5100
  • Breadboard
  • Jumper wires
  • LED
  • Button
  • 10k resistor
  • 200 ohm resistor
  • PC (with Arduino IDE or Arduino Web Editor)
    (Instead LED can connect a relay to control light bulbs)
  1. Ethernet shield W5100 plug into the Arduino UNO.
    Connect everything according to the diagram.

    It should look something like this.

  2. Add a new device

  • Add new …
  • Device/Widget
  • Bring Your Own Thing
  • Enter your MQTT username, password and ClientID into your code
  • Upload the code (In the code are written notes about each line.)

Simple_ lighting_ control.txt (2.9 KB)

  • Wait for the board to connect to Cayenne.
  • After connecting to Cayenne, you should see this on the Cayenne Dashboard.

  1. Adding button to control LED
  • Add new …
  • Device/Widget
  • Custom Widgets
  • Button

  • Add Widget

If you did everything according to the article, it should work for you.
I hope you can help with your projects with Cayenne.


#2

great tutorial @tad.dvor


#3

Cant you just use add device to add the arduino than wait for the sketch to do it for you?


#4

@jerry That’s one way to do it.

This tutorial looks a little different since it uses the Arduino MQTT library, which is something we’ll be switching to in the near future. Play around with it :slight_smile:

~Benny


#5

We included this on our Twitter page. :slight_smile: