Thursday, April 7, 2016

Arduino Input-Output project

This page will cover how to program an input/output for Arduino. This is a partial continuation of the previous Ardunio project, however, it will have an input as well. Here is the design and programming process:

Firstly, the arduino itself needs to be discussed. The most important step is to buy an arduino board. The actual board being used is the SparkFun RedBoard. It is a comparable board to the Arduino Uno, which is brand name equivalent. The RedBoard has the same features as the Uno for a lower price. I have not dealt with the Uno at all, but the RedBoard seems to be a good choice. The RedBoard also came in a kit that was required for this class. If a someone was looking into circuit prototyping, I would highly recommend this kit.

Now that choosing which arduino board to purchase is done the next step are the specifications. According to the arduino website, an Arduino Uno has 14 digital input/output pins and 6 analog input pins. The RedBoard has the same specifications as the Uno in virtually every way. The code is from the SIK guide provided by SparkFun with the Inventor's Kit. This project can be found on page 57. Here is the circuit working:




It is fairly simple, the circuit uses and RGB LED and a potentiometer. The potentiometer has different output values and those are sent to the arduino board. Based on what value is received the arduino then outputs different levels of voltage to the LED. An RGB LED has four leads, also known as legs. Three legs control what the color is while the fourth is the ground. This diagram shows which legs do what:

Photo Source: http://howtomechatronics.com/

There are also four resistors, x3 330 ohm and x1 10k ohm. These help prevent backload and lower and regulate voltage down to appropriate levels. This schematic can be found in the SIK guide, as aforementioned. I did change the soft/flexible potentiometer for a standard one, a dial potentiometer. This allows for precise control of colors. If you are interested in exact details, either watch the video or read the online PDF. The link to the code can be found in the SIK Guide PDF on page 9.

This was a simple and straight forward project. There is little, if any, to change or improve. This style of project could be applied to various projects, like with a stepper motor or servo. It would you to precisely control the position of an arm or how far the motor rotates. The applications are truly endless. Another fun and simple project.

No comments:

Post a Comment