Posts with «headline» label

Arduino DUE. Everything changes, but still it is an Arduino

After a long wait, Arduino DUE is available for 39 Euro plus taxes: an aggressive price for ambitious makers.

The key factor for Arduino success has been the ease of use and a very smooth learning curve. Thanks to its basic set of functionalities, a clear hardware design and the multiplatform Integrated Development Environment (IDE), Arduino has become the reference device for many projects: from simple LED based gadgets to sophisticated projects that follow the Internet of things approach. Currently Arduino boasts a huge community of users that across the globe, with forums, interest groups and a variety of pages. In more than 5 years, the community has developed so many projects that it is easy to find an inspiration or an almost finished solution for the majority of the common needs.
With its 8 bit avr core and the IDE framework for libraries, Arduino has been the solution of choice for many, but sometimes its limits in terms of code space and hardware resources were too tight to reach the desired result. These limits are well known by Arduino Team and the long awaited Arduino DUE should represent the quantum leap needed for more complex projects. Arduino Mega was a first step towards a more powerful hardware and computing platform, but a 32bit ARM Cortex-M3 SAM3X8E is a completely different story.

Arduino Style
It took some time to set up the whole project for DUE as it involved every single aspect of the Arduino architecture. In the design process, the Team had some clear objectives, as the look and feel of IDE, the hardware pin strip compatibility with existing Shields and the programming style. It wasn’t easy and the timing for the whole process was rescheduled more than once. At the end the result is a very interesting “evolved Arduino” that shares many of the successful traits of UNO, but it also rises the bar for designers.

The full description of Arduino DUE is available for Arduino Website at “http://arduino.cc/en/Main/ArduinoBoardDue” and the shortlist of technical specification is the following:

  • Microcontroller AT91SAM3X8E
  • Operating Voltage 3.3V
  • Input Voltage (recommended) 7-12V
  • Input Voltage (limits) 6-20V
  • Digital I/O Pins 54 (of which 12 provide PWM output)
  • Analog Input Pins 12
  • Analog Outputs Pins 2 (DAC)
  • Total DC Output Current on all I/O lines 130 mA
  • DC Current for 3.3V Pin 800 mA
  • DC Current for 5V Pin 800 mA
  • Flash Memory 512 KB all available for the user applications
  • SRAM 96 KB (two banks: 64KB and 32KB)
  • Clock Speed 84 MHz

IDE version is 1.5.0 and supports the new multi core architecture, where AVR and ARM now have separate folder hierarchies to host different compilers and different libraries. IDE 1.0.1 will become obsolete soon and all the efforts will continue with this new release. Apparently a lot of the IDE looks the same, but the code behind it is quite different as the SAM3X8E requires a new programming procedure that the software has to perform in order to maintain the same “one click” programming experience.
New instructions have been added to support the USB Host and DAC, while CAN bus has still to be implemented through libraries that are under development. Serial ports hardware based are now four and may be used concurrently.
All these changes and new implementations have been carefully evaluated in the design process to limit the amount of changes a sketch needs to be ported form UNO to DUE.

Hardware issues
The main concern about Arduino DUE is the 3,3V architecture, already foreseen and planned with the UNO design, but the IOREF Pin hasn’t got the expected attention from Shield designers and each shield might work straight away or cause some issues (even the microcontroller damage) if it sends signals to digital and analog input ports at 5 volts. The IOREF pin is indeed the reference provided by designers so that any “well behaving” shield may test this pin and find out if it has to work and interact at 5 or 3,3V.
Any shield has very good chances of finding proper voltage as power supply as DUE supports 5V on its 5V power I/O pin, but any attempt to feed that level to the Arduino DUE digital or analog input will be fatal: the shield works but kills the DUE.

