Your SlideShare is downloading. ×
0
Interfacing with Arduino
Interfacing with Arduino
Interfacing with Arduino
Interfacing with Arduino
Interfacing with Arduino
Interfacing with Arduino
Interfacing with Arduino
Interfacing with Arduino
Interfacing with Arduino
Interfacing with Arduino
Interfacing with Arduino
Interfacing with Arduino
Interfacing with Arduino
Interfacing with Arduino
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Interfacing with Arduino

2,836

Published on

Slides from the TinkerSoc Interfacing with Arduino session.

Slides from the TinkerSoc Interfacing with Arduino session.

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,836
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Omer Kilic | omer@tinkersoc.org<br />
  • 2. Interfacing?<br />A<br />B<br />
  • 3. Standard Computer Interfaces<br />Wired<br />USB<br />Serial Port<br />Parallel Port<br />Firewire<br />Ethernet<br />And others…<br /><ul><li>Wireless
  • 4. WiFi
  • 5. Bluetooth
  • 6. IrDA</li></li></ul><li>‘Embedded’ Interfaces<br />SPI<br />I2C<br />1-Wire<br />UNI/O<br />And others…<br />
  • 7. RS232 – The Serial Port<br />Asynchronous serial communications protocol<br />No clock is sent - the receiver must provide the clock signal<br />Data rate must be known by transmitter and receiver<br />Arduino implements a ‘virtual’ serial port via USB<br />http://arduino.cc/en/Reference/Serial<br />
  • 8. Voltage Levels<br />Different devices may have different voltage levels<br />Example: RS232<br />Voltage levels specified as +12/-12 volts in the standard<br />Hooking these levels up to the micro will FRY it!<br />Solution: Use a level converter<br />
  • 9. RS232 Level Converter<br />
  • 10. Virtual COM Ports<br />Serial port via USB<br />Applications think they are talking to a serial port, which is emulated by the drivers<br />No need to have a physical serial port!<br />Most new machines don’t have them anyway<br />A LogicalChoice(tm) !<br />
  • 11. Example Project: Thermometer<br />A temperature sensor is connected to an analog input on the Arduino<br />Arduino periodically reports the temperature back to PC<br />PC uses this data to plot graphs etc.<br />
  • 12. It’s an analog world…<br />Digital – only has two values: on/off<br />Analog – has many (infinite) values<br />Computers don’t really do analog<br />So they fake it, with quantization<br />From Tod E. Kurt’s ‘Spooky Projects’ notes - http://todbot.com/blog/spookyarduino/<br />
  • 13. Thermometer: Arduino Code<br />intsensorPin = 0; // the analog pin that the sensor is connected to<br />void setup(){<br />Serial.begin(9600);<br />}<br />void loop(){<br />//getting the voltage reading from the temperature sensor<br />int reading = analogRead(sensorPin); <br />// converting that reading to voltage, for 3.3v arduino use 3.3<br />float voltage = reading * 5.0 / 1024; <br />// print out the voltage<br />Serial.print(voltage); Serial.println(&quot; volts&quot;);<br />// now print out the temperature<br />floattemperatureC = (voltage - 0.5) * 100; <br />// converting from 10 mV per degree with 500 mV offset <br />// to degrees ((voltage - 500mV) times 100)<br />Serial.print(temperatureC); Serial.println(&quot; degress C&quot;);<br />delay(1000); // wait a second<br />}<br />From Ladyada’s TMP36 Tutorial - http://www.ladyada.net/learn/sensors/tmp36.html<br />
  • 14. Thermometer: PC Side<br />Read the incoming data every X seconds (cron)<br />Collect and plot temperature graphs (rrdtool)<br />Example: thermostat-graph<br />http://www.anders.com/projects/thermostat-graph/<br />Not an Arduino project but easily hackable!<br />
  • 15. Example Project: OrangeMessenger<br />(demo)<br />
  • 16. Thank you for listening Any questions?<br />Further questions/comments to omer@tinkersoc.org please…<br />

×