Tag Archive | "pro"

September 2011 Competition

Competition over!

Posted in competition

Product Announcement: The Zigduino

Hello readers

Recently the people at Logos Electromechanical have announced their new product – the Zigduino.

The Zigduino is an Arduino-compatible microcontroller platform that integrates an 802.15.4 radio on the board. The radio can be configured to support any 802.15.4-based protocol, including ZigBeeRoute Under MAC/6LoWPAN, and RF4CE. It uses a reverse polarity SMA connector (RP-SMA) for an external antenna. This allows the user to use nearly any existing 2.4 GHz antenna with it. The Zigduino runs on 3.3V, but all I/O pins are 5V compatible.

Pictured below is a production Zigduino kit with all components:

Thankfully all that SMD word is done for you. The only soldering required is the aerial socket, Arduino headers and the DC socket. All the components shown in the image above are included with purchase. The Zigduino specifications include (from the website):

Microcontroller Atmega128RFA1
Operating Voltage 3.3V
Input Voltage (recommended) 7-18V
Input Voltage (maximum) 6-30V (transients to -20V and +60V)
Digital I/O Pins 14 + 3 auxiliary
PWM Output Pins 6
Analog Input Pins 6 (0-1.8V)
I/O Protection ±30V transient
-2.5V to +5.8V continuous
DC Current per I/O Pin 20 mA
DC Current for 5V Pin 250 mA
DC Current for 3.3V Pin 200 mA
Flash Memory 128 KB of which 2 KB is used by the bootloader
SRAM 16 KB
EEPROM 4 KB
Clock Speed 16 MHz
RF transmit power +3.5 dBm
Receiver sensitivity -100 dB
Antenna gain 2 dBi
Current Draw 30 mA (transmitting, USB, no I/O connections)
15 mA (transmitting, no USB, no I/O connections)
6 mA (radio off, no USB, no I/O connections)
250 μA (sleep)

Compatibility

  • Compatible with any shield that supports 3.3V logic
  • Compatible with existing Arduino libraries that do not use hard-coded pin definitions
  • Compatible with Arduino IDE with updated compiler, avr-gcc-4.3.3 or later.

Software

Power

The Zigduino can be powered through the USB connection or with an external power supply. The power source with the highest voltage is selected automatically.

External power can be supplied via a wall wart or a battery. It can be connected with a 2.1mm center-positive plug inserted into the power jack. Alternately, external power can be connected through the GND and VIN pins of the POWER header.

The board will operate correctly on an input voltage between 6V and 30V. It will survive transients as large as -20V or +60V. However, higher supply voltages may cause excessive heat dissipation at higher current draws. The input voltage regulator has integral overtemperature protection, so you can’t permanently damage the board this way. However, the board may not work correctly under these circumstances.

The power pins are as follows:

  • VIN — The input voltage to the Arduino board when it is running from external power, i.e. not USB bus power.
  • 5V — The regulated 5V used to power 5V components on the board and external 5V shields. It comes either from the USB or from the VIN via the 5V regulator. Maximum current draw is 250 mA.
  • 3V3 — The regulated 3.3V supply that powers the microcontroller. It is derived from the 5V bus via a second regulator. Maximum current draw is 200 mA.
  • GND — Ground pins.

Memory

The ATmega128RFA1 has 128 KB of flash memory, of which 2 KB is occupied by the bootloader. It also has 16 KB of SRAM (the most of any Arduino-compatible board) and 4 KB of EEPROM, which can be accessed through the EEPROM library.

Input and Output

Each of the 14 digital pins of the Zigduino can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead(). Each pin operates at 3.3V and can source or sink 10 mA. Each also has an internal pullup, which is disabled by default. Each pin is protected against ±30V spikes and can tolerate continuous 5V input.

The six analog input pins, labeled A0 – A5, are likewise protected against ±30V spikes and can tolerate continuous 5V input. Each provides 10 bits of resolution and measures 0 – 1.8V. It is possible to change to a lower top voltage through use of the AREF pin and the analogReference() function.

