Welcome to Provide Your Own - arduino


Using ATtiny Chips for Arduino-Like Projects

The Arduino platform is great for prototyping. Its easy-to-use shield architecture, readily identifiable pin numbering scheme, and beginner friendly IDE and software library has created a large and loyal following. In the life of many projects, however, there comes a time when the project is to be permanently deployed. When that time comes, leaving a precious Arduino in the field is often not the best option. Instead, a specialized board with either an ATmega chip or even an ATtiny chip is the best choice.

When cost or space is a factor an ATtiny chip is an attractive alternative to the ATmega for simpler projects. Thanks to the Arduino-Tiny project, an ATtiny can be used as a drop-in replacement for most Arduino projects. This initiative provides ATtiny chip configurations as upload board choices in the standard Arduino IDE. By following the instructions described in my previous article – Program an ATtiny Using an Arduino – your Arduino sketch can be uploaded as easily to an ATtiny board as it can be to an Arduino one.

More recently, the ATtiny has gained semi-official support given the variants posted by David Mellis on Github. Please note that this new firmware specification … Read the rest

Posted in Tech | Also tagged | Section: | Comments closed

Statistics on the Arduino (also Pic or any microcontroller)

Normal Distribution Curve

When collecting any data on the Arduino, it won’t be very long before you need to calculate some statistics on that data. While statistics can be a pretty intense mathematical field, some very basic statistics such as calculating the mean and standard deviation can be invaluable for many applications.

Fortunately, it is not only easy to make these calculations, but its usefulness can extend beyond just statistics. Many times data from a sensor may not be stable. Touch sensing is a good example. Each individual value (data point) can vary quite a bit, making it difficult to make an accurate determination. By averaging these values, a better decision can be made.

In a similar vein, by calculating the standard deviation, you can assess the quality of the values obtained. A large deviation from the mean can indicate problems with your sensor.

Design Challenges

Because statistics often require some extensive data collection, normal methods can be too memory intensive for small microcontrollers like the Arduino or ATtiny based designs. Normally each value is stored and, when all the data is collected, various calculations such as the mean and standard deviation are calculated on the data set. Storing this much data can … Read the rest

Posted in Tech | Also tagged , , | Section: | Comments closed

Getting Started with Arduino

Arduino

If you have any interest in either electronic circuits or micro-controllers, you have probably heard of the Arduino. Unless you have actually worked with the Arduino, you may only have a vague idea of what all the excitement is all about. If you are one of those who have wondered what the Arduino is, would like to know more about it, this article will answer most of your questions and give you a good grasp of the concepts.

Since this article is geared toward those with no or little prior knowledge of the Arduino platform, you may be inclined to skip it if you are more experienced. There is however, some useful information for the more experienced. You may often find yourself at a loss for words when describing the Arduino or your Arduino based projects to your family and friends. In that case, you might find this tutorial provides a good framework for improving your communication.

What is an Arduino?

The Arduino is a microcontroller based platform. It is not a microcontroller, but is an entire development/engineering environment and eco-system based on a family of microcontrollers from the Atmel corporation.

There are many microcontrollers from various corporations available, and … Read the rest

Posted in Tech | Also tagged | Section: | Comments closed

Secret Arduino Voltmeter – Measure Battery Voltage

A little known feature of Arduinos and many other AVR chips is the ability to measure the internal 1.1 volt reference. This feature can be exploited to improve the accuracy of the Arduino function – analogRead() when using the default analog reference. It can also be used to measure the Vcc supplied to the AVR chip, which provides a means of monitoring battery voltage without using a precious analog pin to do so.

I first learned of this technique from these articles – Making accurate ADC readings on the Arduino, and Secret Voltmeter. In this article, I have incorporated some additional improvements.

Motivation

There are at least two reasons to measure the voltage supplied to our Arduino (Vcc). One is if our project is battery powered, we may want to monitor that voltage to measure battery levels. Also, when battery powered, Vcc is not going to be 5.0 volts, so if we wish to make analog measurements we need to either use the internal voltage reference of 1.1 volts, or an external voltage reference. Why?

A common assumption when using analogRead() is that the analog reference voltage is 5.0 volts, when in reality it may be quite different. … Read the rest

Posted in Tech | Also tagged | Section: | Comments closed

Arduino Leonardo versus Uno – What’s New

Arduino Leonardo

Arduino’s latest incarnation – the . It is the first Arduino to use Atmel’s ATmegaXU4 series chip with built-in USB. This change is big and it has big benefits.

Early Arduinos required a serial port connection to your computer for programming. As the platform matured, the board acquired a USB to serial conversion chip. The latest version of the classic Arduino board – the Uno – still uses this method, although with the Uno a switch was made from an expensive FTDI conversion chip to using an ATmegaXU2 series microcontroller chip. This chip is a cousin to the U4 series, but lacks analog input pins.

Using a USB conversion chip was only a slight improvement over using a serial connection. It removed the requirement for a special conversion cable, but added significant cost to each and every board. With the Uno, the switch to using the ATmeag8U2 lowered the cost by a few dollars, but it seems kind of silly to use an entire microcontroller just to perform USB to serial conversion for another microcontroller of roughly the same capability.

This ironic situation is finally resolved with the introduction of the Leonardo. Not only does this AVR chip offer built-in … Read the rest

Posted in Tech | Tagged | Section: | Comments closed

Guide to Arduino and AVR Communications

easytransfer_serial_arduino_communications_library

