background preloader

Hobby Engineering Home Page

Hobby Engineering Home Page

Arduino Tutorial - Lesson 5 We've done a lot so far, blinking lights, printing messages...all of that stuff is output: signals coming from the Arduino. The next step is to start playing with input, with the Arduino responding to outside events. In this lesson we will begin with the most basic kind of input, a push-button switch! You're probably familiar with switches, there's tons of them in your house. On the left, the switch is open and no current flows. (thanks wikipedia!) In this photo, you can see the internals of a light switch. Light switches are great but we need something smaller. These little switches are a 1/4" on each side, cost about 25 cents, and can plug directly into a breadboard. Normally, the two wires are disconnected (normally open) but when you press the little button on top, they are mechanically connected. To get the buttons to sit better in the protoshield, you may want to straighten out the legs (just squish them with a pair of pliers) so that they look like the button on the left. Fig 5.2

Welcome Engineering ToolBox Cheap Arduino Wireless Communications I was looking for a way to handle wireless communications between two Arduino boards. Other options like Xbee or Bluetooth were going to cost $50 to over $100. Then I found a cheap RF transmitter and receiver at Sparkfun. The total cost is only $9! Here are a few limitations to RF solution: Communications is only one way. The advantages are that it is cheap and it is pretty easy to use. Below are some images showing how I hooked up the receiver and transmitter to two different Arduino boards. Here’s a picture of the my actual bread boarded circuit. Since the receiver is constantly picking up random noise I add a few extra bytes to every data packet. I broke the Arduino code into two files. I did all of my initial testing without any of these improvement and everything worked fine with these devices inside the same room. Add an antenna. I got a lot of help from the transmitter/receiver data sheets, and from this article. I’ll mention an even cheaper idea I had while doing this. Permalink

Beginners Guide Beginners Guide to Electronics by Martin T. Pickering Last updated on November 23, 2008 This book gives simplified explanations of how some electronic components work in a circuit. I first became interested in electronics when I was age 10 (as long ago as 1961). ©2008 Martin T. What's the Difference between A.C. and D.C.? How does a Resistor Work? All the colours for 5% tolerance resistors: How do Diodes Work? How do Transistors Work? Abbreviations Although we use the Greek symbol Omega W to represent “Ohms” it is frequently written as “R”. How does a Capacitor Work? What does a capacitor look like? How do Inductors Work? The Relay Bread Board and building a LED Flasher Building the LED Flasher Astable Multivibrator using two transistors

The World Famous Index of Arduino & Freeduino Knowledge BeagleBoard.org - default 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

Related: