Posts with «review» label

My review of bGeigie Nano from Safecast

I finally finished assembling, after more than a year, my bGeigie Nano. At over $400, this was by far the most expensive Arduino project I have built to date.


The feature-rich open-source Geiger counter is offered as a kit by Medcom for the price of $450 (of which, $75 is donated to Safecast organization). I stubbornly insisted on sourcing the parts on my own, to save a few bucks and to get a closer look at the process. Let me tell you: this may be the only kit out there where the components bought individually are as expensive as the kit itself! Obviously, this kit was not designed to make a profit.




Here is a price breakdown (for non-believers):
- PCB (OSHPark) - $17 (3 for $52)
- Pelican 1010 box (store) - $13
- Arduino Fio - $25
- GPS module - $40
- OpenLog - $25
- OLED display - $25
- laser-cut plates - $25
- sensor LND7317 - $150
- iRover HV supply - $35
- LiPo battery - $10
- SD card - $10
- other electronic components - $5
- hardware (standoffs, screws etc) - $5
- shipping (on some of the items) - $30
-----------------------------
Total = $415



Since it took me so long to build it, I forgot a lot of details (I know, I should have logged impressions along the way; that's why it's called "web log").
But here are a few things I can still remember:
  • the kit is pretty easy to build (once one has all components); geared towards the novice maker, the only challenge is to follow the assembly instructions, sometimes not very clear because it lacks details (for example, the spacers's sizes; although this does not matter for those who buy the kit); but it seems that the instructions are periodically updated and improved;
  • the support and discussion forum is great; I got quick and helpful answers to all my questions;
  • the display is 128x64 OLED, even though the resolution used is 128x32 (notice in the photo above that every other line is blank)
  • the sketch can barely fit in the 30KB program space of Fio's ATmega328 (I actually may have commented out some functionality to make it fit);
  • at the time I started, the Geiger sensor was not offered for sale (now it is); I bought it directly from Medcom, together with the high-voltage power module; they did not include the protection grid that comes with the kit;
  • a big surprise was that the assembly fits perfectly in the Pelican box, without using the rubber lining (which I had cut and prepared according to the instructions anyway). When I say "perfectly" I mean nothing rattles inside when the box is shaken. Truly remarkable. For those interested, I used M3x10mm standoffs between the 1.5mm plates, with the bottom one separated with a set of 1mm washers (see photo below, taken before I installed the battery and the sensor).
  • the toggle switch at the top would be a better candidate as power switch than the slide switch currently used; maybe a future version will swap those two switches;
  • bluetooth could be used to connect to smart phone rather than the current cable solution; but that would require a larger sketch running on a bigger processor (ATmega1284 would be a good candidate);
  • although the modules used come with headers, once installed, they cannot be removed (because they are soldered, for mechanical/space reasons; the only exception is the OLED display); removable modules would make the device easier to debug and fix (if necessary);
  • overall, it was a good experience; I used some modules for the first time; I learned a few things; it opened perspectives to new ideas; thank you guys!

Wise time with Arduino 31 May 03:48
geiger  review  

Project Review – Silicon Chip Capacitance Substitution Box

Introduction

Every month Australian electronics magazine Silicon Chip publishes a variety of projects, and in some cases various (well … one of two) electronics retailers will pick up the project and offer it as a kit. However for an increasing number of new projects they don’t, which leaves the interested reader with one option – build the entire project from scratch.

But thankfully this is no longer the case – as the team from Silicon Chip now offer a range of project PCBs and matching front panels for sale directly from their website. Although buying these parts is not the cheapest option, it gives the busy person who likes making things a quick start – or the inexperienced more opportunities to complete a successful project.

So as a test of this new service, I bought the PCB and front panel for the Capacitance Substitution Box project described by Nicholas Vinen in the Juily 2012 issue of SC:

This is something I’ve meant to make for a while – but didn’t really have the inclination to make one from scratch, so it was neat to see a version published in the magazine. I believe the subjects in the magazine article are oftern prototypes, which explains the difference in colour for the front panel.

The parts arrived in a week after placing the order, and are of a high quality:

When complete, the capacitance substitution box PCB and panel will fit nicely into an Altronics H0151 enclosure, so you don’t need to do any drilling or filing. The next task was to organise the required parts. The rotary switches, terminal posts and the usual odds and ends can be found at Altronics, Jaycar or other suppliers. However the main components – the capacitors – offered two options.

The first option is to simply use capacitors from personal stock or the stores. However the tolerance of these parts can vary wildly, with up to twenty percent either way. This is ok for simple uses, however when values are combined – the tolerance of larger values can negate the lower values completely. So instead I’ve chosen the second option – which involves using brand-name low-tolerance capacitors.

Thus I turned to element14 who stock not only a huge range of not only regular but also the low-tolerance capacitors, and can also have them on my desk usually by the next working day. Finally, it’s nice to have all the parts arrive in little bags… neatly organised ready to go:

It’s easy to search for low-tolerance parts with element14, as the automatic filtering has tolerance as a parameter:

Furthermore you can also ensure you have the voltage rating of at least 50V DC as well. So after half an hour the capacitor order was completed and arrived when expected – using parts from Panasonic, Vishay, and Wima. The tolerances of our capacitors used varied between one and ten percent, which will help improve the accuracy of the substitution box.

Assembly

The PCB has the capacitor values labelled neatly on the silk-screen, so soldering in all the capacitors was a relatively simple but long operation. Having them arrive in separate packets made life a lot easier. During the soldering process it’s a good idea to have a  break or two, which helps you avoid fatigue and making any mistakes.

There may be a few capacitors that are a little too wide to fit with the others, so they can be mounted on the other side of the PCB:

However they all end up fitting well:

The next step was to configure the first rotary switch for six position use, then cut the plastic stopped from the side of each rotary switch. In the following image you have a before and after example:

Now the rotary switches can have their shafts trimmed and then be soldered onto the PCB:

However ensure you have the first rotary switch in the right way – that is the selections are selected across the top half, not the bottom. Remove the nuts from the rotary switches, and double-check all the capacitors are fitted, as once the next step is completed … going back will be difficult to say the least.

At this point the banana sockets can be fitted to the panel, and then soldered into place, and then you’re finished. Just place the panel/PCB combination inside the box and screw it down:

Using the Capacitance Substitution Box

Does it work? Yes – however you don’t get exact values, there will always be a tolerance due to the original tolerance of the capacitors used and the stray capacitance of the wires between the box and the circuit (or capacitance meter). Nevertheless our example was quite successful. You can see the box in action with our Altronics LC meter kit in this video.

Again, using the best tolerance capacitors you can afford will increase the accuracy of this project.

Conclusion

Over time this would be a useful piece of equipment to have – so if your experiments or projects require varying capacitor value, this project will serve the purpose nicely. Plus it helps with mental arithmetic and measures of capacitance! Please do not ask me for copies of the entire Silicon Chip article, refusal may offend. Instead – visit their website for a reprint or digital access.

And if you enjoyed this article, or want to introduce someone else to the interesting world of Arduino – check out my book (now in a third printing!) “Arduino Workshop”.

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 forum – 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.

The post Project Review – Silicon Chip Capacitance Substitution Box appeared first on tronixstuff.

Review – Intel Galileo Arduino-compatible Development Board

Introduction

Over the last year or two the rise of the single-board computer has captured the imagination and energy of many people, to the point where popular opinion has been that the Arduino world had been left behind. However this is far from the truth – there’s Arduino-compatible SBCs such as the pcDuino and now we have one from Intel  – the Intel Galileo.

Apparently the Galileo has been available in limited distribution for a few months, and now that the marketing machine has started up – we finally had the chance to order an Intel Galileo last week and now have one as the subject for this review. It’s our first look, based on information we could find at the time and some experimenting.

What’s in the box?

In the retail package we found the Intel Galileo itself:

… a diagram of what to do in the lid:

… and a universal AC to 5V 2A DC power supply with various fittings for different regions:

The only paper documentation was a safety and regulatory information booklet which gets recycled. We didn’t find a USB cable nor some stand-offs to lift the board off the bench a little.

Specifications

The Galileo is based a new chipset from Intel, the Quark SoC X1000 Application Processor, a 32-bit Intel Pentium-class system on a chip. For the uninitiated, the Galileo is a single-board computer running a small version of Linux that can somewhat emulate an Arduino Uno R3 in software. The hardware specifications are as such (from the Arduino website):

  • 400MHz 32-bit Intel® Pentium instruction set architecture (ISA)-compatible processor o 16 KBytes on-die L1 cache
    • 512 KBytes of on-die embedded SRAM
    • Simple to program: Single thread, single core, constant speed
    • ACPI compatible CPU sleep states supported
    • An integrated Real Time Clock (RTC), with an optional 3V “coin cell” battery for operation between turn on cycles.
  • 10/100 Ethernet connector
  • Full PCI Express* mini-card slot, with PCIe 2.0 compliant features
    • Works with half mini-PCIe cards with optional converter plate
    • Provides USB 2.0 Host Port at mini-PCIe connector
  • USB 2.0 Host connector
    • Support up to 128 USB end point devices
  • USB Device connector, used for programming
    • Beyond just a programming port – a fully compliant USB 2.0 Device controller
  • 10-pin Standard JTAG header for debugging
  • Reboot button to reboot the processor
  • Reset button to reset the sketch and any attached shields
  • Storage options:
    • Default – 8 MByte Legacy SPI Flash main purpose is to store the firmware (or bootloader) and the latest sketch. Between 256KByte and 512KByte is dedicated for sketch storage. The download will happen automatically from the development PC, so no action is required unless there is an upgrade that is being added to the firmware.
    • Default 512 KByte embedded SRAM, enabled by the firmware by default. No action required to use this feature.
    • Default 256 MByte DRAM, enabled by the firmware by default.
    • Optional micro SD card offers up to 32GByte of storage
    • USB storage works with any USB 2.0 compatible drive
    • 11 KByte EEPROM can be programmed via the EEPROM library.

However unlike other SBCs on the market – you don’t get any video or audio output.

Let’s have a quick look around the board. Here you can see the DC socket and microSD card socket:

 From the view below you can see the Arduino shield stacking headers and flash memory:

… more jumpers for settings, a USB host socket, USB connection (client) socket, RS232 via 3.5mm socket (!) and 10/100 Ethernet:

… and some nifty jumpers to select 3.3 or 5V operation for shields and IOREF:

… this jumper pair is to add a 3V battery to keep the real-time clock ticking over when the main supply is removed:

Perhaps a CR2032 button cell holder would be preferable, there’s plenty of room on the PCB. Finally – the two reset buttons:

If you want to reset your emulated Arduino, press the one on the left (labelled I). If you want to reboot the entire computer, press the one on the right (labelled X). This seems a little counter-intuitive, as you would imagine the button closer to the stacking headers would reset the Arduino. Note that if you reboot the computer, the last sketch you’ve uploaded will be removed and need to be uploaded again. Furthermore, more often than not rebooting the Galileo wasn’t entirely successful – and required a full removal of USB, power then replacing the power and USB to get another connection.

Turning the Galileo over reveals some fascinating PCB track patterns, and the mini-PCIe connector:

Getting Started

Having a slight bent towards Arduino, the first thing we like to do is get the blink sketch running. The documentation is scattered all over the place, so start from maker.intel.com and follow the links listed in the “Explore Intel makers” column. The closest thing to a quick setup guide can be downloaded hereThere’s a video by what sounds to be a ten year old explaining the board – who signs off by telling us it’s ok to break something (hopefully not the Galileo at $77 a pop). Marketing FTW. Eventually we found the official Intel support page for the Galileo, so bookmark that for future reference.

However if you just want to get started as quickly as possible, keep reading. First, download the Arduino IDE for Galileo from here. Next, extract the IDE folder to your root directory – and don’t have any spaces in the folder name. For example, use:

c:\GalileoIDE

and not:

C:\Arduino IDEs\galileo IDE\

Now plug in your Galileo – and always plug the 5V power into the Galileo before the USB (use the “USB client” socket). For Windows the USB driver (for “Gadget Serial v2.4”) is in the IDE folder, just point Windows to the top Galileo Arduino IDE folder.

Note that it takes around twenty seconds for the PC to recognise the Galileo via USB (as the Galileo needs time to boot up – it’s running Linux). For Windows users – after loading the IDE, check which COM port has been allocated. For some reason the Galileo can’t deal with COM10 or higher. To change this, head over to the Device Manager. Open Ports (COM & LPT) then right-click the Galileo and click properties:

Next, click the Port Settings tab, then Advanced:

Then select a free COM port number that’s under 10, close all the dialogue boxes and restart the computer. After the reboot, load the IDE, select the right board and serial port in the Tools menu – then select Firmware Update in the Help Menu. If for some reason you put a memory card in the microSD card slot – remove it before this process.

A confirmation box will appear, so move forward and wait for the process to finish. Don’t touch the IDE, board or anything near the Galileo until this finishes. Read some kit reviews. The update process took eight minutes for us, however will depend on the speed of your Internet connection.

Finally, try the ubiquitous blink sketch. Once uploaded,  the tiny LED next to the coin cell jumpers will blink as requested. Now we’ll explore more about using the Galileo as an Arduino-compatible board.

How Arduino-compatible is the Galileo?

The first thing we like to do with new boards that differ from the classic Uno is to run a speed test, and for this we use the following sketch by Steve Curd from the Arduino forum:

//
// Pi_2
//
// Steve Curd
// December 2012
//
// This program approximates pi utilizing the Newton's approximation.  It quickly
// converges on the first 5-6 digits of precision, but converges verrrry slowly
// after that.  For example, it takes over a million iterations to get to 7-8
// significant digits.
//
// I wrote this to evaluate the performance difference between the 8-bit Arduino Mega,
// and the 32-bit Arduino Due.
// 

#define ITERATIONS 100000L    // number of iterations
#define FLASH 1000            // blink LED every 1000 iterations

void setup() {
  pinMode(13, OUTPUT);        // set the LED up to blink every 1000 iterations
  Serial.begin(57600);
}

void loop() {

  unsigned long start, time;
  unsigned long niter=ITERATIONS;
  int LEDcounter = 0;
  boolean alternate = false;
  unsigned long i, count=0;
  float x = 1.0;
  float temp, pi=1.0;

  Serial.print("Beginning ");
  Serial.print(niter);
  Serial.println(" iterations...");
  Serial.println();

  start = millis();  
  for ( i = 2; i < niter; i++) {
    x *= -1.0;
    pi += x / (2.0f*(float)i-1.0f);
    if (LEDcounter++ > FLASH) {
      LEDcounter = 0;
      if (alternate) {
        digitalWrite(13, HIGH);
        alternate = false;
      } else {
        digitalWrite(13, LOW);
        alternate = true;
      }
      temp = 40000000.0 * pi;
    }
  }
  time = millis() - start;

  pi = pi * 4.0;

  Serial.print("# of trials = ");
  Serial.println(niter);
  Serial.print("Estimate of pi = ");
  Serial.println(pi, 10);

  Serial.print("Time: "); Serial.print(time); Serial.println(" ms");

  delay(10000);
}

It calculates Newton Approximation for pi using an infinite series. For comparison an Arduino Due takes 690 ms, an Arduino Mega 2560 takes 5765 ms, and a pcDuino v2 can do it in 9 to 43 ms (depending on what else is running on Linux). So out of the box, the Galileo takes 279 ms:

Out of the box there is 262144 bytes available for sketches. As the Arduino is emulated, the hardware for I/O is a little different than you may have expected, and provided by a variety of I2C port expanders, MUXs and so on. For example I2C can only run at 100 kHz in master mode, no slave mode, and similar restrictions on SPI as well. Again, review this page to learn more about the internal hardware differences between an Arduino Uno and Intel Galileo.

Visit this page and scroll down to the block diagram for a visual representation, and while you’re there – review the entire page to learn more about the specific Arduino Uno R3 implementation on the Galileo. A lot of work has been done to allow successful emulation of the Arduino using the Quark CPU and internal OS. For example the EEPROM library just works, and has 11264 bytes of storage.

You can get an idea of what is supported “out of the box” by reviewing the libraries included with the Galileo’s IDE installation, for example:

So most of the basic requirements are covered at the time of writing. And unlike some other SBCs emulating Arduino, the onboard Ethernet “just works” as it should with the Ethernet library – and the USBHost library can take advantage of the matching socket on the board. Again – research is the key, so spend some time determining if the Galileo can solve your problems.

One interesting example of the limitations of the “emulated” Arduino is the speed, and this has been highlighted by Al Williams of Dr Dobb’s journal – who ran a simple sketch to see how fast a digital output pin could be set. As GPIO is provided by external SPI- and I2C-based interface ICs, there will be a speed hit. But how much? Naturally we can’t use port manipulation so we’re back to simple digitalWrite functions with the following sketch:

int pin = 2;
boolean a = false;
void setup() 
{                
  pinMode(pin, OUTPUT);     
}

void loop() 
{
  digitalWrite(pin, a=!a);
}

An Arduino Uno running the sketch was clocked at 96.34 kHz:

… and the Intel Galileo was clocked at … 225.2 Hz:

This test isn’t a criticism of the Galileo, just an example of what you need to keep in mind when using it. If you’re curious about the real-time clock it’s accessed via Linux. Finally, there’s a list of known issues on the Intel forum – so check this out to get a grip on what is and is not working in terms of Arduino compatibility. One more thing – you will need a memory card installed if you want the Galileo to remember sketches after power-off.

Update – thanks to our friends (!) at reddit, you can push some I/O faster – see this post in the Intel forum.

Linux – internal

The Galileo arrived pre-loaded with a very light version of Linux, however due to the lack of video output you need to access the “computer” via some old-school methods. And thus one method is via Telnet over Ethernet. If you don’t have a Telnet client, try PuTTY. To get started, ensure you have your Galileo connected to power, client USB to PCm and to your LAN. Then upload the following sketch to your Galileo:

// https://communities.intel.com/message/213624
void setup()
{
  system("telnetd -l /bin/sh");
}

void loop()
{
  system("ifconfig eth0 > /dev/ttyGS0");
  sleep(10);
}

The observant will notice by using the system function you can send instructions to the Linux command line from your Arduino sketch. And any resulting output text can be sent to the serial monitor by directing it to ttyGS0.

Anyhow, the above sketch will run the ifconfig command and return relevant networking data about your Galileo – including its IP address:

Once you have the IP address, you can Telnet in and command your Galileo just like it’s 1992:

Don’t get too excited, there isn’t that much installed (e.g. no gcc or make). For more information on the Poky linux, visit the project page. Apart from running vi my *nix memory is a bit vague, however the onboard system is quite minimal. If you want to do anything serious, such as use a WiFi or other PCIe card – you’ll need to boot your Galileo with an external OS stored on a microSD card. Another way of looking at the Galileo is that it’s a board not for development with, but for running code built on a different system and then loaded onto the Galileo.

Linux – external

As I haven’t been a *nix user for a very long time, it didn’t seem worthwhile to spend a whole day preparing for an installing the external OS on the Galileo for review. However from what I can tell you’ll need to do this to run anything substantial including WiFi adaptors, python, node.js and so on. Which in my personal opinion sort of ruins the Galileo for me. Other SBCs can do all of this a lot easier, cheaper and with better documentation.

Arduino Support

As the Galileo is from Intel and not Arduino, you need to ask for support in the Intel forum. This will be an interesting test for Intel, will they invest in a substantial support effort or just stand back and say it’s all open source? Time will tell. In the meanwhile there is a gallery hosted by Intel with links to different projects.

Conclusion

Once again – remember that the Galileo is a limited single-board computer that emulates (to a certain, varying degree) an Arduino Uno R3. It is a contender if you need to integrate some Arduino-based control with software running on a light Linux machine, and all in a compact board. Or if you want to experiment with USB host and Ethernet on the Arduino platform at the same time, this could be a cheaper and more powerful option. Support is there if you can use Google, however this is not the idea beginners’ Arduino board. So don’t be a sheep and rush out and buy one after reading the marketing blurb – do your own research first.

Personally I would say that if you have a need for the specific hardware interfaces of the Galileo, and have a full understanding of the board limitations – then it’s the board for you. Otherwise if you want to experiment with a full single-board computer with Arduino compatibility, get a pcDuino. Full-sized images are available on flickr.

And if you enjoyed this article, or want to introduce someone else to the interesting world of Arduino – check out my book (now in a third printing!) “Arduino Workshop”.

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 forum – 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.

[Note – Intel Galileo purchased for review by tronixstuff.com and not a promotional consideration]

The post Review – Intel Galileo Arduino-compatible Development Board appeared first on tronixstuff.

Tronixstuff 12 Feb 03:59

Review – Iteaduino Lite “nearly 100% Arduino-compatible” board

Introduction

Over the last year there have been a few crowd-funded projects that offered very inexpensive Arduino-compatible boards. Frankly most of them weren’t anything out of the ordinary, however one of them is quite interesting due to the particular design of the board, and is the subject of this review.

An established company Iteadstudio ran a successful Indiegogo campaign last December to fund their Iteaduino Lite – Most inexpensive full-sized Arduino derivative board”. Having a spare US$5 we placed an order and patiently waited for the board. Being such a low price it was guaranteed to raise the funding – but was it worth the money? Or the effort? Possibly.

The board

In typical fashion the board arrived in bare packaging:

 The Iteaduino Lite isn’t that surprising at first glance:

To the new observer, it looks like an Arduino board of some sort. Nice to see all those GPIO pins with double breakouts. No surprises underneath:

The URL on the bottom is incorrect, instead visit http://imall.iteadstudio.com/iteaduino-lite.html. Looking at the board in more detail, there are some interesting points of difference with the usual Arduino Uno and compatibles.

The USB interface is handled with the Silabs CP2102 USB to UART bridge IC:

The next difference is the power circuitry – instead of using a linear voltage regulator, Itead have used a contemporary DC-DC converter circuit which can accept between 7 and 24V DC:

Furthermore, the entire board can operate at either 5V or 3.3V, which is selected with the slide switch in the above image. Finally – the microcontroller. Instead of an Atmel product, Itead have chosen the LogicGreen LGT8F88 microcontroller, a domestic Chinese product:

And there are only two LEDs on the Iteaduino Lite, for power and D13. The LED on D13 ins’t controlled via a MOSFET like other Arduino-compatibles, instead it’s simply connected to GND via a 1kΩ resistor.

Getting started with the Iteaduino Lite

The stacking header sockets will need to be soldered in – the easiest way is to insert them into the board, use an shield to hold them in and flip the lot upside down:

Which should give you neatly-installed headers:

Watch out for the corners of the board, they’re quite sharp. Next, you need to install the USB driver for the CP2102. My Windows 7 machine picked it up without any issues, however the drivers can be downloaded if necessary.

Finally a new board profile is required for the Arduino IDE. At the time of writing you’ll need Arduino IDE v1.0.5 r2. Download this zip file, and extract the contents into your ..\Arduino-1.0.5-r2\hardware folder. The option should now be available in the Tools > Board menu in the IDE, for example:

From this point you can run the blink example to check all is well. At this point you will realise one of the limitations of the Iteaduino Lite – memory. For example:

You only have 7168 bytes of memory for your sketches – compared to 32, 256 for an Arduino Uno or compatible. The reason for this is the small capacity of  …

The LogicGreen LGT8F88 microcontroller

This MCU is a Chinese company’s answer to the Atmel ATmega88A. You can find more details here, and Itead also sells them separately. The LGT8F88 offers us 8Kbyte of flash memory of which 0.7KB is used by bootloader, 1 KB of SRAM and 504 bytes (count ’em) of EEPROM. Apparently it can run at speeds of up to 32 MHz, however the LGT8F88 is set to 16 MHz for the Iteaduino Lite.

According to Logic Green, their LGT8F88 “introduce a smart instruction cache, which can fetch more instructions one time, effectively decrease memory accessing operations“. So to see if there’s a speed bump, we uploaded the following sketch – written by Steve Curd from the Arduino forum. It calculates Newton Approximation for pi using an infinite series:

//
// Pi_2
//
// Steve Curd
// December 2012
//
// This program approximates pi utilizing the Newton's approximation.  It quickly
// converges on the first 5-6 digits of precision, but converges verrrry slowly
// after that.  For example, it takes over a million iterations to get to 7-8
// significant digits.
//
// I wrote this to evaluate the performance difference between the 8-bit Arduino Mega,
// and the 32-bit Arduino Due.
// 

#define ITERATIONS 100000L    // number of iterations
#define FLASH 1000            // blink LED every 1000 iterations

void setup() {
  pinMode(13, OUTPUT);        // set the LED up to blink every 1000 iterations
  Serial.begin(57600);
}

void loop() {

  unsigned long start, time;
  unsigned long niter=ITERATIONS;
  int LEDcounter = 0;
  boolean alternate = false;
  unsigned long i, count=0;
  float x = 1.0;
  float temp, pi=1.0;

  Serial.print("Beginning ");
  Serial.print(niter);
  Serial.println(" iterations ...");
  Serial.println();

  start = millis();  
  for ( i = 2; i < niter; i++) {
    x *= -1.0;
    pi += x / (2.0f*(float)i-1.0f);
    if (LEDcounter++ > FLASH) {
      LEDcounter = 0;
      if (alternate) {
        digitalWrite(13, HIGH);
        alternate = false;
      } 
      else {
        digitalWrite(13, LOW);
        alternate = true;
      }
      temp = 40000000.0 * pi;
    }
  }
  time = millis() - start;

  pi = pi * 4.0;

  Serial.print("# of trials = ");
  Serial.println(niter);
  Serial.print("Estimate of pi = ");
  Serial.println(pi, 10);

  Serial.print("Time: "); 
  Serial.print(time); 
  Serial.println(" ms");

  delay(10000);
}

For a baseline comparison, an Arduno Uno R3 completes the calculations in 5563 ms:

… and the Iteaduino Lite completed it in 5052 ms:

So that’s around a 10% speed increase. Not bad at all. The LGT8F88 also has the requisite GPIO, SPI, and I2C available as per normal Arduino Uno boards. You can download the data sheet with more technical details from here. Frankly the LGT8F88 is an interesting contender in the marketplace, and if Logic Green can offer a DIP version at a good price, the ATtiny fans will have a field day. Time will tell.

Power Circuit

The DC-DC circuit promises 5V output, with up to 24V DC input – so we cranked the input to 24V,  put a 1A load on the 5V output – and put the DSO over 5V to measure the variations – with a neat result:

So no surprises there at all, the Iteaduino Lite gives you more flexible power supply options than the usual Arduino board. However an eagle-eyed reader notes that a few of the capacitors are only rated at 25V – especially the two right after the DC socket/Vin. You can see this in the schematic (.pdf). So take that into account, or drop your Vin to something more regular such as below 12V.

Conclusion

The Iteaduino Lite is an interesting experiment in bargain Arduino-compatible boards. However we say “why bother?” and just get a Uno R3-compatible board.

At the end of the day – why bother with this board? For a little extra you can get boards with the ATmega328P or 32U4 which gives you 100% compatibility. Nevertheless, this was an interesting experiment. Full-sized images are available on flickr. And if you enjoyed this article, or want to introduce someone else to the interesting world of Arduino – check out my book (now in a third printing!) “Arduino Workshop”.

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 forum – 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.

The post Review – Iteaduino Lite “nearly 100% Arduino-compatible” board appeared first on tronixstuff.

Tronixstuff 30 Jan 23:01

Easily test and experiment with GSM modules using AT Command Tester

Introduction

Working with GSM modules and by extension Arduino GSM shields can either be a lot of fun or bring on a migraine. This is usually due to the quality of module, conditions placed on the end user by the network, reception, power supply and more.

Furthermore we have learned after several years that even after following our detailed and tested tutorials, people are having trouble understanding why their GSM shield isn’t behaving. With this in mind we’re very happy to have learned about a free online tool that can be used to test almost every parameter of a GSM module with ease – AT Command Tester. This software is a Java application that runs in a web browser, and communicates with a GSM module via an available serial port.

Initial Setup

It’s simple, just visit http://m2msupport.net/m2msupport/module-tester/ with any web browser that can run Java. You may need to alter the Java security settings down to medium. Windows users can find this in Control Panel> All Control Panel Items  > Java – for example:

Once the security settings have been changed, just visit the URL, click ‘accept’ and ‘run’ in the next dialogue box that will appear, for example:

And after a moment, the software will appear:

Once you’re able to run the AT Command Tester software, the next step is to physically connect the hardware. If you’re just using a bare GSM module, a USB-serial adaptor can be used for easy connection to the PC. For Arduino GSM shield users, you can use the Arduino as a bridge between the shield and PC, however if your GSM shield uses pins other than D0/D1 for serial data transmission (such as our SIM900 shield) then you’ll need to upload a small sketch to bridge the software and hardware serial ports, for example:

//Serial Relay – Arduino will patch a serial link between the computer and the GPRS Shield
//at 19200 bps 8-N-1 Computer is connected to Hardware UART
//GPRS Shield is connected to the Software UART

#include <SoftwareSerial.h>

SoftwareSerial mySerial(7,8); // change these paramters depending on your Arduino GSM Shield

void setup()
{
  Serial.begin(19200);
  //Serial.println(“Begin”);
  mySerial.begin(19200);

}

void loop()
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}

