• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Interfacing with Arduino
 

Interfacing with Arduino

on

  • 3,694 views

Slides from the TinkerSoc Interfacing with Arduino session.

Slides from the TinkerSoc Interfacing with Arduino session.

Statistics

Views

Total Views
3,694
Views on SlideShare
3,689
Embed Views
5

Actions

Likes
2
Downloads
0
Comments
0

1 Embed 5

http://www.slideshare.net 5

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Interfacing with Arduino Interfacing with Arduino Presentation Transcript

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