Project tutorial
IoT WiFi LED Lamp Dimmer

IoT WiFi LED Lamp Dimmer © LGPL

An WiFi IoT Android LED lamp dimmer.

  • 1,586 views
  • 0 comments
  • 11 respects

Components and supplies

Apps and online services

About this project

The Internet of Things (IoT)

A new emerging technology these days, a self configurable and adaptive system consisting of networks of sensors and other object including intelligent objects whose purpose is to interconnect with all things, including everyday and industrial objects, in such a way that they become intelligent, programmable and more capable of interacting with humans.

All the applications that involve IoT, whether industrial, home, etc. Are controlled and monitored by certain parameters which are implemented and executed by the user or "other". Therefore, their implementation and execution differs with the sets of parameters, for the execution that is specified or desired by the user.

Arduino board is one of the important objects in this ecosystem, since it facilitates us to connect and control different devices like sensors, LEDs, step motors, servos and mobile phones.

This tutorial describes how to create an Internet of Things with Android and Arduino.

Android application to control a matrix led lamp ocording to user button slider input. All objects are in the same network for simplicity.

The above images shown a above diagram of the system. It consist of 1 commercial matrix led lamp of 24 10000 MCD (milli-candela's) leds with features:

  • Supply Voltage:----------------------------------- 5 VOLTS
  • Voltage Drop Across LED (Forward V):--- 3.4 VOLTS
  • Maximum LED Current:------------------------- 20 MILLIAMPS
  • # of LEDs connected in parallel:------------ 24 LEDs

The resistor value needed for the current limiting resistor used when powering the LEDs.

  • Calculated Limiting Resistor:------------------- 3.333 OHMS
  • Nearest higher rated 10% resistor:----------- 3.9 OHM
  • Calculated Resistor Wattage:------------------ 0.768 WATTS
  • Recommended Resistor power rating of:-- 1.28 WATTS

This is then interfaced to the microcontroller Arduino Micro on a PWM pin. Then we have IoT implementation taking place with the help of CC3000 which is then allowing us to upload the parameters which are displayed using mobile App which in this case is above is a hosting platform.

The mobile device sends information to the IoT "CC3000" which is interfaced with the Arduino Micro, the information is obtained from the knob switch in the app, and is sent to the Arduino Micro by means of a UDP server that runs on the mobile app and with the help of the CC3000, this way we can drive (middling) the LED lamp.

Old link: https://www.hackster.io/capdeadpool/iot-dimmer-b270a2

Code

AT32u4_LedLampSwitchC/C++
/*
*	Author		: Zavala Ortiz Vicente Arturo.
*	language	: .ino
*	Date		: Friday April 18 2014.
*	Update		: Friday June  06 2014.
*	Name		: ATmega32u4_LedLampSwitch.ino
*	Description : Tracks circle coloresd objects
*/
#include <avr/delay.h>

#define LED_LAMP                        10

/*		WiFi libs			*/
#include "CC3000.h"
#include "CC3000_Client.h"
#include "common.h"


void setup()
{
	/* add setup code here */
	ConnectionInfo connection_info;
	
	// Initialize CC3000 (configure SPI communications)
	#ifdef CC3000_DEBUG
		Serial.begin(115200);
	#endif
	
	// Initialize CC3000 (configure SPI communications)
	if(!wifi.init(9)) {
		#ifdef CC3000_DEBUG
		DEBUGPRINTLN(PSTR("Initialize CC3000 FAIL!"));
		#endif
		return;
	}

	else {
		//FreeRam();
		#ifdef CC3000_DEBUG
			DEBUGPRINTLN(PSTR("Initialize CC3000 OK"));
		#endif
	}

	if(!wifi.connect(ap_ssid, ap_security, ap_password, timeout)) 
	{
		#ifdef CC3000_DEBUG
			DEBUGPRINTLN(PSTR("Error: Could not connect to AP!"));
		#endif
	}
	
	
	// Gather connection details and print IP address
	if(!wifi.getConnectionInfo(connection_info) )
	{
		#ifdef CC3000_DEBUG
		DEBUGPRINTLN(PSTR("Error: Could not obtain connection details"));
		#endif
		return;
	}
	
	else
	{
		#ifdef CC3000_DEBUG
		DEBUGPRINT(PSTR("IP Address: "));
		printIPAddr(connection_info.ip_address);
		#endif
	}

	pin_mode(LED_LAMP, OUTPUT);
}

void loop()
{
	  recvfrom(res);
	  
	  http_gets(data, "led", res);
	  value = atoi(data);
	  
	  analogWrite(LED_LAMP, value);
}

Schematics

AT32u4_LedLampSwitch
Iot led bb qgblpbmzhv 7fksnfilso

Comments

Similar projects you might like

IoT Speech Recognition

Project tutorial by vicente zavala

  • 853 views
  • 0 comments
  • 4 respects

IoT Face Tracking and Recognition

Project tutorial by vicente zavala

  • 2,885 views
  • 1 comment
  • 18 respects

IoT Dimmer

Project showcase by vicente zavala

  • 2,425 views
  • 0 comments
  • 6 respects

IoT Blink - Getting started with IoT

Project showcase by AppShed Support

  • 2,026 views
  • 0 comments
  • 11 respects

IoT Arduino Ball Tracking

Project tutorial by vicente zavala

  • 1,094 views
  • 0 comments
  • 4 respects

IoT arduino ESP Garage Door opener (UD)

Project in progress by David Smerkous

  • 10,865 views
  • 6 comments
  • 16 respects
Add projectSign up / Login