This workshop is designed to introduce participants to the programming of Arduino Yúns using Temboo. The target audience includes people with all levels of experience with Arduino, but who are not familiar with Temboo. This lesson plan includes basic examples from the Temboo website to help participants understand how Temboo’s integration with Arduino works and what can be done with an Arduino board using Temboo’s software, and also allows time for participants to tackle more challenging projects of their own choosing.
This workshop will take between 1.5 and 2 hours, depending on how comfortable participants are with wiring Arduinos and how enthusiastic they are about tackling complicated projects of their own at the end.
One per person is ideal, but there should be at least one for every three people.
Ideally, every participant will simply bring his or her own.
These are not strictly necessary because the Yún is WiFi-enabled, but they can make connecting to the Internet go more smoothly in some cases. It is also good to bring a couple of USB to Ethernet adaptors for those whose computers do not have Ethernet ports.
Sensors that can return a range of values (e.g., photo, proximity, and temperature sensors) are better than sensors that return only two values (e.g., push-button and motion sensors), but it is good to have a mix of both if possible.
Remember to calculate the required resistance for your sensors and LEDs.
Bring a couple in case some participants are more comfortable with wiring breadboards or are building more complex circuits.
Bring a spool and cutters or a few pre-cut jumper wires to go with the breadboards.
These are fun for advanced participants who are quickly ready to do something more complex than turn on an LED.
The workshop is best with a small group (15 – 20 people maximum). Ideally, there will be about 1 instructor or knowledgeable helper for every 5 participants.
1[Optional]
Use IoT Mode to set up a Yún with a button that will send an SMS when pressed; that can be done here. You will need a Twilio account for the demo, which you can set up here. As participants come in, invite them to save their phone number in the Profile you are using and then press the button to send themselves a “Welcome” text message (assure them that you are not keeping their phone numbers!). As an alternative, you can send an email instead of a text message if you do not want to create a Twilio account or are concerned about soliciting phone numbers.
2Project a slide instructing the participants to:
3Let the participants take 10 minutes to get everything set up, and go around the room helping where needed.
4Offer a brief overview of the workshop and its goals, which are:
5Introduce participants to Temboo
6Introduce participants to Arduino
7Demonstrate the Temboo “turn on the light with your phone” example
delay(5000); digitalWrite(PIN_NUMBER, LOW);
8Take questions if there are any.
9Plug in the Yún and open the Arduino IDE. If anyone didn’t finish installing the IDE at the beginning of the workshop, that should be done now.
10In the Arduino IDE, go to Tools > Board and Tools > Port, and select the Yún in both.
11Connect the Yúns to the Internet.
If the workshop participants have some experience using Arduinos, this is probably an unnecessary exercise that may be omitted. It uses an example sketch that comes in the Arduino IDE, and is a good way to confirm that the board itself is operational.
12If you are working with digital sensors (such as push buttons), go in the Arduino IDE to File > Examples > 02.Digital > Button; this will open a pre-written sketch that blinks an LED in response to a digital input. If you are working with analog sensors (such as photo sensors), go to File > Examples > 03.Analog > AnalogInput for a sketch that does the same in response to an analog input.
13Follow the wiring instructions given in the sketch; a link to a wiring diagram is also provided in the sketch.
14Run the sketch, and ensure that the LED is lighting up properly to confirm that the Yún is running.
15Starting at the Library page, point out some of the different APIs in the Library, and then navigate to the Google > Gmail > SendEmail Choreo.
16With IoT Mode off, generate the code for the Choreo in Java. Point out how you can create and save a Profile.
17Explain what a Profile is, and how it helps to decrease the memory needed to call a Choreo in addition to making it possible to change inputs without re-uploading, both of which are good for connected hardware.
18Run the Choreo from the browser, and have the participants check their emails to see that the Choreo executed successfully from the web. Note that the first time they run the sketch, they may be blocked by Google’s security features; to authorize access, follow the directions here.
19Scroll down the page and explain the various elements (optional inputs, the output, and the generated code). Point out how, after the successful Choreo execution, the output now shows the response returned as “Success.” Also show how to switch languages with the language dropdown. Note that the generated code for each language will execute the same Choreo process from a program that you just executed from the web.
20Take questions if there are any.
21While still on the Google > Gmail > SendEmail Choreo page, turn on IoT mode and show how the code for the Choreo can be generated as, in this case, a complete Arduino sketch that will work on the hardware you specify in the dropdown menus at the top of the page.
22Using the IoT Mode interface, add an input condition to the sketch so that it is triggered by the sensor you are working with. When selecting the pins, walk the participants through the interface, and give them time to wire their boards. It is simplest to direct them to use the same pins that you are using, at least at first. For this sketch, you’ll only need to initialize an input—outputs can be added later. Note: Depending on the experience level of the participants, this may be tricky for some of them. Be prepared to take a break, walk around the room, and help everyone get set up.
23Push the code to the Arduino, and test it out.
24Take questions if there are any.
25Next, generate a sketch in IoT Mode to log data from your sensor in a Google spreadsheet using the Google > Spreadsheets > AppendRow Choreo.
26Use the same Profile from the original run in Java, and point this out.
27Use the IoT Mode interface to add an output condition that will turn on an LED when the Choreo executes successfully. Point out that this is a straightforward way to have hardware respond to information returned by a Choreo, and that it is especially useful for other APIs that return more than just a success or failure message.
28Note that all of the Choreos in the Temboo Library work the same way, so you could build like this with any of them from IoT mode. The participants will have the opportunity to do this soon.
29Set up a Google spreadsheet, noting that exactly one column must have a header.
30Push the code to the Arduino, and test it out.
31Show how you can use the spreadsheet to create a graph that updates in real time using the “Insert Chart” function in Google spreadsheets.
32Take questions if there are any.
33Tell the participants that they can now work on an idea of their own using Temboo and their Yúns.
34Remind them that they have the entire Temboo Library and any sensors you have with you at their disposal, and that the Temboo integration will work the same way for everything.
35Note that Arduino has plenty of resources on its website in addition to what Temboo has.
36Suggest several ideas for people of varying comfort levels (listed here from least challenging to most challenging):
37Go around the room helping people who have questions.
38Take any final questions.
39Clean up!
We're always happy to help. Just email us at education@temboo.com, and we'll answer your questions.