Using the software

Once you have the hardware connected and the Arduino running the required sketch, run the software – then click “Find ports” to select the requried COM: port, set the correct data speed and click “Connect”. After a moment the software will interrogate the GSM module and report its findings in the yellow log area:

 As you can see on the left of the image above, there is a plethora of options and functions you can run on the module. By selecting the manufacturer of your GSM module form the list, a more appropriate set of functions for your module is displayed.

When you click a function, the AT command sent to the module and its response is shown in the log window – and thus the magic of this software. You can simply throw any command at the module and await the response, much easier than looking up the commands and fighting with terminal software. You can also send AT commands in batches, experiment with GPRS data, FTP, and the GPS if your module has one.

To give you a quick overview of what is possible, we’ve made this video which captures us running a few commands on a SIM900-based Arduino shield. If possible, view it in 720p.

Conclusion

Kudos to the people from the M2Msupport website for bringing us this great (and free) tool. It works – so we’re happy to recommend it. And if you enjoyed this article, or want to introduce someone else to the interesting world of Arduino – check out my book (now in a third printing!) “Arduino Workshop”.

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 forum – 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.

The post Easily test and experiment with GSM modules using AT Command Tester appeared first on tronixstuff.

Easily test and experiment with GSM modules using AT Command Tester

Introduction