A key design goal of the Zigduino is maintaining compatibility with existing shields to the greatest extent possible. The ATmega128RFA1’s peripherals are arranged slightly differently than the corresponding peripherals on the ATmega328 used in the stock Arduino. Therefore, in order to provide the desired shield compatibility, there are three solder jumpers provided on the back of the board. They function as follows:

  • Digital pin 11 can be set as either SPI MOSI or a PWM output. Neither option is selected as shipped. SPI MOSI is also available on the SPI connector at all times along with SCK and MISO.
  • Analog pin 4 can be set as either A4 or I2C SDA. Neither option is selected as shipped. Both I2C pins are available on the I2C connector.
  • Analog pin 5 can be set as either A4 or I2C SCL. Neither option is selected as shipped. Both I2C pins are available on the I2C connector.

The following additional special functions are available:

  • Serial: 0 (RX) and 1 (TX) — Used to transmit and receive TTL serial data. These pins are connected to the corresponding pins on the FTDI USB interface chip.
  • PWM: 3, 5, 6, 9, 10, and 11 — Provides 8-bit PWM output with the analogWrite() function. Pin 11 must be selected for PWM operation with the solder jumper on the back of the board.
  • SPI: 11 (MOSI), 12 (MISO), 13 (SCK) — These pins support SPI communications using the SPI library. Pin 11 must be selected for SPI operation with the solder jumper on the back, or SPI must be accessed with the SPI connector.
  • LED: 13 — This is the built-in LED on digital pin 13. When the pin is high, the LED is on.
  • External Interrupts: 2, 3, 6, and 7 — These pins can be configured to trigger and interrupt on a low value, high value, or an edge. See the attachInterrupt() function for details. The two I2C pins can also be used as interrupts.
  • I2C: A4 (SDA) and A5 (SCL) — These pins support I2C communications using the Wire library. They must be selected for I2C operation with the jumpers on the back or I2C must be accessed through the I2C connector. They can also be configured as interrupts.

This is one very capable Arduino-compatible board and sure to find many uses. For updates and new ideas consider following the Logos Electromechanical blog page.  Furthermore associated Zigduino files can be found on Github.

So if you are looking to expand into the world of personal-area networks, Zigbee wireless and so on –  you could do very well by considering a Zigduino or two. For more information, questions, support, and to purchase visit the product website, Seeed Studio or lipoly.de

Posted in 802.15.4, arduino, Atmega128RFA1, review, wireless, xbee, zigduino

Tutorial: Arduino and the AREF pin

Learn about the Arduino’s AREF pin and how to use it in this detailed tutorial.

[Updated 09/01/2013]

Today we are going to spend some time with the AREF pin – what it is, how it works and why you may want to use it. First of all, here it is on our boards:

[Please read the entire article before working with your hardware]

In chapter one of this series we used the analogRead() function to measure a voltage that fell between zero and five volts DC. In doing so, we used one of the six analog input pins. Each of these are connected to ADC (analog to digital conversion) pins in the Arduino’s microcontroller. And the analogRead() function returned a value that fell between 0 and 1023, relative to the input voltage.

But why is the result a value between 0~1023? This is due to the resolution of the ADC. The resolution (for this article) is the degree to which something can be represented numerically. The higher the resolution, the greater accuracy with which something can be represented. We call the 5V our reference voltage.

We measure resolution in the terms of the number of bits of resolution. For example, a 1-bit resolution would only allow two (two to the power of one) values – zero and one. A 2-bit resolution would allow four (two to the power of two) values – zero, one, two and three. If we tried to measure  a five volt range with a two-bit resolution, and the measured voltage was four volts, our ADC would return a value of 3 – as four volts falls between 3.75 and 5V. It is easier to imagine this with the following image:

twobit1

So with our example ADC with 2-bit resolution, it can only represent the voltage with four possible resulting values. If the input voltage falls between 0 and 1.25, the ADC returns 0; if the voltage falls between 1.25 and 2.5, the ADC returns a value of 1. And so on.

With our Arduino’s ADC range of 0~1023 – we have 1024 possible values – or 2 to the power of 10. So our Arduinos have an ADC with a 10-bit resolution. Not too shabby at all. If you divide 5 (volts) by 1024, the quotient is 0.00488 – so each step of the ADC represents 4.88 millivolts.

