Thursday 25 August 2011

Calunium: Construction

Prepare the strip board
Marking the stripboard
Click on the image for an annotated version.
Mark the locations of the cuts to be made. I found this easiest by printing just the strip board layer from Fritzing onto transparency (use the correct type for your printer). I highlighted the cuts and turned the transparency upside down to give me the view of the copper side of the strip board. I then overlaid the transparency onto the strip board and marked the board. There are 70 cuts to make with a spot-face cutter and 4 with a scalpel. Make sure you cut through all of the track, but avoid damaging the copper of the adjacent tracks. Use a multimeter to check that all of the cuts have been made properly; it is much easier to test and debug an empty board than a populated one. I thought I was careful but found two cuts which had not been made completely.

Add the link wires
Insert the link wires

Begin populating the board with the link wires. Most of the link wires can be safely made with uninsulated wire if you are careful and keep the wire taught and straight. Wires which run closer than 0.1" spacing should be insulated - see the photographs on Flickr. Don't fit any wires to the underside of the board at this time. I colour-coded the wires in the Fritzing layout:

ColourMeaning
Red+Vcc (digital and analogue)
GreenGround (0V)
YellowReset
BlueMiscellaneous, can be uninsulated
WhiteConnect on underside (or under IC socket if possible)
BrownInsulate due to length

Add the remaining components
Add the remaining components, except for 1N4001 diode, starting with the lowest ones first. Some of the decoupling capacitors are fitted inside the IC socket; keep the leads short so that they do not stop the microprocessor from being inserted. Align the IC socket so that the notch indicates pin 1 end. Ensure that the metal can of the crystal does not touch any of the surrounding wires. Add the ISP header and solder the wires to the underside of the board.

Finally add the headers. Remember that the D8-D13 header is an offset header. I found it easiest to use an ethernet shield to hold the headers at the correct spacing.

Test the board
Before inserting the microprocessor test all of the connections. Then add the FTDI cable/breakout board and power the board from USB. The red LED should light indicating that power is applied. Then check that +5V power is applied to the correct locations of the IC (pins 10 and 30). Check that the GND connections are good (pins 11 and 31). Now add the reverse protection diode; if the polarity of the power supply is reversed the diode will conduct and trip out the polyfuse.

Insert the microprocessor, taking care to get the correct orientation. There's several possible options, see this feature comparison to select the most appropriate one. If you are intending to upload sketches via USB you will need to add a bootloader to the microprocessor. (To be covered in a later post).

Use the blink sketch to test the board. If everything is ok it should just work (it did for me).

Resources
Further photos are available on Flickr. The Fritzing files are on GitHub.

Bill of materials
QuantityItemOrder code
1ATmega164P, ATmega324P, ATmega644P or ATmega1284P
1MCP1702 LDO 3V regulator
12N7000 FET
1red LED (3 or 5mm)
1green LED (3 or 5mm)
11N4001 diode
1RXEF025 500mA polyfuseOnecall 1175860
Sparkfun COM-08357
116MHz crystal, 18pF load capacitance, HC49 case
222pF ceramic capacitor
6100nF ceramic capacitor
1100µF electrolytic capacitor, 16V
21kΩ resistor, 0.25W
110kΩ resistor, 0.25W
1SPST switchOnecall 1813689
Sparkfun COM-00097
140 pin 0.6" IC socketOnecall 4285669
Sparkfun PRT-07944
14 pin stackable headerProtopic PP4PSHF
16 pin stackable headerSparkfun PRT-09280
38 pin stackable headerSparkfun PRT-09279
18 pin offset stackable headerSparkfun PRT-09374
23 pin 0.1" header (male)
12×3 pin 0.1" header (male)
1Break-away headers, straightSparkfun PRT-00116
1Break-away headers, longSparkfun PRT-10158
1Break-away headers, right-angleSparkfun PRT-00553
42 pin jumperSparkfun PRT-09044
1stripboard, 38 strips, 30 holes long
wire, 22AWG
Most of the components I bought from Onecall (CPC/Farnell); some I already had. The Sparkfun components I bought from Proto-pic.

Comparison of Calunium with Arduino

Feature comparison
Comparison of the standard Arduino microcontrollers with those which can be used with Calunium.

 DeviceFlash
(KB)
SRAM
(KB)
EEPROM
(KB)
PWM
(8 bit)
UARTComments
ATmega328P322161As used by Uno
ATmega256025684144As used by Mega2560
ATmega164P1610.562Compatible with Calunium
ATmega324P322162Compatible with Calunium
ATmega644644261Compatible with Calunium
ATmega644P644262Compatible with Calunium
ATmega1284P12816482Compatible with Calunium