Working with GSM modules and by extension Arduino GSM shields can either be a lot of fun or bring on a migraine. This is usually due to the quality of module, conditions placed on the end user by the network, reception, power supply and more.

Furthermore we have learned after several years that even after following our detailed and tested tutorials, people are having trouble understanding why their GSM shield isn’t behaving. With this in mind we’re very happy to have learned about a free online tool that can be used to test almost every parameter of a GSM module with ease – AT Command Tester. This software is a Java application that runs in a web browser, and communicates with a GSM module via an available serial port.

Initial Setup

It’s simple, just visit http://m2msupport.net/m2msupport/module-tester/ with any web browser that can run Java. You may need to alter the Java security settings down to medium. Windows users can find this in Control Panel> All Control Panel Items  > Java – for example:

Once the security settings have been changed, just visit the URL, click ‘accept’ and ‘run’ in the next dialogue box that will appear, for example:

And after a moment, the software will appear:

Once you’re able to run the AT Command Tester software, the next step is to physically connect the hardware. If you’re just using a bare GSM module, a USB-serial adaptor can be used for easy connection to the PC. For Arduino GSM shield users, you can use the Arduino as a bridge between the shield and PC, however if your GSM shield uses pins other than D0/D1 for serial data transmission (such as our SIM900 shield) then you’ll need to upload a small sketch to bridge the software and hardware serial ports, for example:

