Showing posts with label Arduino. Show all posts
Showing posts with label Arduino. Show all posts

Saturday, December 5, 2015

HOW TO: Up and running with Adafruit HUZZAH Feather ESP8266

INTRO:

Hello weary cyber-ether traveler!  The following is a quick HOW TO that describes how to connect a device to the internet that you can use to control things in the physical world.  We will be using a wifi enabled device called the "Adafruit HUZZAH Feather ESP8266" to connect to the internets.  Don't you worry if none of that makes sense to you or you are unfamiliar with some of the lingo and materials.  We play nicely with people whom are still learning and in pursuit of knowledge :).  


Hardware used:


  1. MAC Comp-ooter
  2. Adafruit HUZZAH Feather esp8266 (we will refer to as Huzzah from here on out) - https://www.adafruit.com/product/2821
  3. USB A/micro cable - https://www.adafruit.com/products/898


Software used:

Important:  Make sure to use an Arduino IDE version other than 1.6.6 as that version seems to not function well with the Huzzah ESP8266 boards.


  1. Arduino IDE version 1.6.5 - https://www.arduino.cc/en/Main/OldSoftwareReleases#00xx
  2. Silicon Labs VCP Driver Install Disk - https://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx



Initial Setup:

Download and install the software components listed above.

Then, open the Arduino IDE and click Arduino->Preferences and enter the below URL into the "Additional Boards Manager URLs" field in the pop-up box (See images 1-3).  

URL to copy paste into the Additional Boards Manager URLs field:
http://arduino.esp8266.com/stable/package_esp8266com_index.json


Image 1: Open Preferences

Image 2: Preferences Pop-up

Image 3: Adding the URL into the "Additional Boards Manager URLs" field.


Next click Tools->Boards->Boards Manager... and find "esp8266" in the boards manager.  Then click install.  (See images 4-5)

Image 4: Navigate to the Boards Manager...

Image 5: Find "esp8266" and install.



Now close down your Arduino IDE and restart.  Once you have done this, click Tools->Board->Adafruit Huzzah esp8266 (See image 6).



Image 6:  Choose the Adafruit HUZZAH ESP8266




Next, click Tools->CPU Frequency and choose 80mhz (See image 4).

Image 4: Selecting the CPU Frequency



Then, click Tools->Upload Speed and choose 115200 (See image 5).

Image 5: Selecting the Upload Speed



Connect the HUZZAH Feather to your computer with the USB A/micro (See image 6).

Image 6:  Connect your Huzzah to your computer



Then, click Tools->Port and choose the port your Feather is connected to.  It will likely say something like "USBtoUART" at the end (See image 10).  If not, there's always trial and error with a limited amount of ports.  Note, we had to deselect and reselect the port a couple of times when trying to successfully upload the sketch to our Huzzah.

Image 10:  Choose the port your Huzzah is connected to.


The Fun Stuff!

Now that we have properly set everything up let's try and get some code on our Huzzah.  Within the Arduino IDE, copy paste the following sketch, courtesy of the nice folks over at Adafruit (See image 11).


void setup() {
  pinMode(0, OUTPUT);
}

void loop() {
  digitalWrite(0, HIGH);
  delay(500);
  digitalWrite(0, LOW);
  delay(500);
}




Image 11: Copy code into the Arduino IDE


Then, in the upper left hand corner of the Arduino IDE, click "Verify" (See image 12) wait for the process to complete and then click "Upload" (See iamge 13) and the code will Upload to your Huzzah.  If everything goes off without a hitch, a red LED on your Huzzah will blink on and off.  Initially we received errors but after deselecting and then reselecting the Port (See image 8), it worked.  Note that some users have reported needing to connect pin 0 to ground to successfully upload the code.  Give this a shot if you are having issues.

Image 12: The Verify button in the Arduino IDE


Image 13: The Upload button in the Arduino IDE



Movie 1: Hello world, blinky time!

Next Steps

Go mobile with a lipo battery pack and make your Huzzah do something cool.  Use your ImagineN4tion...











