Sunday 24 November 2013

miniLOG Series Part 2 - The Circuit

In this part of the miniLOG series I'm going to introduce you to the first version of the schematic. Let's jump right into it!

Download the REV2 miniLOG schematic (.pdf)


Keep in mind that it's not the finished schematic. However it probably won't be much different. I'm going to talk you through separate parts of the miniLOG circuit.

AVR microcontroller



The miniLOG is based on ATmega328P-AU microcontroller in the TQFP32 package. It's Arduino compatible so you can easily modify the code. It's accompanied by a 16MHz crystal oscillator to reproduce the Arduino UNO circuit. You probably could get by without the crystal but since the entire Arduino bootloader operates based on that 16MHz crystal it's a good idea to keep it. Also the miniLOG uses SPI interface to communicate with the ADC and the SD card so a little bit more clock accuracy is a good thing to have.

You can probably notice the 5 pin header. Its purpose is to connect to an external UART module like for instance a USB-UART or bluetooth-UART module. With a bit of extra code you can communicate with the miniLOG using USB or bluetooth. These modules are really cheap (~5 USD on eBay).

Analog to digital converter


After a lot of research I decided to use the MCP3201 ADC. It's a precise, low-power 12 bit ADC. The miniLOG has a total of four ADC channels - one precise 12 bit, two 10 bit channels of the internal ATmega328 ADC and one 10 bit current measuring channel. The current measuring channel is basically the same as the others, it just uses a 1% 1ohm 500mW current shunt resistor. The miniLOG measures voltage across the 1ohm resistor. The safe maximum current is 500mA, although technically you could put up to 700mA through it. All voltage channels have voltage dividers dividing the input voltage by 10. Since the reference voltage in the circuit is 2.5V the maximum voltage across these channels is 25V. The 12 bit channel requires something more precise, that's why I used 0.1% resistors on that one.

Analog circuitry



The miniLOG is powered by an AA battery. It's connected with the main power switch to an MCP1624 DC-DC boost converter, which outputs 3.6V required by the rest of the circuit. The V-SER net is the voltage from the serial connector. If for example you want to power the miniLOG from a USB-UART module, two SS22 Schottky diodes and a P-channel MOSFET take care of it so the AA battery can't burst into flames. I have to admit, at first I was going to use a CR2032 battery but I decided to sacrifice the 5cm x 5cm form factor in order to quadruple the battery life.

The voltage reference is an MCP1525, a 2.5V reference with 27 ppm/°C typical voltage drift. I decided to go for a convenient SOT-23 package for this one.

User interface


The UI on the miniLOG comes down to choosing the interval time of measurements, displaying this time and switching between different modes. The user controls the miniLOG with two humble  microswitches. The interval time and chosen mode is displayed using 16 0603 LEDs controlled by the 74HC595 8 bit shift register. It may seem silly to use 16 LEDs, but I have actually given it a lot of thought, took into account DIP switches, 7 segment displays, but this was by far the best solution.


So, this is the basic miniLOG circuit. In the next part of the series I'm going to talk about the mechanical side of the design.

No comments:

Post a Comment