//Serial Relay – Arduino will patch a serial link between the computer and the GPRS Shield
//at 19200 bps 8-N-1 Computer is connected to Hardware UART
//GPRS Shield is connected to the Software UART

#include <SoftwareSerial.h>

SoftwareSerial mySerial(7,8); // change these paramters depending on your Arduino GSM Shield

void setup()
{
  Serial.begin(19200);
  //Serial.println(“Begin”);
  mySerial.begin(19200);

}

void loop()
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}

Using the software

Once you have the hardware connected and the Arduino running the required sketch, run the software – then click “Find ports” to select the requried COM: port, set the correct data speed and click “Connect”. After a moment the software will interrogate the GSM module and report its findings in the yellow log area:

 As you can see on the left of the image above, there is a plethora of options and functions you can run on the module. By selecting the manufacturer of your GSM module form the list, a more appropriate set of functions for your module is displayed.

When you click a function, the AT command sent to the module and its response is shown in the log window – and thus the magic of this software. You can simply throw any command at the module and await the response, much easier than looking up the commands and fighting with terminal software. You can also send AT commands in batches, experiment with GPRS data, FTP, and the GPS if your module has one.

To give you a quick overview of what is possible, we’ve made this video which captures us running a few commands on a SIM900-based Arduino shield. If possible, view it in 720p.

