When trying to decide between a flat map and a globe, a friend reminded me of the dymaxion map- a foldable flat map. http://en.wikipedia.org/wiki/Dymaxion_map
i decided to lasercut a smaller map and test things out while it was flat and then fold it up if it seemed like that would look and work better.
and you have made your Galileo into a hotspot that can be remote controlled by any Wifi device. Once your device is connected you go to the CAT website and an virtual interface of the Galileo will appear. This interface maps directly to your Galileo and the buttons allow you to control the pins from your Galileo via your tablet or phone!
This is what it looks like:
Basically, you can connect and output of your choice to a pin, let say I put a light on D13. Then I can turn that light on and off from my tablet by pressing the corresponding button for D13 from the CAT site!
I think this will be an extremely useful and game-changing tool for prototyping and physical sketching
Just had a meeting with some other explorers and a representative from Intel today. It turns out that they are getting ready to release version 2 of the Galileo board and one of the improved features will be faster I/O on digital pins!
The next problem that I wanted to tackle was sensing the temperature of the map as it heats and cools, to know when to turn the peltier up and down.
I had a digital temperature and humidity sensor from adafruit (DHT11) lying around that I wasn't using so I decided to hook that up to my Galileo board. I tried to upload the example code and it wouldn't compile! I did a bit of research and found that some Arduino libraries are not compatible with the Galileo board, but you can overcome this by changing some things in the header file. Basically this means that the way Arduino communicates with a compiler is a bit different then the Galileo.
So then I did a more specific search for the temperature sensor I was trying to use and found this extremely helpful site:
http://www.hofrock.com/before-you-buy-1/
DEFINITELY READ THIS BEFORE STARTING A PROJECT
Apparently this sensor, and a few others, do not work because the digital I/O on the Galileo is 100x slower than other boards
which says that the Galileo is only compatible with analog temperature sensors. That save me a lot of time and confusion...So I ordered the TMP36.
Now the question is of course how to heat the map. Luckily I majored in physics so I have a few tricks up my sleeve every now and then. In lab we used these tiny peltier pads to hear and cool subjects before x-rays.
in short, peltier coolers use the thermoelectric effect where temperature differences directly relate to differences in electric voltage. The Peltier effect is a thermoelectric effect that was discovered in 1834, when Jean Charles Peltier discovered that when current flows between a junction of 2 conductors heat can be generated or removed. This basically means that by sending more or less current the Peltier junction (usually packaged as a ceramic plate) either increases or decreases. One side of the plate can get very hot, while the other side can get very cold. You will need a heatsink for the hotside when cooling, or else the peltier could stop working and cause damage to your circuit!
More here: http://tomswiki.wikifoundry.com/page/Peltier+(TEC)+Cooling
Luckily, peltiers are pretty easy to source, they sell them on Sparkfun and Adafruit and other places. I ordered mine from ebay. When you are ordering them make sure the Vmax and Imax (maximum voltage and current) aren't too crazy, the ones I got are Vmax= 15 and Imax= 4.6
Something I noticed while reading through forums and examples of how to parse data with an Arduino is that lot of people where having the Arduino do a lot of the processing, when they could just be using a python or web app to simplify the data before sending it over.
Matt Richardson also uses this technique for his "Days until Make Comes out example". http://makezine.com/2014/02/03/galileo-project-how-many-days-until-make-comes-out/
Both of these give a good overview of how to use Python in your Arduino code.
Intel has it's own library for using Python that you will need if you want to explore this option. There are other libraries as wel, but I always try to go with the one with more documentation
The next step was to decide where to get the weather data from. For this I need a weather API feed. An API basically consolidates the information I am querying on the internet to make it easier for my microcontroller to parse.
I looked into different ways to get APIs for the galileo and found this: https://software.intel.com/en-us/articles/mashery-weather-application
Looks great, but requires booting the board off of Linux, which could work but seems like it'd make things more complicated. https://software.intel.com/en-us/blogs/2014/06/28/mashery-api-network-and-intel-galileo-oauth-for-nodejs
I'll put that on hold for now.
Another idea was to try Temboo, an API service that I've used with the Arduino Yun. I met some people from Temboo at an IoT meetup and asked them about support for the Galileo. They told me that it should work and to email them if it didn't. After a few unsuccessful trials I emailed them to find they have not yet completed adding support for the Galileo, but they are working on it, so hopefully we can use it soon. Definitely worth checking out though: https://www.temboo.com/
So I decided instead to just look at some Arduino Ethernet Shield weather sourcing examples. Found this from the Arduino Cookbook and it seems to work just fine:
/* * Simple Client Google Weather * gets xml data from http://www.google.com/ig/api?weather=london,uk * reads temperature from field: <temp_f data="66" /> * writes temperature to analog output port. */ #include <SPI.h> // needed for Arduino versions later than 0018 #include <Ethernet.h> byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; char serverName[] = "www.google.com";
EthernetClient client; void setup() { Serial.begin(9600); if(Ethernet.begin(mac) == 0) { // start ethernet using mac & IP address Serial.println("Failed to configure Ethernet using DHCP"); while(true) // no point in carrying on, so stay in endless loop: ; } delay(1000); // give the Ethernet shield a second to initialize
Serial.println("connecting..."); } void loop() { if (client.connect(serverName,80)>0) { // get google weather for London client.println("GET /ig/api?weather=london HTTP/1.0"); client.println(); } else { Serial.println(" connection failed"); } if (client.connected()) { // get temperature in fahrenheit (use field "<temp_c data=" for Celsius)
if(client.find("<temp_f data=") ) { int temperature = client.parseInt(); Serial.print("Temperature is "); // and echo it to the serial port Serial.println(temperature); } else Serial.print("Could not find temperature field"); // get temperature in fahrenheit (use field "<temp_c data=" for Celsius) if(client.find("<humidity data=") ) { int humidity = client.parseInt(); Serial.print("Humidity is "); // and echo it to the serial port Serial.println(humidity); } else
Serial.print("Could not find humidity field"); } else { Serial.println("Disconnected"); } client.stop(); client.flush(); delay(60000); // wait a minute before next update }
First off, to connect the Galileo to the internet. I found a ethernet cable and hooked it up and uploaded the web client sketch from the Arduino example, library. Unfortunately, it did not work the first time, but a little googling showed me that I am not alone.
It seems like the web client example should work fine, but to be sure, you should:
plug in ethernet cable before plugging in the power for the galileo board
add a delay while establishing a connection
here is my final code that works!
/*
Web client
This sketch connects to a website (http://www.google.com)
using an Arduino Wiznet Ethernet shield.
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
created 18 Dec 2009
modified 9 Apr 2012
by David A. Mellis
*/
//#include <SPI.h> - not needed on Galileo
#include <Ethernet.h>
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
//byte mac[] = { 0x00, 0x13, 0x20, 0xFF, 0x11, 0xF1 }; // Arduino's artificial mac address - not needed on Galileo
IPAddress server(173,194,33,104); // Google
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
delay(3000);
// start the Ethernet connection: - not needed on Galileo
///if (Ethernet.begin(mac) == 0) { - not needed on Galileo
///Serial.println("Failed to configure Ethernet using DHCP"); - not needed // on Galileo
// no point in carrying on, so do nothing forevermore: - not needed on // Galileo
///for(;;) - not needed on Galileo
/// ; - not needed on Galileo
///} - not needed on Galileo
// give the Ethernet shield a second to initialize: - not needed on Galileo
///delay(1000); - not needed on Galileo
Serial.println("connecting...");
// if you get a connection, report back via serial:
if (client.connect(server, 80)) {
Serial.println("connected");
// Make a HTTP request:
client.println("GET /search?q=arduino HTTP/1.0");
client.println();
}
else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
}
void loop()
{
// if there are incoming bytes available
// from the server, read them and print them:
if (client.available()) {
char c = client.read();
Serial.print(c);
}
// if the server's disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
// do nothing forevermore:
for(;;)
;
}
}
I love world maps. I love to look at them and think about all of the places I've been and want to go. As I thought about the internet, world, connection, and all of that, I decided I wanted to somehow make a world map responsive, to somehow connect everything on the map.
My family is Turkish and I often think about what they are doing in Turkey when I'm in the U.S. Whenever we talk on the phone, I always ask my grandma how the weather is over there, because I like to take a minute and think about it. If she says it's cold and windy I like to imagine what the sea in front of her house must look like, all choppy and dark. If she says it's hot and dry, I think about how the water must be flat and clear.
So, I decided to make a weather responsive world map, the idea being that when you touch a certain place on the map, the temperature of the surface of the map changes to the current temperature of that place.
Basic Plan:
Button/Pressure Input on map ---> Galileo asks Internet for current temp at location assigned to button ---> somehow heats a metal plate attached to the map to that temperature
My Intel Galileo Explorations @galileoheatmap-blog - Tumblr Blog | Tumgag