USB all new
The two ports labelled as Programming USB and Native USB are very interesting in terms of computer and peripherals interfacing as they allow new roles of DUE, as USB Host and Client. Again more details on Arduino website (http://arduino.cc/en/Reference/USBHost and http://arduino.cc/en/Reference/MouseKeyboard).
Also programming has been redesigned, with a bootloader pre-programmed on the SAM3X8E before it leaves ATmel factory. It doesn’t occupy FLASH memory and there is no easy way, or need, to reprogram it. Program memory and RAM share a linear addressing space, while Flash can be fully erased pressing the new “Erase” button on the board. This allows a failsafe recovery of the programming functionalities when everything else doesn’t work.

No comments before a real test
The availability of the board has just been announced and everybody is waiting for the first shipments. We hadn’t the chance of running any test, therefore we keep the comments for a more detailed forthcoming story.

Open Electronics 01 Nov 22:16
arduino  featured  headline  news  

Lighted plexiglass Christmas ornaments (Arduino version)

In the previous post we showed you how to make small Christmas shapes using an RGB LED and a small circuit based on PIC.
The designs were obtained working with the CNC some acrylic sheets.
But our CNC can do much more … Therefore we decided to make the greatest figure and design a new driver that mounts more LEDs.

Just because we do not like things simple we recreated all using a system based on Arduino.
This allows you to create an open source system easy to modify.
The microcontroller is an Atmega328 preprogrammed with the bootloader of Arduino UNO. The programming can be done via a USB / TTL (eg FTDI5V of SparkFun).
The circuit operation is very similar to that of the smallest model: here we find the photocell that allows to verify the amount of light present in the environment, but in this case, you can adjust the sensitivity of the circuit by a trimmer.

BOM

R1: 10 kohm
R2: 820 ohm
R3: 820 ohm
R4: 1 kohm
R5: 820 ohm
R6: 820 ohm
R7: 1 kohm
R8: 820 ohm
R9: 820 ohm
R10: 1 kohm
R11: 820 ohm
R12: 820 ohm
R13: 1 kohm
R14: 820 ohm
R15: 820 ohm
R16: 1 kohm
R17: 820 ohm
R18: 820 ohm
R19: 1 kohm
R20: 820 ohm
R21: 820 ohm
R22: 1 kohm
R23: 820 ohm
R24: 820 ohm
R25: 1 kohm
R26: 820 ohm
R27: 820 ohm
R28: 1 kohm
R29: 10 kohm
R30: 4,7 kohm
R31: 10 kohm
R32: 4,7 kohm
R33: 4,7 kohm
R34: 10 kohm
R35: 4,7 kohm
R36: 10 kohm
R37: 4,7 kohm
R38: 10 kohm
R39: Trimmer 4,7 kohm MV

C1: 100 nF
C2: 470 µF 25 VL
C3: 470 µF 25 VL
C4: 100 nF
C5: 15 pF
C6: 15 pF
C7: 100 nF
C8: 100 µF 25 VL

T1: BC547
T2: BC547
T3: BC547

LD1: LED 5 mm RGB c.a.
LD2: LED 5 mm RGB c.a.
LD3: LED 5 mm RGB c.a.
LD4: LED 5 mm RGB c.a.
LD5: LED 5 mm RGB c.a.
LD6: LED 5 mm RGB c.a.
LD7: LED 5 mm RGB c.a.
LD8: LED 5 mm RGB c.a.
LD9: LED 5 mm RGB c.a.

U1: 7805
U2: ATMEGA328P-PU (with bootloader)

Q1: 16 MHz

LDR1: photoresistor 2÷20 kohm

- Terminal 2 via (3 pz.)
- Socket 14+14
- Battery 12V/2A
- Strip male 6 via
- Plug
- Switch

Comparing the value read from the A/D converter connected to the photoresistor with that connected to trimmer R39, the micro decides whether to start the sequence of fading, or whether turn off the LEDs. RGB LEDs are driven by the transistor; this choice permit to control with a single line of microcontroller, more LEDs in order to create large luminous figures.

As you can see, we use a line dell’ATmega for each of the primary colors of red, green and blue, so it is clear that all the diodes will do the same play of light. Of course isn’t required to mount all the LEDs provided in the circuit: you mount those who need to obtain a good visual effect on the size of the pattern in the Plexiglass. Note that there are three terminals on the PCB: one to connect the power switch (ON / OFF) a second (BATT) to apply to the circuit power supply and a third (CHARGE) for a possible battery charger lead or a small 12-volt solar panel, which already incorporates the charging circuit. These solutions allow you to use the figures lack the power grid. In this regard, an analog input of the microcontroller is dedicated to control the battery voltage: when it drops below 10 V, the circuit will emit flashes to warn that the energy is about to end.

This circuit is evidently intended to be used externally (provided it is properly isolated) and will turn on and off independently, thanks to the ambient light sensor, which will illuminate the figures in the evening to let off in the morning. In short, is a solution to decorate the garden or backyard.

Building shapes
The materials chosen for this application are clear polycarbonate (or methacrylate) or Plexiglas, which can give the shape you want. Then we need to affect, deep enough (half or two thirds the thickness of the plate) the drawing or writing that you want to appear bright.

The Sketch

//****************************************************************
//*  Name    : RGB controller for common anode led               *
//*  Author  : Landoni Boris                                     *
//*  www.open-electronics.org                                    *
//*  blog.elettronicain.it                                       *
//*  www.futurashop.it                                           *
//****************************************************************

int red = 9;    // RED LED connected to PWM pin 3
int green = 10;    // GREEN LED connected to PWM pin 5
int blue = 11;    // BLUE LED connected to PWM pin 6
int photo = A4;    // BLUE LED connected to PWM pin 6
int trim = A5;    // BLUE LED connected to PWM pin 6
int volt = A2;    // BLUE LED connected to PWM pin 6
int r=50; int g=100; int b=150;
int rup; int gup; int bup;
int fader=1;
int inc=10;
void setup()
{
      Serial.begin(9600);
      Serial.println("Serial READY");
      rgb(r, g, b);
      r = random(0,255);
      g = random(0,255);
      b = random(0,255);

} 

void loop()  {

  Serial.print("trim  ");
  Serial.println(analogRead(trim)*2);  

  Serial.print("photo ");
  Serial.println(analogRead(photo)); 

  Serial.print("volt ");
  Serial.println(analogRead(volt));
  if (analogRead(volt)<600){
      Serial.println("low battery");
      rgb(0, 0, 0);
      delay(500);
      rgb(255, 255, 255);
  }

  if ((analogRead(trim)*2)>analogRead(photo)){
      Serial.println("trim > photo  -  off");
      rgb(0, 0, 0);
      fader=0;
  }
  else
  {
    if (fader==0){
      r = random(0,255);
      g = random(0,255);
      b = random(0,255);
    }
    fader=1;

  }
  //delay(2000);

  if (fader==1){
    funcfader();
  }
}

void funcfader(){
    Serial.println("fader");
    if (rup==1){r+=1;}
    else{r-=1;}
    if (r>=255){rup=0;}
    if (r<=0){rup=1;}

    if (gup==1){g+=1;}
    else{g-=1;}
    if (g>=255){gup=0;}
    if (g<=0){gup=1;}

    if (bup==1){b+=1;}
    else{b-=1;}
    if (b>=255){bup=0;}
    if (b<=0){bup=1;}

    delay(inc*2);
    rgb(r, g, b);
}

void rgb(int r, int g, int b)
{
  Serial.print("RGB: ");
  Serial.print(r);
  Serial.print(" ");
  Serial.print(g);
  Serial.print(" ");
  Serial.println(b);
  if (r>255) r=255;
  if (g>255) g=255;
  if (b>255) b=255;
  if (r<0) r=0;
  if (g<0) g=0;
  if (b<0) b=0;
  analogWrite(red, r);
  analogWrite(green, g);
  analogWrite(blue, b);
}

 

Star
Reindeer
Santa Claus
Tree