Conclusion

Kudos to the people from the M2Msupport website for bringing us this great (and free) tool. It works – so we’re happy to recommend it. And if you enjoyed this article, or want to introduce someone else to the interesting world of Arduino – check out my book (now in a third printing!) “Arduino Workshop”.

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 forum – 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.

Tutorial – pcDuino GPIO with Arduino IDE

Introduction

In this tutorial we’ll explain how to use the GPIO pins of the Arduino implementation in the pcDuino v2 and v3. As the v3 is now available you can use it as well, and it’s interchangeable with the v2. Although the pcDuino v2 is Arduino-compatible, there are a few differences that you need to be aware of – in order to make your projects a success and also to avoid any costly mistakes.

This tutorial builds on the knowledge from the initial review, so if pcDuino v2 is new to you please review this article before moving on. In this instalment we’ll run through the following:

  • ADC (analogue to digital)
  • Digital input and outputs
  • PWM (pulse-width modulation)
  • I2C bus
  • SPI bus

Using ADC pins

Just like an Arduino Uno or compatible, the pcDuino v2 has six ADC pins, in the expected locations:

Using the pcDuino v2’s ADC pins is quite straight forward, however you just need to remember a few things about the hardware – that the maximum input voltage on A0 and A1 is 2V – and 3.3V for A2~A5.

Although there is an AREF pin on the board, this function isn’t supported at the time of writing. From the software perspective A0 and A1’s values have a 6-bit resolution and can fall between 0 and 63 (0~2V), otherwise the others have a 12-bit resolution and thus return values between 0 and 4095 (0~3.3V). Using the ADC pins is simple, and demonstrated in the following sketch:

// pcDuino v2 ADC demonstration

#include <core.h> // for pcDuino

int a0, a1, a2, a3, a4, a5;

void setup() 
{
}

void loop() 
{
  // read all the ADCs
  a0 = analogRead(0);
  a1 = analogRead(1);
  a2 = analogRead(2);
  a3 = analogRead(3);
  a4 = analogRead(4);
  a5 = analogRead(5);
  // display ADC values to console
  printf(A0, A1,   A2,   A3,   A4,   A5\n);
  printf(%d  %d  %d  %d  %d  %d\n, a0, a1, a2, a3, a4, a5);
  printf(n);
  delay(1000);
}

… which results with the following in the console:

Digital outputs

The pcDuino v2’s implementation of digital outputs aren’t anything out of the ordinary – except that you are limited to a maximum voltage of 3.3V instead of the usual 5V. Furthermore you can only source 4mA from each pin. However if you have some 5V-only shields that you must use with your pcDuino v2 – there is a Voltage Translation board that can be used to solve the problem:

However using 3.3V for new designs shouldn’t be an issue – new sensors, ICs and so on should be 3.3V-compatible. And with the pcDuino v2 you get an extra four digital I/O pins, located next to the SPI grouping as shown below:

These are simply addressed as D14~D17. Now back for a quick demonstration with the typical LEDs. As the current sourced from each GPIO pin cannot exceed 4mA, you need to use a resistor to keep things under control. Using the LED wizard, by entering a 3.3V supply, 2.1V forward voltage for our LEDs and a 4mA current – the resistor value to use is 330Ω.

If you’re having a lazy attack and use 560Ω, the current will be around 2.5mA with acceptable results. We’ve done just that with the following demonstration sketch:

// pcDuino v2 digital output demonstration

#include <core.h> // for pcDuino

void setup() 
{
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);  
  digitalWrite(4, LOW);  
  digitalWrite(5, LOW);
  digitalWrite(6, LOW);
  digitalWrite(7, LOW);  
}

void loop() 
{
  for (int i = 4; i < 8; i++)
  {
    digitalWrite(i, HIGH);
    delay(250);
    digitalWrite(i, LOW);
  }
}

… and the results in this video.

Digital inputs

When using the digital pins as inputs, just treat them as normal except they have a maximum input voltage of 3.3V for HIGH. Again – just keep thinking “3.3V”.

Using the I2C data bus

The I2C bus (or “two wire interface”) is a common serial data bus used for interfacing all manner of devices with a microcontroller. You can find a background on the I2C bus and Arduino tutorial here. Just like an Arduino Uno R3, the I2C bus pins are both A4 and A5 (for SCL and SDA) and can also be found up near D13, for example.

The limitations for the pcDuino v2’s version of I2C bus are few – the maximum speed is 200 kHz, it only uses 7-bit addresses and you can’t use the pcDuino in slave mode. However there are 2.2kΩ pullup resistors which can save using them with external circuitry.

We demonstrate the I2C bus by writing data to and reading it from a Microchip 24LC256 EEPROM (which is handy in itself as there isn’t any EEPROM function on the pcDuino v2). This is demonstrated with an Arduino Uno in part two of our I2C tutorials.

Connection is very easy – pins 1 to 4 of the EEPROM are connected to GND, pin 5 to SDA, pin 6 to SCL, pin 7 to GND and pin 8 to 3.3V. Finally a 0.1uF capacitor is placed across 3.3V and GND.

The sketch to read and write values to the EEPROM is simple, and apart from the #include <core.h> for the pcDuino all the other functions operate as normal.

// pcDuino I2C demonstration

#include <core.h> // for pcDuino
#include <Wire.h>   for I2C
#define chip1 0x50  device bus address for EEPROM