However – not all Arduino boards are created equally. Your default reference voltage of 5V is for Arduino Duemilanoves, Unos, Megas, Freetronics Elevens and others that have an MCU that is designed to run from 5V. If your Arduino board is designed for 3.3V, such as an Arduino Pro Mini-3.3 – your default reference voltage is 3.3V. So as always, check your board’s data sheet.

Note – if you’re powering your 5V board from USB, the default reference voltage will be a little less – check with a multimeter by measuring the potential across the 5V pin and GND. Then use the reading as your reference voltage.

What if we want to measure voltages between 0 and 2, or 0 and 4.6? How would the ADC know what is 100% of our voltage range?

And therein lies the reason for the AREF pin! AREF means Analogue REFerence. It allows us to feed the Arduino a reference voltage from an external power supply. For example, if we want to measure voltages with a maximum range of 3.3V, we would feed a nice smooth 3.3V into the AREF pin – perhaps from a voltage regulator IC. Then the each step of the ADC would represent 3.22 millivolts.

Interestingly enough, our Arduino boards already have some internal reference voltages to make use of. Boards with an ATmega328 microcontroller also have a 1.1V internal reference voltage. If you have a Mega (!), you also have available reference voltages of 1.1 and 2.56V. At the time of writing the lowest workable reference voltage would be 1.1V.

So how do we tell our Arduinos to use AREF? Simple. Use the function analogReference(type); in the following ways:

For Duemilanove and compatibles with ATmega328 microcontrollers:

  • analogReference(INTERNAL); – selects the internal 1.1V reference voltage
  • analogReference(EXTERNAL); – selects the voltage on the AREF pin (that must be between zero and five volts DC)
  • And to return to the internal 5V reference voltage – use analogReference(DEFAULT);

If you have a Mega:

  • analogReference(INTERNAL1V1); – selects the internal 1.1V reference voltage
  • analogReference(INTERNAL2V56); – selects the internal 2.56V reference voltage
  • analogReference(EXTERNAL); – selects the voltage on the AREF pin (that must be between zero and five volts DC)
  • And to return to the internal 5V reference voltage – use analogReference(DEFAULT)

Note you must call analogReference() before using analogRead(); otherwise you will short the internal reference voltage to the AREF pin – possibly damaging your board. If unsure about your particular board, ask the supplier or perhaps in our Google Group.

Now that we understand the Arduino functions, let’s look at some ways to make a reference voltage. The most inexpensive method would be using resistors as a voltage divider. For example, to halve a voltage, use two identical resistors as such:

For a thorough explanation on dividing voltage with resistors, please read this article. Try and use resistors with a low tolerance, such as 1%, otherwise your reference voltage may not be accurate enough. However this method is very cheap.

A more accurate method of generating a reference voltage is with a zener diode. Zener diodes are available in various breakdown voltages, and can be used very easily. Here is an example of using a 3.6V zener diode to generate a 3.6V reference voltage:

For more information about zener (and other diodes) please read this article. Finally, you could also use a linear voltage regulator as mentioned earlier. Physically this would be the easiest and most accurate solution, however regulators are not available in such a wide range nor work with such low voltages (i.e. below 5V).

Finally, when developing your sketch with your new AREF voltage for analogRead();, don’t forget to take into account the mathematics of the operation. For example, if you have a reference voltage of 5V, divide it by 1024 to arrive at a value of 4.88 millivolts per analogRead() unit. Or as in the following example, if you have a reference voltage of 1.8V, dividing it by 1024 gives you 1.75 millivolts per analogRead() unit:

So if necessary, you can now reduce your voltage range for analog inputs and measure them effectively.

LEDborder

Have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column, or join our Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

Posted in arduino, aref, education, lesson, microcontrollers, tutorialComments (44)


Subscribe via email

Receive notifications of new posts by email.

The Arduino Book

Arduino Workshop

Für unsere deutschen Freunde

Dla naszych polskich przyjaciół ...

Australian Electronics!

Buy and support Silicon Chip - Australia's only Electronics Magazine.

Use of our content…

%d bloggers like this: