playground - Gyro This is just a basic code snippet for the time being, but please feel free to contribute more information Gyroscopes measure the rate of change of a particular axis at the current moment in time. This means that to keep track of our angle, we need to sum all of the rates of change over a given period of time. We're essentially looking for the integral of our gyro data. First off, you'll want to set the voltage of your gyro (typically 3.3v or 5v) for the gyroVoltage variable. Next you'll need to know the zero voltage of your gyro. The other value you'll need from the datasheet is the sensitivity. The Arduino has 10 bit ADC which can represent a voltage (0-5V) in values from 0 to 1023. /* Keep track of gyro angle over time * Connect Gyro to Analog Pin 0 * * Sketch by eric barch / ericbarch.com * v. 0.1 - simple serial output * */ float currentAngle = 0; //Keep track of our current angle void setup() { Serial.begin (9600);} //DEBUG Serial.println(currentAngle); delay(10);}
Arduino Ethernet shield I finally figure out to use Ethernet Shield. Even though Arduino provides a good example of web server, the beginner really does not understand it well. Also the book "Making Things Talk" did not help me at all. This is a tutorial of how to use Arduino's official Ethernet Shield as a web server. Requirement Your computer which has a Ethernet connection and USB. Internet connection Arduino Arduino program Official Arduino Ethernet Shield which has a chip WIZnet W5100 two Ethernet cable. USB cable Web Browser. A little knowledge of network(I will explain later). Step one First thing you need to do is to build Arduino Ethernet shield ready to use. see the following picture. you can add sensor to the analog pin if you want you will those value through the Internet. + Do not connect any thing to the digital pins number 10, 11, 12, and 13 . Second Step Load a ready made program that is in samples. File>Examples>Ethernet>WebServer. The ready made program will be load in a new window. Server server(80); Step 3
ArduinoISP Learning Examples | Foundations | Hacking | Links This tutorial explains how to use an Arduino board as an AVR ISP (in-system programmer). This allows you to use the board to burn the bootloader onto an AVR (e.g. the ATmega168 or ATmega328 used in Arduino). The code in this example is based on the mega-isp firmware by Randall Bohn. Instructions To use your Arduino board to burn a bootloader onto an AVR, you need to follow a few simple steps. Open the ArduinoISP firmware (in Examples) to your Arduino board. Circuit (targeting Arduino Uno, Duemilanove, or Diecimila) An Arduino board serving as an ISP to program the ATmega on another Arduino board. Circuit (targeting Arduino NG or older) On NG or older boards, connect the reset wire to pin 1 of the Atmega chip on the board, as shown above. Circuit (targeting an AVR on a breadboard) See the Arduino to Breadboard tutorial for details.
A Multi-Protocol Infrared Remote Library for the Arduino Do you want to control your Arduino with an IR remote? Do you want to use your Arduino to control your stereo or other devices? This IR remote library lets you both send and receive IR remote codes in multiple protocols. To use the library, download from github and follow the installation instructions in the readme. How to send This infrared remote library consists of two parts: IRsend transmits IR remote packets, while IRrecv receives and decodes an IR message. #include <IRremote.h> IRsend irsend; void setup() { Serial.begin(9600); } void loop() { if (Serial.read() ! This sketch sends a Sony TV power on/off code whenever a character is sent to the serial port, allowing the Arduino to turn the TV on or off. How to receive IRrecv uses an infrared detector connected to any digital input pin. The examples/IRrecvDemo sketch provides a simple example of how to receive codes: The IRrecv class performs the decoding, and is initialized with enableIRIn(). Hardware setup Some background on IR codes
ArduinoToBreadboard This tutorial explains how to migrate from an Arduino board to a standalone microcontroller on a breadboard. It's similar to this tutorial, but uses an Arduino board to program the ATmega on the breadboard. Unless you choose to use the minimal configuration described at the end of this tutorial, you'll need four components (besides the Arduino, ATmega328, and breadboard): a 16 MHz crystal, a 10k resistor, and two 18 to 22 picofarad (ceramic) capacitors. Uploading Using an Arduino Board Once your ATmega328p has the Arduino bootloader on it, you can upload programs to it using the USB-to-serial convertor (FTDI chip) on an Arduino board. Uploading sketches to an ATmega on a breadboard. Minimal Circuit (Eliminating the External Clock) If you don't have the extra 16 MHz crystal and 18-22 picofarad capacitors used in the above examples, you can configure the ATmega328 to use its internal 8 MHz RC oscillator as a clock source instead. Attention This procedure works on Arduino 1.0.x software.
Wiring playground - RegulatedPositiveVoltageBooster Outputs 1/4 Watt, up to +60V DC Max Accepts any input voltage (1V minimum) Uses a simple, flexible circuit Warning: If you don't follow the instructions carefully, wiring this circuit wrong can damage your Arduino. Arduino Project and Schematic Download RegVoltageBooster.zip Schematic Pictures The Arduino 5V boosted to 40V, with a hand made inductor. The same circuit, with the Arduino regulating at 9V instead. Circuit Theory Inductors resist changes in current. There are many ways to explain the relationship between PWM (analog output) and output voltage. Don't worry about the gain of the transistor. The exact inductance of L1 doesn't matter. If you're trying to get more than one watt, then use a darlington pair. Software Summary The Arduino ATMega168 regulates the output voltage. The program was written for both the ATMega8 or ATMega168. Inductors that work Each inductor behaved a bit differently. The bottom row has two hand made inductors. The quarter is there to show the image's scale. Safety
PortManipulation Reference Language | Libraries | Comparison | Changes Port registers allow for lower-level and faster manipulation of the i/o pins of the microcontroller on an Arduino board. The chips used on the Arduino board (the ATmega8 and ATmega168) have three ports: B (digital pin 8 to 13) C (analog input pins) D (digital pins 0 to 7) Each port is controlled by three registers, which are also defined variables in the arduino language. DDR and PORT registers may be both written to, and read. PORTD maps to Arduino digital pins 0 to 7 DDRD - The Port D Data Direction Register - read/write PORTD - The Port D Data Register - read/write PIND - The Port D Input Pins Register - read only PORTB maps to Arduino digital pins 8 to 13 The two high bits (6 & 7) map to the crystal pins and are not usable DDRB - The Port B Data Direction Register - read/write PORTB - The Port B Data Register - read/write PINB - The Port B Input Pins Register - read only PORTC maps to Arduino analog pins 0 to 5. Examples See
Arduino Ethernet Shield Tutorial The Ethernet Shield is based upon the W51000 chip, which has an internal 16K buffer. It has a connection speed of up to 10/100Mb. This is not the fastest connection around, but is also nothing to turn your nose up at. It relies on the Arduino Ethernet library, which comes bundled with the development environment. There is also an on-board micro SD slot which enables you to store a heck-of-a-lot of data, and serve up entire websites using just your Arduino. The board also has space for the addition of a Power over Ethernet (PoE) module, which allows you to power your Arduino over an Ethernet connection. For a full technical overview, see the official Ethernet Shield page. Setting up an Arduino on a breadboard Overview This tutorial shows you how to build an Arduino compatible breadboard with an Atmel Atmega8/168/328 AVR microcontroller and FTDI FT232 breakout board from SparkFun. You could also use the Arduino USB Mini. Originally created David A. Parts To do this, you'll need: The Supplies Basic Parts for wiring up Arduino A breadboard 22 AWG wire 7805 Voltage regulator 2 LEDs2 220 Ohm resistors 1 10k Ohm resistor 2 10 uF capacitors 16 MHz clock crystal 2 22 pF capacitors small momentary normally open ("off") button, i.e. USB to Serial Communication Board You will need a FT232 USB Breakout board from SparkFun. FT232RL USB to Serial Breakout Board, SKU BOB-0071Arduino Serial USB Board, SKU DEV-08165 If you plan to use the top option and have not yet soldered headers to the breakout board, now would be a good time. Bootloading your Atmega Chips There are several options for bootloading your Atmega chips, a few of which are covered in this tutorial. Adding circuitry for a power supply Top Power lines