// always have your values in variables
unsigned int pointer = 69;  // we need this to be unsigned, as you may have an address  32767
byte d=0;  // example variable to handle data going in and out of EERPROMS

void setup()
{
  Wire.begin();  // wake up, I2C!
}

void writeData(int device, unsigned int add, byte data) 
// writes a byte of data 'data' to the chip at I2C address 'device', in memory location 'add'
{
  Wire.beginTransmission(device);
  Wire.write((int)(add  8)); // left-part of pointer address
  Wire.write((int)(add & 0xFF)); // and the right
  Wire.write(data);
  Wire.endTransmission();
  delay(10);
}

byte readData(int device, unsigned int add) 
// reads a byte of data from memory location 'add' in chip at I2C address 'device' 
{
  byte result;  // returned value
  Wire.beginTransmission(device);  // these three lines set the pointer position in the EEPROM
  Wire.write((int)(add  8));  // left-part of pointer address
  Wire.write((int)(add & 0xFF)); // and the right
  Wire.endTransmission();
  Wire.requestFrom(device,1); // now get the byte of data...
  result = Wire.read();
  return result;  // and return it as a result of the function readData
}

void loop()
{
  printf(Writing data...\n);
  for (int a=0; a10; a++)
  {
    writeData(chip1,a,a);
  }
  printf(Reading data...\n);
  for (int a=0; a10; a++)
  {
    d=readData(chip1,a);    
    printf(Pointer %d holds %d.\n,a,d);
  }
}

… which results with the following output in the console:

As you now know, using I2C isn’t hard at all. A lot of beginners shy away from it – or run screaming for the nearest library for their part. You don’t need libraries – spend a little time now learning about I2C and you’re set for life.

Using the SPI data bus

Again we have some SPI tutorials for Arduino, so check them out first if the concept is new to you. Writing to an SPI device with the pcDuino v2 isn’t tricky at all, you have the 3.3V hardware limitation and the SPI pins are in the same location (D10~D13) or in a separate group on the board:

Furthermore the maximum SPI speed is 12 MHz and the pcDuino v2’s  implementation of SPI can only work as a master. However in the sketch there are a few differences to note. To demonstrate this we’ll control a Microchip MCP4162 digital rheostat via SPI to control the brightness of an LED. Here is the circuit:

And now for the sketch. Take note of the fourth line in void setup() –  this is used to set the SPI bus speed to 12 MHz. You can also reduce the speed with other multipliers such as 32, 64 and 128 to slow it down even further. The other point to note is the use of SPI.transfer(). With the pcDuino v2 there are two parameters – the first is the data to send to the SPI device, and the second is either

SPI_CONTINUE

if there is another byte of data following immediately, or

SPI_LAST

if that is the last byte for that immediate transfer. You can see this use of the paramters within the function setValue() in the demonstration sketch below.

// pcDuino SPI demonstration

#include <core.h>  // for pcDuino
#include <SPI.h>
int ss = 10;
int del = 1000;

void setup()
{
  SPI.begin();
  SPI.setDataMode(SPI_MODE3);
  SPI.setBitOrder(MSBFIRST);
  SPI.setClockDivider(SPI_CLOCK_DIV16);
  pinMode(ss, OUTPUT);
  digitalWrite(ss, HIGH);
}

void setValue(int value)
{
  digitalWrite(ss, LOW);
  SPI.transfer(0, SPI_CONTINUE);
  SPI.transfer(value, SPI_LAST);
  digitalWrite(ss, HIGH);
}

void loop()
{
  setValue(255);
  delay(del);
  setValue(223);
  delay(del);
  setValue(191);
  delay(del);
  setValue(159);
  delay(del);
  setValue(127);
  delay(del);
  setValue(95);
  delay(del);
  setValue(63);
  delay(del);
  setValue(31);
  delay(del);
  setValue(0);
  delay(del);
}

When using the SPI bus, relevant data will appear in the console, for example:

And finally the demonstration video to show you it really works – you can see the output voltage from the rheostat and the matching LED brightness.

Receiving data from the SPI bus is equally as simple, however at the time of writing we don’t have an SPI device to demonstrate this, so please refer the SPI part of the pcDuino guide. Finally, you can’t use PWM on D10 or D11 when using the SPI bus in your sketch.

Pulse-width modulation

You can simulate analogue output using PWM with a pcDuino v2 – however there are two types of PWM pins available. The first is found on digital pins D3, D9, D10 and D11 – they are simulated PWM – and have a low range of zero to twenty at 5 Hz. There are two hardware PWM pins – D5 and D6, which  run at 520Hz and have the full range of 0~255 available in analogWrite(). Once again – they output 3.3V. Furthermore, you can’t use pinMode() functions or the SPI bus if using D10 and/or D11 for PWM.

Conclusion

Now you should have an understanding of the features and limitations of using GPIO pins with your pcDuino v2 Arduino sketches. And finally a plug for my own store – tronixlabs.com – offering a growing range and Australia’s best value for supported hobbyist electronics from adafruit, DFRobot, Freetronics, Seeed Studio and much more.

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 forum – dedicated to the projects and related items on this website.

The post Tutorial – pcDuino GPIO with Arduino IDE appeared first on tronixstuff.

Tronixstuff 29 Jan 04:12
adc  arduino  gpio  i2c  input  output  pcduino  pwm  review  spi  tronixlabs  tronixstuff  tutorial  

Kit Review – Altronics/Silicon Chip ISD2590 Digital Message Recorder

Introduction

Every month Australian electronics magazine Silicon Chip publishes a variety of projects, and in February 1994 they published the “90 Second Digital Message Recorder” project. That was a long time ago, however you can still find the kit today at Altronics (and at the time of writing, on sale for AU$26), and thus the subject of our review.

The kit offers a simple method of recording and playing back 90 seconds of audio, captured with an electret microphone. When mounted in a suitable enclosure it will make a neat way of leaving messages or instructions for others at home.

Assembly

The kit arrives in typical Altronics fashion:

… and includes everything required including IC sockets for the ISD2590 and the audio amplifier:

The PCB missed out on silk-screening – which is a pity:

however it is from an original design from twenty years ago. The solder mask is neat and helps prevent against lazy soldering mistakes:

Finally the detailed instructions including component layout and the handy Altronics reference guide are also included. After checking and ordering the resistors, they were installed first along with the links:

 If you have your own kit, there is a small error in the instructions. The resistor between the 2k2 and the 10uF electrolytic at the top of the board is 10k0 not 2k2. Moving on, these followed by the capacitors and other low-profile components:

The rest of the components went in without any fuss, and frankly it’s a very easy kit to assemble:

 The required power supply is 6V, and a power switch and 4 x AA cell holder is included however were omitted for the review.

How it works

Instead of some fancy microcontrollers, the kit uses an ISD2590P single chip voice recording and playback IC:

It’s a neat part that takes care of most of the required functions including microphone preamp, automatic gain control, and an EEPROM to store the analogue voltage levels that make up the voice sample. The ISD2590 samples audio at 5.3 kHz which isn’t CD quality, but enough for its intended purpose.

Apart from some passive components for power filtering, controls and a speaker amplifier there isn’t much else to say. Download the ISD2590 data sheet (pdf), which is incredibly detailed including some example circuits.

Operation

Once you apply power it’s a simple matter of setting the toggle switch on the PCB down for record, or up for playback. You can record in more than one session, and each session is recorded in order until the memory is full. Then the sounds can be played back without any fuss.

The kit is supplied with the generic 0.25W speaker which is perhaps a little weak for the amplifier circuit in the kit, however by turning down the volume a little the sound is adequate. In this video you can see (and hear) a quick recording and playback session.

Conclusion

This kit could be the base for convenient message system – and much more interesting than just scribbling notes for each other. Or you could built it into a toy and have it play various tunes or speech to amuse children. And for the price it’s great value to experiment with an ISD2590 – just use an IC socket. Or just have some fun  – we did.  Full-sized images are available on flickr