The ATmega2560 actually has 15 but only 14 are made available on the Arduino Mega2560 headers.

Comparison of PWM output pins

Digital pinArduino UnoArduino Mega2560Calunium
D0Y
D1Y
D2Y
D3YY
D4Y
D5YY
D6YY
D7YY
D8YY
D9YYY
D10YYY
D11YY
D12YY
D13YY
D14Y
D15Y
............
D22Y
D23Y
When using ATmega1284P microprocessor.

Tuesday 16 August 2011

Introducing the Calunium - An Arduino clone based on the ATmega644P/ATmega1284P

Calunium 644P
Calunium built on stripboard. This version uses the ATmega644P, but the ATmega1284P can also be used. Click on the image for an annotated version.

Aims of the project
  • Create an Arduino clone with more than 32K program memory.
  • Produce a design which uses only through-hole components.
  • Shield-compatible - with pin functionality as close as possible to the original Arduino. 

Sanguino and other related designs
How does this differ from the Sanguino and other related designs (Bobuino, Mosquino etc)? The Sanguino can't accept Arduino shields. Although it is possible to program it with the Arduino IDE the pin mapping is functionally very different to the Arduino; for example the first UART is connected to D8-D9, not D0-D1, and the SPI pins are connected to D5-D7, not D11-D13. The Bobuino looks to be a very nice design but I ruled it out as it uses surface mount components, and the ISP header is not in the standard location (as required for the Ethernet shield). The headers on the Mosquino aren't shield compatible.

Sign-Advancetech appear to make a board which appears very close to what I want - I'd probably get one if I could easily buy it in the UK.


Fritzing design files and software

Calunium stripboard design
Click on image for annotated version.

The Fritzing design files can be found on GitHub, http://github.com/stevemarple/Calunium. Modifications to the Arduino IDE to support Calunium are under development but will be added soon.


Creative Commons Licence
Calunium by Steve Marple is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

About the name
As Arduino is an Italian project, this project takes its name from the Roman name for Lancaster, Calunium, where the design of this clone originates.

Building the Calunium
Future blog posts will show the construction of the Calunium. I also have a design for a shield-compatible strip board Arduino but I haven't had time to put it together yet.

Pin mapping
ArduinoAtmega328PAtmega644PATmega2560
D0PD0 (PCINT16/RXD)PD0 (PCINT24/RXD0/T3)PE0 (RXD0/PCINT8)
D1PD1 (PCINT17/TXD)PD1 (PCINT25/TXD0)PE1 (TXD0)
D2PD2 (PCINT18/INT0)PD2 (PCINT26/RXD1/INT0)PE4 (OC3B/INT4)
D3PD3 (PCINT19/OC2B/INT1)PD3 (PCINT27/TXD1/INT1)PE5 (OC3C/INT5)
D4PD4 (PCINT20/XCK/T0)PB0 (PCINT8/XCK0/T0)PG5 (OC0B)
D5PD5 (PCINT21/OC0B/T1)PB1 (PCINT9/CLK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C5/TMS)
A6PC6 (ADC6/PCINT14)PA6 (ADC6/PCINT6)PF6 (ADC6/TDO)
A7PC7 (ADC7/PCINT15)PA7 (ADC7/PCINT7)PF7 (ADC7/TDI)

Monday 8 August 2011

Test magnetometer results

Test magnetometer
Magnetometer electronics in their temporary housing.

On Friday I deployed my magnetometer to the same site used by SAMNET for the Lancaster magnetometer. I knew that several coronal mass ejections (CMEs) were due to impact the Earth's magnetosphere. The predictions were correct, on Saturday AuroraWatch UK issued an amber alert. Below is a comparison of the data from my test magnetometer and the SAMNET magnetometer.

Test magnetometer (top-panel) and the D component from SAMNET's Lancaster magnetometer (bottom panel).
Sensor temperature for the same period.
The results are encouraging even though at present the test magnetometer isn't calibrated, and the orientation is only approximately aligned with the magnetic east component ("D"). The baseline differences can be ignored as SAMNET does not make full-field measurements, just variations from a fixed baseline. I haven't measured it yet but the test sensor has a large temperature coefficient; if the FGM-1 behaves in the same way as the FGM-3 then I expect it to be around 25nT/°C. The graph shows the temperature over the same period varied from 16.5°C to 30°C.

Clearly some kind of temperature stabilisation is going to be needed. One option is to bury the sensor. Another is active temperature control, but care will be needed to ensure that DC currents for the heater do not affect the magnetic field being measured!