Kamis, 03 April 2014

Xathrya Sabertooth

Xathrya Sabertooth


List of Component and Device for ARM Tutorial Series

Posted: 02 Apr 2014 07:53 AM PDT

If you want to start tinkering in ARM, you may look at following list. This list is the parts you might need to follow my tutorials. You are not obligate to gather all because I always specify what materials you need in every article. However, you can see following as a reference.

Board

I have both learning board and development board.

For learning board I mainly focus on Nuvoton LB-NUC140.

For development board I mainly focus on DT-ARM NUC120.

Component

Buy one item of component isn’t too useful. A better idea is to buy a pack of that component, if possible.

  • Resistors:
    1. 100 ohm x 3
    2. 220 ohm x3
    3. 330 ohm x 3
    4. 10k ohm x 3
    5. 1k ohm x 3
  • Light Emitting Diode (LED): Choose 5mm LED any color. We use three LEDs at minimum.
  • Trimpot
  • Photocell
  • Pushbuttons x 2
  • Some wires, preferably breadboard jumper wires.
  • infrared LED
  • pin 0.1″ standard header x 6
  • Piezo speaker or buzzer

Some sensors we need:

  • Parallax PING))) sensor
  • TMP36 temperature sensor (or LM35 for alternative)
  • ADXL335 accelerometer breakout board
  • PNA4602 infrared sensor
  • Tilt sensor

and actuator:

  • Servo 5V, for example: Hitec HS-322HD or Vigor Hextronic

Tools

  • Standard A-B USB cable. This cable is used for connecting Arduino to computer
  • Breadboard. You can use either 400 pin or 170 pin breadboard.

Additional Gadgets

Of course this is optional.

  • Nintendo Nunchuk controller

List of Component and Device for Arduino Tutorial Series

Posted: 02 Apr 2014 07:46 AM PDT

If you want to start tinkering Arduino, you may look at following list. This list is the parts you might need to follow my tutorials. You are not obligate to gather all because I always specify what materials you need in every article. However, you can see following as a reference.

Arduino board

Normally I would use my Arduino Uno R3, unless told otherwise. You can use any Arduino board you think suitable for both your budget or your specidication.

Component

Buy one item of component isn’t too useful. A better idea is to buy a pack of that component, if possible.

  • Resistors:
    1. 100 ohm x 3
    2. 220 ohm x3
    3. 330 ohm x 3
    4. 10k ohm x 3
    5. 1k ohm x 3
  • Light Emitting Diode (LED): Choose 5mm LED any color. We use three LEDs at minimum.
  • Trimpot
  • Photocell
  • Pushbuttons x 2
  • Some wires, preferably breadboard jumper wires.
  • infrared LED
  • pin 0.1″ standard header x 6
  • Piezo speaker or buzzer

Some sensors we need:

  • Parallax PING))) sensor
  • TMP36 temperature sensor (or LM35 for alternative)
  • ADXL335 accelerometer breakout board
  • PNA4602 infrared sensor
  • Tilt sensor

and actuator:

  • Servo 5V, for example: Hitec HS-322HD or Vigor Hextronic

Tools

  • Standard A-B USB cable. This cable is used for connecting Arduino to computer
  • Breadboard. You can use either 400 pin or 170 pin breadboard.

Additional Gadgets

Of course this is optional.

  • Nintendo Nunchuk controller

Arduino Project: Arduino and LM35 Sensor

Posted: 02 Apr 2014 06:37 AM PDT

LM35 is an integrated circuit sensor that can be used to measure temperature with an electrical output proportional to the temperature in Celcius. Compared to thermistor, this component give more accurate result and generate higher voltage than thermocouples which may not require output amplifier.

LM35

The scale factor for this sensor is .01V/oC and doesn’t require any external calibration or trimming and maintains an accuracy of +/-0.4 oC at room temperature and +/-0.8 oC over range of 0oC to 100 oC. It has three leg: VCC, V-out, GND. The VCC is input voltage to supply the IC. The V-out is the pin which output the result temperature reading. The GND is ground.

LM35Detail

Objective

  • Measure surrounding temperature.
  • Display the measured temperature to serial communication

Prerequisite

  • none

Requirement

Following is all materials I use for this tutorial.

  • Arduino Uno R3
  • LM35

You can change the Arduino board to higher specification if you like.

You also need an USB A to B cable for upload our program to our Arduino.

Circuit

Here is the circuit image, created using Fritzing.

SimpleTemperatureSensor

Make sure you have the pin and leg configured properly. We will connect V-out leg to pin Analog 0 or A0. Next we can sense the temperature by read the value of this pin.

Code

Let’s see what code we use for this project and discuss it later.

const unsigned int TEMP_SENSOR_PIN = 0;   // We mean analog 0  const float SUPPLY_VOLTAGE = 5.0;         // If you use 3.3V, write it here.  const unsigned int BAUD_RATE = 9600;    const float get_temperature() {    const int sensor_voltage = analogRead(TEMP_SENSOR_PIN);    const float voltage = sensor_voltage * SUPPLY_VOLTAGE / 1024;    return (voltage * 100);  }    void setup() {    Serial.begin(BAUD_RATE);  }    void loop() {    Serial.print(get_temperature());    Serial.println(" C");    delay(1000);  }

We define the pin for reading as TEMP_PIN and assign this constant by 0. Remember that our reading will be in analog, so we will use analogRead() function instead of digitalRead() function. We use 5.0V from Arduino and write it as constant SUPPLY_VOLTAGE. If you use different voltage, write it there.

Result

Open serial communication on Arduino IDE. You will see something similar to this:

LM35SerialCommResult

Why it Works

The heart of this project is get_temperature().

const float get_temperature() {    const int sensor_voltage = analogRead(TEMP_SENSOR_PIN);    const float voltage = sensor_voltage * SUPPLY_VOLTAGE / 1024;    return (voltage * 100);  }

First, we read the output of sensor. The value range from 0 to 1023, which is a scale actually. We multiply the output with our SUPPLY_VOLTAGE, we got the exact value which has V unit. Division with 1024 is applied as the highest output is 1024 value. Because the precision is 10 mV/oC, we should convert the Volt unit to mV unit which we next multiply it by 1000. But wait, we then should divide it with 10 the scale, so we can get the shortcut: just multiply the voltage with 100. And that’s the recipe.

You can revise the code to make compact code by using magic number.

const float get_temperature() {    return (analogRead(TEMP_SENSOR_PIN) * 0.48828125);  }

Where did we get this magic number? You should figure it by yourself ;)

Tidak ada komentar:

Posting Komentar