And if you enjoyed this article, or want to introduce someone else to the interesting world of Arduino – check out my book (now in a third printing!) “Arduino Workshop”.

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 forum – 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.
Tronixstuff 23 Jan 03:34

Kit Review – Altronics/Silicon Chip ISD2590 Digital Message Recorder

Introduction

Every month Australian electronics magazine Silicon Chip publishes a variety of projects, and in February 1994 they published the “90 Second Digital Message Recorder” project. That was a long time ago, however you can still find the kit today at Altronics (and at the time of writing, on sale for AU$26), and thus the subject of our review.

The kit offers a simple method of recording and playing back 90 seconds of audio, captured with an electret microphone. When mounted in a suitable enclosure it will make a neat way of leaving messages or instructions for others at home.

Assembly

The kit arrives in typical Altronics fashion:

… and includes everything required including IC sockets for the ISD2590 and the audio amplifier:

The PCB missed out on silk-screening – which is a pity:

however it is from an original design from twenty years ago. The solder mask is neat and helps prevent against lazy soldering mistakes:

Finally the detailed instructions including component layout and the handy Altronics reference guide are also included. After checking and ordering the resistors, they were installed first along with the links:

 If you have your own kit, there is a small error in the instructions. The resistor between the 2k2 and the 10uF electrolytic at the top of the board is 10k0 not 2k2. Moving on, these followed by the capacitors and other low-profile components:

The rest of the components went in without any fuss, and frankly it’s a very easy kit to assemble:

 The required power supply is 6V, and a power switch and 4 x AA cell holder is included however were omitted for the review.

How it works

Instead of some fancy microcontrollers, the kit uses an ISD2590P single chip voice recording and playback IC:

It’s a neat part that takes care of most of the required functions including microphone preamp, automatic gain control, and an EEPROM to store the analogue voltage levels that make up the voice sample. The ISD2590 samples audio at 5.3 kHz which isn’t CD quality, but enough for its intended purpose.

Apart from some passive components for power filtering, controls and a speaker amplifier there isn’t much else to say. Download the ISD2590 data sheet (pdf), which is incredibly detailed including some example circuits.

Operation

Once you apply power it’s a simple matter of setting the toggle switch on the PCB down for record, or up for playback. You can record in more than one session, and each session is recorded in order until the memory is full. Then the sounds can be played back without any fuss.

The kit is supplied with the generic 0.25W speaker which is perhaps a little weak for the amplifier circuit in the kit, however by turning down the volume a little the sound is adequate. In this video you can see (and hear) a quick recording and playback session.

Conclusion

This kit could be the base for convenient message system – and much more interesting than just scribbling notes for each other. Or you could built it into a toy and have it play various tunes or speech to amuse children. And for the price it’s great value to experiment with an ISD2590 – just use an IC socket. Or just have some fun  – we did.  Full-sized images are available on flickr

And if you enjoyed this article, or want to introduce someone else to the interesting world of Arduino – check out my book (now in a third printing!) “Arduino Workshop”.

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 forum – 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.

The post Kit Review – Altronics/Silicon Chip ISD2590 Digital Message Recorder appeared first on tronixstuff.

Tronixstuff 23 Jan 03:34

Review – pcDuino v2

Introduction

Updated 29/01/2014 All pcDuino v2 tutorials

Update! The pcDuino version 3 is now available

In the last twelve months or so several somewhat inexpensive single-board computers have burst onto the market, and of those was the pcDuino. This has now evolved into the pcDuino v2,  the topic of our review. The pcDuino v2 is billed as the “mini PC + Arduino”, a combination with much promise. Out of the box it runs a version of Ubuntu 12.04 on Linaro 12.07, or can also run Android Ice Cream Sandwich if so desired.

The pcDuino v2 is a single-board computer like many others, however with some interesting additions – the most interesting being the Arduino-shield hardware connections and pcDuino v2 Arduino development environment. We’ll first run through the pcDuino v2 as a Linux computer, and then delve into the Arduino-compatibility. But first, our test board… which arrived safely in a neat box:

… which contains the pcDuino v2 itself:

At first glance you can see the various points of interest, such as the Allwinner A10, which is a 1GHz ARM Cortex A8 CPU:

… the Realtek WiFi add-on board (which is fitted to the pcDuino v2):

… and also a USB socket (for keyboard, mouse, USB hub and so on), a microUSB for USB OTG use, a full-sized HDMI socket for full HD video, RJ45 Ethernet socket,  a microSD socket for expansion, and the Hynix flash memory ICs. From the pcDuino v2 website, the specifications are:

Hardware:

  • CPU – 1GHz ARM Cortex A8
  • GPU – OpenGL ES2.0, OpenVG 1.1 Mali 400 core
  • DRAM – 1GB
  • Onboard Storage – 2GB Flash, microSD card (TF) slot for up to 32GB
  • Video Output – HDMI
  • OS – Linux3.0 + Ubuntu 12.04/Android ICS 4.0
  • Extension Interface Arduino Headers
  • Network interface – 10/100Mbps RJ45 and on-board WiFi module
  • USB Host port 1
  • Requires – Power 5V, 2000mA
  • Overall Size 125mm X 52mm

Software

  • OS – Ubuntu 12.04 (pre-loaded) or Android ICS 4.0
  • APIs – all the Arduino shield pins are accessible with the provided API. 

    It consists of API to access the following interfaces: UART, ADC, PWM, GPIO, I2C, SPI

  • Programming language support – C, C++ with GNU tool chain, Java with standard Android SDK, Python. 

However at the time of writing all models with the date stamp of 17/09/2013 (and newer) have 4G of onboard flash storage – a great little bonus. With the addition of an inexpensive microSD card you can add up to an additional 32 G of storage.

Getting Started

This is the crunch-point for many products – how does one get started? With the pcDuino – very easily. Apart from the computer itself, you’ll need a monitor with HDMI inputs and speakers, a USB keyboard and mouse (with a USB hub – or one of those keyboard/trackpad combinations) and a power supply. The pcDuino v2 requires up to 2A at 5V – a higher-rated plugpack than usual. Don’t be tempted to use a normal USB socket – the pcDuino v2 will not work properly on the available current.

So after plugging all that in with the power the last to connect – the pcDuino v2 fires up in around five seconds, quickly running through the Ubuntu startup process and ended with the configuration screen in around five seconds:

After setting the time zone, language, screen resolution (full HD) and so on it was another ten seconds to the desktop:

At this point we found by accident that the A10 CPU runs hot – in some warmer permanent installations it could use a heatsink. But I digress. We now have a “normal” computer experience – the WiFi found the home network without any issue and the Chromium web browser runs well considering the speed and the RAM (1G) of the pcDuino v2:

The next step is to format the extra onboard storage, which can be done with the usual tool:

We just formatted it to ext4 and moved on. The included software is nothing unexpected, there’s the Chromium web browser, office-style applications, terminal, XBMC, remote-desktop viewer and of course you can hit up the Ubuntu package manager and install what you need.

It’s easy to get carried away and forget you’re not using a typical multi-GHz computer so bear that in mind when software runs a little slower than expected. However working with WordPress and Google Docs inside Chromium was acceptable, and a fair amount of this review was written using the pcDuino v2.

Excluding the Arduino development environment which we look at in the next section, pre-installed programming tools include Python (v2.7), C/C++ with GNU tool chain and Java with the standard Android SDK. At this point we haven’t tried the pcDuino with the Android operating system, however plan to do so in the near future and this will be the subject of a separate article.

At this point we’d say that the pcDuino v2 is a winner in the SBC (single-board computer) stakes, as you don’t need to worry about external WiFi, or deliberating about which version of an OS to use and then having to download it to an SD card and so on… the pcDuino v2 just works as a computer out of the box.