If you spend any time playing with Arduinos, ATtinys or looking at AVR spec sheets, you soon encounter a bewildering smörgåsbord of acronyms for various communication protocols. With examples such as I2C, LIN, SPI, TWI, USI, etc., it can get pretty confusing. If you don’t believe me, just take a look communications column for Digikey’s listing for the ATmega series chips. Confused yet?

What do these terms mean? How do you choose the chip that meets your needs? How do you make use of these protocols?  In this article, I take the mystery out of all these acronyms, and provide a brief overview of what they mean and how you use them in your projects. We’ll examine each of the protocols, including some of the terms that are not exactly protocols, and survey some of the software libraries available to make communications easier.

Communication Protocols

SPI

The SPI (Serial Peripheral Interface) is the protocol used by the ICSP (in-circuit serial programming) facility transmitted over the ubiquitous 6-pin (2×3 pin) header used to program AVR chips. It is useful not only for programming AVR chips, but also for other types of communications between ICs. From Wikipedia:Movie Carol (2015)

SPI interface diagram

The

Read the rest
Posted in Tech | Also tagged | Section: | Comments closed

The Ultimate Makers Guide to Android Apps – Buy $1000 of equipment for $30

Samsung Acclaim

How would you like to buy dozens of gadgets and other useful equipment totaling over $1,000 for only $30?What’s the catch? There is no catch. It is simply the tremendous inherent value in today’s smart phones. Because of their built-in sensors, clever developers have created a large collection of apps, that replace a whole slew of equipment. Best of all, the controls and displays of all this equipment is far superior, often includes data logging and is completely self-contained in a small gadget that fits into your pocket.

My Story

I have wanted a tablet computer for over twenty years. Now that they have finally arrived I have been viewing them with a keen interest, but high-end tablets are too expensive for me. The looked really attractive, but I recently discovered an app that I couldn’t live without that requires bluetooth (more on this app later), which the Kindle Fire lacks. Mulling it over, I had an idea – what if I put the tablet on hold for a while, and instead see if I could buy a cheap, used Android phone.

I have heard about all the amazing things people could do with iPhones and Android phones, but … Read the rest

Posted in Education, Living, Tech | Also tagged , , , | Section: | Comments closed

Cheap Alternative for Hard to Find CDS Light Sensor

CdS (Cadmium Sulfide) photo-resistors are commonly used for detecting light levels. Their resistance varies considerably depending on the intensity of light striking them. They are common, fairly cheap and easy to use. So what’s the problem? They are becoming hard to find. The reason is because of the RoHS directive. Since CdS cells contain cadmium, a toxic heavy metal, this important component is no longer stocked by major electronics distributors. The good news is that not only is there an excellent alternative, but it is more versatile and vastly cheaper.

If you guessed photo-diode you are close, but even better is the humble LED. If you are building an analog circuit, then you will be limited to photo-diodes and photo-transistors due to their greater sensitivity. If, however, you are building a micro-controller based circuit such as a PIC or Arduino, then you can use a simple LED to achieve the same end and even more.

Photo-diodes and LEDs

Both of these devices are essentially the same. Both are diodes enclosed in a translucent case. They will both permit a small amount of reverse current to flow through them when they are reversed biased. The difference is that the photo-diode … Read the rest

Posted in Tech | Also tagged , , | Section: | Comments closed

Advanced Arduino – Including Multiple Libraries In Your Project

Arduino IDE

The Arduino IDE is a great environment for getting started programming microprocessors. It radically lowers the cost of entry, and greatly simplifies the learning curve. The importance of these properties should not be underestimated. Most of us are capable of advanced microprocessor programming given time, desire and opportunity even without the Arduino environment. The biggest obstacle, however, is getting started. When that first hurdle is at last overcome, we can then soar to greater heights. That is where the Arduino is an incredible blessing. It is so simple that it removes most of the barriers to entry. From scratch, we can get started in microprocessors and build our confidence and knowledge at an easy pace. Once that is done, then we can advance to more complex projects and techniques.

That easy means of entry, however, can also become a limitation. Because the Arduino IDE makes the cost of getting started very low, that same simplicity can also prevent us from advancing to more complex projects. A good example is when you want to create new libraries that make use of existing libraries. When you try to do so in the usual fashion of including libraries, you are confronted with compiler … Read the rest

Posted in Tech | Tagged | Section: | Comments closed

Arduino’s AnalogWrite – Converting PWM to a Voltage

D-A_converter

When I first started working with the Arduino platform (it was also my first experience with microcontrollers), I was a little surprised that analogWrite didn’t actually output a voltage, but a PWM (pulse-width modulated) signal. After all, the ATmega had a A-D (analog to digital) converter along with Arduino’s analogRead. The complementary analogWrite function was there, but no D-A (digital to analog) converter on the AVR chip itself. Fortunately, there is an easy way to convert a PWM signal to an analog voltage. To do so you only need to implement a simple single-pole low pass filter. Does it sound complicated? It isn’t. There are some great online tools to help. Once you learn how to make one, you can quickly and easily output analog voltages from not only the Arduino, but PICs as well as any other microcontroller that has PWM output.

PWM Primer

Pulse width modulation (or PWM as it is most commonly known), is a way of encoding a voltage onto a fixed frequency carrier wave. Commonly used for radio controlled devices, it is similar to FM (frequency modulation) or AM (amplitude modulation) in what it accomplishes. Each type of modulation scheme has its own advantages … Read the rest

Posted in Tech | Also tagged , , | Section: | Comments closed