User Tools

Site Tools


theory:simplified_arduino_microcontroller_boards

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

theory:simplified_arduino_microcontroller_boards [2020/03/15 16:12] (current)
Line 1: Line 1:
 +====== Simplified Arduino Microcontroller Boards ======
 +
 +//Several projects on this page make use of a microcontroller, or can be combined with a microcontroller. There are many options to make a microcontroller board in case an existing platform is not preferred. The easiest way to minimise a microcontroller board is to take the processor that is used on the Arduino, and mount it on an experimentation PCB. In that case, the development tools are still the low-threshold Arduino tools.//
 +
 +===== Hardware: The ATmega328P on an experimentation print =====
 +
 +The processor used on the basic Arduino((Arduino development page, https://www.arduino.cc/)) boards is the ATmega328P((Datasheet of the ATmega328P Atmel picoPower 8-bit AVR RISC-based microcontroller, http://www.atmel.com/devices/atmega328p.aspx)) by Atmel. To function, it only needs
 +  * 5V power supply voltage and
 +  * a clock.
 +There are several options to implement the clock, like an on-chip option, but to remain Arduino-compatible, we prefer the external clock by means of  a 16MHz crystal and two capacitors. In addition, for Arduino compatibility, we must have
 +  * the Arduino bootloader
 +  * setting the right fuses.
 +
 +The minimally required hardware is shown in <imgref Experimentation_print> and available below as an Eagle((CadSoft USA, Eagle Printed Circuit Board design software, http://www.cadsoftusa.com/)) schematic file. This set-up can be found in other tutorials as well((Michele Menniti, March 14, 2012, Arduino ISP (In System Programming) and stand-alone circuits, http://www.open-electronics.org/arduino-isp-in-system-programming-and-stand-alone-circuits/)). Alternatively, this can be done on a breadboard((Building an Arduino on a Breadboard, https://www.arduino.cc/en/Main/Standalone)).
 +
 +<imgcaption Experimentation_print|Experimentation print design>
 +{{picture1.png?450}}{{picture2.jpg?200}}
 +</imgcaption>
 +
 +The photograph in <imgref Experimentation_print> shows an example of an ATmega328P solution on an experimentation board which uses a 3V battery (clip on the lower right) and a small buzzer. You can clearly see the 16MHz crystal.
 +
 +===== Software: Programming the ATmega328P =====
 +
 +//The bootloader//
 +
 +To set the fuses and to burn the bootloader conform the Arduino platform it is advised to use te Arduino environment. This can be done with a dedicated programmer or with a second Arduino board:
 +  * The Arduino page((Arduino development page, https://www.arduino.cc/)) describes exactly what to do to program the bootloader from an Arduino board to a blank ATmega328P on an empty slave board((Using an Arduino as an AVR ISP (In-System Programmer), https://www.arduino.cc/en/Tutorial/ArduinoISP))
 +  * The AVR-ISP-MKII is an in-system programmer from Atmel((AVRISP MKII, http://www.atmel.com/tools/AVRISPMKII.aspx)). It is supported by the Arduino environment to program an empty ATmega328P in any board with an ICSP socket ((Burning sketches to the Arduino board with an external programmer, https://www.arduino.cc/en/Hacking/Programmer))((Arduino Tut. #5 - Bootloader Burning with AVR ISP MKII, https://www.youtube.com/watch?v=EsLOMdu50YU)).
 +
 +//Uploading programs ("sketches")//
 +
 +When all Arduino compatibility measures are taken into account (external clock, Arduino bootloader), we can place any ATmega328P processor on the board which is uploaded with an Arduino sketch. So, we can upload a sketch to a microcontroller on a regular Arduino board, and next move the processor physically form the Arduino board to our own simplified board. In this way, we avoid the need of implementing a full USB communication interface or ICSP socket.
 +
 +In general, sensor applications may need one of two embedded software front-ends:
 +  * detecting transitions and intervals: this is a matter of timing signal edges
 +  * sampling with $500Hz$ up to $1kHz$: this needs equi-distant sampling at a relatively high rate.
 +
 +
 +===== Power reduction =====
 +
 +The Arduino 2009 board consumes typically $25mA$ at $5V$ and $16MHz$, of which $50\%$ in FTDI chip and $50\%$ in the ATmega328P processor. Consider a $9V$ block battery which has a capacity of $500mAh$. With $25mA$ current, this means a plain Arduino board at work survives for $20hrs$ with this battery.
 +
 +However, there are two power-saving options based on hardware that can be implemented easily to extend the battery life. First of all, reducing the supply voltage reduces the consumed power. Next, reducing the clock frequency reduces the power. In <ref ATMEGA_Power>, which comes from the Atmel ATmega328P datasheet((Datasheet of the ATmega328P Atmel picoPower 8-bit AVR RISC-based microcontroller, http://www.atmel.com/devices/atmega328p.aspx)), we can see the operational point effect of reducing the supply voltage and clock frequency. When going from $5V$ to $3V$, and from $16MHz$ to $10MHz$, the ATmega current reduces from $10mA$ to $4mA$. This gives the opportunity to use a $3V$ battery of type CR2032H (capacity $240mAh$), and increases the life time to over three days. A consequence is that when programming the Arduino, all clock rates reduce with $10/16$ which includes the communication baud rate as well.
 +
 +
 +<imgcaption ATMEGA_Power|Power consumption of the ATmega328p microcontroller at several operation voltages and clock frequencies>
 +{{poweratmega328.png?450}}
 +</imgcaption>
 +
 +
 +
 +
 +===== Downloads =====
 +
 +^ File ^ Program ^ Version ^ Description ^
 +| [[http://www.fontyssensorwiki.nl/data_extra/PrankTron.sch| Simple Arduino board.sch]] | Eagle 6.2 |  1.0 - 2012 | Schematic for Arduino board |
 +| {{dg233_2012.pdf}} | Acrobat |  April/May 2012 | Geert Langereis, TU/e, Arduino course using mainly plain C |
  
theory/simplified_arduino_microcontroller_boards.txt ยท Last modified: 2020/03/15 16:12 (external edit)