The pcDuino v2 as an Arduino

At this point we’d like to note that the pcDuino v2 is not an Arduino circuit wired up to a computer (such as the Arduino team did with the Yun). Instead, the pcDuino v2 is a computer that can emulate an Arduino – and has the GPIO pins and shield sockets onboard.

So when you run a sketch on the pcDuino v2’s version of the Arduino IDE – the sketch is compiled and then executed using the CPU, not an ATmega microcontroller. Speaking of which, the IDE is a modified version of 1.5.3 which appears identical to the usual IDE:

In fact when you compile and upload that blink.ino sketch everything runs as normal, and a small LED situated near D2/3 will blink as normal. However you do need to use more #include statements, for example #include <core.h> for all sketches. When uploading a sketch, a new window appears that will be blank, as shown below – this window needs to stay open otherwise the sketch won’t run

One of the benefits of using the pcDuino v2 is the extra space available for sketches – a quick compile shows that you can have a fair bit more than your typical ATmega328 – in our example we had 104,857,600 bytes available:

We don’t have a sketch that large, but at least you have some headroom to create them if necessary.

Arduino Hardware support

The shield header sockets are in the standard R3 configuration – and all GPIO is 3.3V and not 5V tolerant. However there is a conversion shield available if necessary. There are also some extra GPIO pins available – another eight, as shown in the following image:

At the time of writing there is support for GPIO use, SPI (up to 12 MHz, master-only), I2C (up to 200 kHz, at 7-bit and master-only), a UART (serial on D0/D1), PWM and ADC on A0~5.

However ADC is a little different, due to the internal reference voltages of the Allwinner CPU. Take note of the following as if you exceed the maximum voltages you could damage your board. Pins A0 and A1 are 6-bit ADCs, which return values from 0 ~ 63, which range from 0V to 2V. Pins A2~A5 are 12-bit ADCs, which return values  from 0 ~ 4095, which range across the full 0V to 3.3V.

There isn’t access to the usual serial monitor in the Arduino IDE as such, instead you need to use an external, hardware-based solution such as connecting a USB-serial adaptor to pins D0/D1 and using another PC as the terminal. And when you press ‘reset’ on your Arduino shields – it resets the entire computer, just not the Arduino emulation – (learned that the hard way!).

However you can output text and data to the console window that appears after uploading a sketch – and doing so is pretty easy, just use prinf as you would in C or C++. For example, the following sketch:

#include <core.h>

// example code from http://www.cplusplus.com/reference/cstdio/printf/

void setup() {
  // put your setup code here, to run once:

}

void loop() 
{
   printf ("Characters: %c %c \n", 'a', 65);
   printf ("Decimals: %d %ld\n", 1977, 650000L);
   printf ("Preceding with blanks: %10d \n", 1977);
   printf ("Preceding with zeros: %010d \n", 1977);
   printf ("Some different radices: %d %x %o %#x %#o \n", 100, 100, 100, 100, 100);
   printf ("floats: %4.2f %+.0e %E \n", 3.1416, 3.1416, 3.1416);
   printf ("Width trick: %*d \n", 5, 10);
   printf ("%s \n", "A string");
  delay(1000);
}

produces the following output in the console window:

It would be recommended to read this guide about using the pcDuino v2 as an Arduino which highlights pretty well everything to get you started, including the notes on interrupts and PWM – and this page which explains the headers on the pcDuino v2. Finally, as the “Arduino” is emulated you cannot use the on-board networking capabilities of the pcDuino v2 such as Ethernet, instead you use a shield as you would with a normal Arduino.

At first glance it may seem that the pcDuino v2 is difficult, which it is not. One needs instead to consider their needs and then work with the available features. Just like many other new development boards and systems, the pcDuino v2 (and pcDuino platform) is still quite new – but growing – so more features and compatibility will appear over time.

How much faster is the pcDuino v2 against a normal Arduino board?

There should be a great difference between the Arduino’s microcontroller and the A10 CPU, even taking into account running the OS and emulation. To test this, we’ll use a sketch written by Steve Curd from the Arduino forum. It calculates Newton Approximation for pi using an infinite series. The pcDuino v2 version of the sketch is below:

//
// Pi_2
//
// Steve Curd
// December 2012
//
// This program approximates pi utilizing the Newton's approximation.  It quickly
// converges on the first 5-6 digits of precision, but converges verrrry slowly
// after that.  For example, it takes over a million iterations to get to 7-8
// significant digits.
//
// I wrote this to evaluate the performance difference between the 8-bit Arduino Mega,
// and the 32-bit Arduino Due.
// 

#include <core.h> // for pcDuino v2
#include "Serial.h"

#define ITERATIONS 100000L    // number of iterations
#define FLASH 1000            // blink LED every 1000 iterations

void setup() {
  pinMode(13, OUTPUT);        // set the LED up to blink every 1000 iterations
  Serial.begin(57600);
}

void loop() {

  unsigned long start, time;
  unsigned long niter=ITERATIONS;
  int LEDcounter = 0;
  boolean alternate = false;
  unsigned long i, count=0;
  float x = 1.0;
  float temp, pi=1.0;

  Serial.print("Beginning ");
  Serial.print(niter);
  Serial.println(" iterations...");
  Serial.println();

  start = millis();  
  for ( i = 2; i < niter; i++) {
    x *= -1.0;
    pi += x / (2.0f*(float)i-1.0f);
    if (LEDcounter++ > FLASH) {
      LEDcounter = 0;
      if (alternate) {
        digitalWrite(13, HIGH);
        alternate = false;
      } else {
        digitalWrite(13, LOW);
        alternate = true;
      }
      temp = 40000000.0 * pi;
    }
  }
  time = millis() - start;

  pi = pi * 4.0;

  Serial.print("# of trials = ");
  Serial.println(niter);
  Serial.print("Estimate of pi = ");
  Serial.println(pi, 10);

  Serial.print("Time: "); Serial.print(time); Serial.println(" ms");

  delay(10000);
}

As mentioned earlier, you can’t see the IDE serial monitor, so an external PC needs to be used. We connected a USB-serial adaptor running at 3.3V I/O to a PC:

Now back to the sketch. An Arduino Mega 2560 can do the calculation in 5765 ms, a Due 690 ms, and the fastest I saw the emulated Arduino in the pcDuino v2 do it was 9 ms:

Wow, that’s quick. However take note that the completion time was all over the place. When it was 9ms, the only application open was the pcDuino v2 Arduino IDE. The completion time increased when opening other applications such as Chromium, formatting a microSD card and so on.

Why is that? As the pcDuino v2 is emulating an Arduino, the CPU needs clock cycles to take care of that and all the other OS tasks – whereas a straight Arduino just runs the code generated by the IDE and compiler. Nevertheless the speed increase is welcome, and opens up all sorts of possibilities with regards to deeper calculations in sketches they may taken too long on existing hardware.

Support and Community

From what I can tell there is a growing base of users (including this one) and like everything else this will help the pcDuino platform develop and evolve over time. There is a Linksprite “Learning Centre” with a growing pcDuino v2 section, the website, wiki, and support forum which are useful sources of information and discussion.

Conclusion – so far

The pcDuino v2 is a great mix of single-board computer and Arduino-compatible power. There is a small learning curve, however the performance gains are more than worth it. Another USB socket wouldn’t go astray, and the documentation and support will increase over time. However we really liked the fact it’s totally plug-and-play with the onboard storage, OS and WiFi.

And finally a plug for my own store – tronixlabs.com – offering a growing range and Australia’s best value for supported hobbyist electronics from adafruit, DFRobot, Freetronics, Seeed Studio and much more.

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 forum – dedicated to the projects and related items on this website.

The post Review – pcDuino v2 appeared first on tronixstuff.

Tronixstuff 13 Jan 01:15