Monday, November 2, 2015

Internet Connected LCD

Built an internet connected LCD using an Adafruit Huzzah ESP8266 board, the Arduino IDE, node.js and socket.io.  Here's a short video of it in action and a link to a page where you can write your own message to the LCD screen.  Send your twitter handle to the LCD and I'll tweet a pic of it back at ya!



Here's a page to play with the LCD:

http://fast-bayou-5924.herokuapp.com/


Here's a video of it in action:



Sunday, June 9, 2013

HOW TO: Connect your Arduino to the Internet as a Web Server

The INTERNET OF THINGS...
< queue lightning and thunder >

It's what all the cool kids are doing these days.  Why should they have all the fun?  Let's setup an Arduino as a Web Server that anyone, anywhere can view.  Why would we do such a thing?  Possible projects include collecting data from a sensor and posting it to the Web or controlling an actuator remotely.  Think internet connected fart sensor that logs realtime how awesome your roommate's flatulence is, or perhaps, a robot that hides in the bushes and pokes pedestrians sauntering by.

Here is a quick video detailing the setup that I will take you through.  We have a servo and an LED that are controlled via a Web page.  The control page is accessible from both the private and public networks (aka: internet accessible for anyone).  The video shows me turning both the servo and LED on and off from my computer and iPhone (with the wireless network turned off so as to force it to access the Arduino from the public network).  I also have a live video feed coming from a wireless IP camera so that you can view what is happening remotely in the case you were to use this functionality for a remote control application that required monitoring of the system.

Awesome, so let's starting tinkering on Al Gore's interweb.  Here's how to do it and what you'll need:

Materials:
1)  Internet connection
2)  Internet router and associated information (LAN IP address, WAN IP Address... don't panic more on this soon)
3)  Arduino
4)  Arduino compatible Ethernet shield (I am using the shield by Seeed Studio)
5)  Ethernet cable
6)  Computer with Arduino programming ability


Lingo:
1)  LAN = Local Area Network
2)  WAN = Wide Area Network
3)  IP Address = Internet Prototocol Address
4)  ISP = Internet Service Provider Lets get going!



STEP 1:  COLLECT INFORMATION ABOUT YOUR HOME NETWORK  


First things first, you need to find the following information about your home network:

a)  The login name and password for your router.  My login credentials were listed on the back of my router on a sticker.  They were super complex credentials... Login = "admin", Password = "password".

b)  Your LAN IP address (aka: Private IP address) and/or your router manager login site.  I have a NetGear router and it listed the router manager login site on the back sticker as http://www.routerlogin.net.  If you do not have something similar on your router try entering these standard LAN IP addresses into your web browser 192.168.2.1,  192.168.0.1, 192.168.1.1 .  You will know it works if you land on a page that requests a login and password (which should be provided on the back of your router or in documentation from your internet service provider).  If you connected via a router login site, you can then find your LAN IP by browsing around and finding a page that details your LAN.  The IP address will generally be of the form xxx.xxx.x.x.

 c)  Your WAN IP address (aka: Public IP address).  This one is easy.  Just google "what's my ip address".  Google returns your WAN/Public IP address.  This information will also be listed once you login to your router.




STEP 2:  PLUG N' CHUG 


 a)  Plug the Ethernet shield into your Arduino.

b)  Plug your Arduino into your computer via the USB cable.

c)  Plug your Ethernet cable into the Ethernet shield and the other end into an open Ethernet plug on your router.




STEP 3:  SETUP PORT FORWARDING 


If we want anyone, anywhere to have access to the Arduino Web Server we need to setup something called port forwarding.  This is an option you can set within your Internet router manager.  To make a long story short, port forwarding will allow interactions between the WAN and the LAN, aka:  It exposes your Arduino to the Public network as opposed to keeping it isolated in the Private network.  Thus, anyone, anywhere with Internet access can interact with your Arduino.

a)  Find the IP address of your Arduino.  To do this login to your router manager (see Step 1 parts a & b).  Once logged into your router, find a page titled something similar to "Attached Devices".  Once here, you will be able to see the LAN IP address unique to your Arduino, commonly 192.168.1.177.

b)  Once you have the Arduino LAN IP, find a page within your router called "Port Forwarding".  From here you will have to find the option to "add custom service" or something similar.  To setup a new custom service, enter the LAN IP address of your Arduino, choose TCP/UDP for protocol, choose an open port, how about 8081 - use this number for both the starting port and ending port, and a name for the new service.  Once created, your new custom service (port forwarding for your Arduino) it will show up in the port forwarding list.




STEP 4: CODE AND TEST  


Now that all the network bogusness is taken care of we can focus on making widgets whirl.  This code creates a Web Server that can be accessed by entering "http://xx.xxx.xx.xx:8081/"  where, xx.xxx.xx.xx is your WAN IP address.  If you used a different port than 8081 just change the last digits following the ":" to the port you used.  The web page has 5 buttons that control an LED on pin 9 and a servo on pin 6.

a)  Save the code down to your Arduino.  Get code here:  http://bit.ly/1OfRnN3
Note, this is modified code relying heavily on code from the following source: Arduino Cookbook, Second Edition, by Michael Margolis with Nick Weldin (O'Reilly). Copyright 2012 Michael Margolis, Nicholas Weldin, 978-1-4493-1387-6.

 b)  Go to "http://xx.xxx.xx.xx:8081/" or whatever is appropriate relative to how you set things up. Hopefully at this point you see a pretty basic Web page that has buttons for turning on and off the LED and making the servo go forward, backward, or stop.  The code I supplied also imports a live video feed from an IP camera but this functionality is commented out.  Perhaps in the future I will detail how to set that up in another post.



STEP 5: BUILD THE CIRCUIT 


The circuit I built is shown below.  This circuit depiction was drawn using a great tool called Fritzing.  This is pretty self explanatory.  The resistor is a 220ohm resistor.






















<adventures in hacking etsy seo>
Shop
Chicago Laser Cut
Coaster Blog
</adventures in hacking etsy seo>

Sunday, April 21, 2013

Blurring the Lines: Digital Control of the Physical World

I am continually fascinated by the fact that we are gaining more and more control over our physical world via the digital realm.  The ability to code and hack hardware is providing a conduit for Makers to blur the lines between the screen and their surroundings.   This no-mans-land between physical and digital is ripe with opportunity and will dramatically affect many areas of our lives in the future.

This page is a testing ground for our forays into allowing others to digitally control our physical surroundings.  The setup utilized is composed of an Arduino and ethernet shield running a Webserver with a wireless Wansview IP camera feed embedded into the webpage.

Click the buttons below to control whatever actuator is hooked up today :)


Note: The video feed immediately below will only work if you are using Chrome or Firefox as your browser.  If you are using another browser scroll down to view another feed suited for your browser.  The Chrome and Firefox feed works better as it is optimized and operates much quicker.  Thank you to The Mad Hermit for the turnkey code to imbed video feeds.

Test Video Feed with Controls:

FOR CHROME AND FIREFOX
Live Feed

FOR BROWSERS OTHER THAN CHROME AND FIREFOX



Friday, September 14, 2012

Thingy: Arduino Enclosure

One of us just uploaded an Arduino mountable enclosure to thingiverse.  The lid of the enclosure slides onto the enclosure body along a grooved track and locks in place once the tabbed wings on each side clear rectangular holes in the enclosure body (see assembly drawings).  To remove the lid, pinch the tabbed wings and slide the lid off using the ridge at the front of the lid for traction.

You can check it out and download the files here.

ARDUINO ENCLOSURE, REV1

ARDUINO ENCLOSURE LID, REV1


Below are a few pictures of the design.

Image 1: Assembly drawing with lid slightly removed

Image 2: Assembly drawing with lid in closed position

Image 3: Part drawing of lid

Image 4: Part drawing of enclosure