Sunday, June 19

B-Squares: Solar Powered Arduino In The Wild

The B-Squares is a KickStarter Project launched by Jordan McRae which intended to facilitate the conception of solar powered devices / hacks by the "DIY" community. 
         
B-Squares is a 3D modular electronics system which emphasize on solar power and expandable energy storage.  Each Square has a magnetic contact on each of the corners which allows the Squares to easily snap together without wires.  The magnetic contacts are also used to transmit electric signals between the Squares.  
         
       

The Squares aren't restricted to being connected side-to-side in a single plane, but can also be stacked on top of or perpendicular one another.  Think of it like a deck of electric cards that you can use to make 2D or 3D card houses and have the electricity flow through the entire array        

           
There are currently 6 different type of B-Squares:
  • Solar-Square -- Includes 0.325W Solar Panel and a non-adhesive microsuction cup material for sticking to windows and other flat surfaces.  
  • Battery-Square -- Includes three (3) internal rechargeable AAA batteries.
  • LED-Square -- Includes three (3) multi-color Light Emitting Diodes (LED).
  • Arduino-Square -- Includes a 3.3V Arduino Pro compatible microcomputer with easy access to the shield ports. 
  • iPhone-Square -- Includes iPhone/iPod dock connector, PC USB connector, and stereo outputs. 
  • Proto-Square -- Includes a standard 2.54mm pitch perfboard area on the printed circuit board (PCB).  
Seeing the incredible success of this KickStarter Project, which reaches nearly six times its goal, one can hope to see this kind of device soon available via the main Arduino e-shops.  
           
         
More information on B-Squares project HERE
         

Thursday, June 16

Microsoft Kinect SDK For Windows In Beta

It is rare that the DIYers'community is so dynamic and enthusiastic about something that one of the most powerful software company feels obliged to respond. And yet, that is what happened with the Kinect, which started as a game accessory for the XBOX360. 
       
          
Microsoft announced the availability of Kinect for Windows Software Development Kit (SDK) from Microsoft Research, a free beta release for noncommercial applications. The Kinect for Windows SDK can be downloaded today at no cost for development of noncommercial applications.
           
To celebrate the release, Microsoft invited a select group of developers to the Microsoft campus in Redmond, to test the limits of their imaginations using the SDK in a Channel 9 Live 24-hour coding marathon, visible at http://channel9.msdn.com/live.
       
    
The Kinect for Windows SDK, which works with Windows 7, includes drivers, rich APIs for Raw Sensor Streams, natural user interfaces, installer documents and resource materials. The SDK provides Kinect capabilities to developers building applications with C++, C# or Visual Basic using Microsoft Visual Studio 2010.


Features of the SDK include the following:
  • Raw Sensor Streams.
    Developers have access to raw data streams from depth sensor, color camera sensor and the four-element microphone array.
  • Skeletal Tracking.
    The SDK has the capability to track the skeleton image of one or two people moving within the Kinect field of view, making it possible to create gesture-driven applications.
  • Advanced Audio Capabilities.
    Audio processing capabilities include sophisticated noise suppression and echo cancellation, beam formation to identify the current sound source, and integration with the Windows speech recognition API.
  • Ease of installation.
    The SDK quickly installs in a standard way for Windows 7 with no complex configuration required and a complete installer size of less than 100 MB.
  • Extensive documentation.
    The SDK includes more than 100 pages of high-quality technical documentation. In addition to built-in help files, the documentation includes detailed walkthroughs for most samples provided with the SDK.
 The offical web site contains plenty of information, documentation and code samples. A must see!
           
                     
  Professional Visual Studio 2010 (Wrox Programmer to Programmer)  Kinect Sensor (without game)  Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer (Wrox Programmer to Programmer)  
        
         
Official Kinect SDK web site HERE
             

Wednesday, June 15

Autodesk 123D, From Simulation To Prototype

Autodesk releases 123D, a Windows based application mainly dedicated to hobbyists which allows not only to create 3D models but also real prototypes, thanks to its solid modeling capabilities. The purpose of 123D is to provide access to the tools to help you take your concept and make it reality, to give shape to your idea, exploring it, and most importantly, making it. 
         
Solid modeling is is a consistent set of principles for mathematical and computer modeling of three dimensional solids. Solid modeling is distinguished from related areas of Geometric modeling and Computer graphics by its emphasis on physical fidelity. Together, the principles of geometric and solid modeling form the foundation of Computer-aided design and in general support the creation, exchange, visualization, animation, interrogation, and annotation of digital models of physical objects.
         
          
Not only you can freely donwload the 123D application but you also have access to free 3D models to help you get your project started, finished, or just to use in exploring ideas. 
        
If 123D does not seems ''easy'' at first, I would say that it is certainly an interesting software which should retain your attention for a while. Fortunately there are tutorials, samples, and everything you can think of to learn 123D. And if you give yourself the trouble of creating objects relating to robotics, Do not hesitate to let us know, we will be happy to relay the information.
        
       
  Printing in Plastic: Build Your Own 3D Printer (Technology in Action)  Zen Toolworks CNC Carving Machine DIY Kit 12x12  Build Your Own CNC Machine (Technology in Action)  
          
More information about 123D HERE       
           

Tuesday, June 14

AlienCortex, One Board To Rule Them All.

There is currently an interesting project on KickStarter, the AlienCortex board.
      
AlienCortex AV provides a new and powerful electronic canvas. The specificity of the Aliencortex is that it doesn't use a traditional micro-controller.  Instead, the heart of AlienCortex is a Xilinx Spartan 3e 500K FPGA.
           
         
A Field-programmable Gate Array (FPGA) is an integrated circuit designed to be configured by the customer or designer after manufacturing—hence "field-programmable". The FPGA configuration is generally specified using a hardware description language (HDL), similar to that used for an application-specific integrated circuit (ASIC). FPGAs can be used to implement any logical function that an ASIC could perform. 
       
The ability to update the functionality after shipping, partial re-configuration of the portion of the design and the low non-recurring engineering costs relative to an ASIC design, offer advantages for many applications.
              
The AlienCortex's strength lies in the fact that it can mimic just about any other kind of board that you can think of, limited only by the size of the FPGA.  Because of this kind of flexibility, it can be a VGA graphics controller, a digital music synthesizer, a micro-controller (like the one used in the Arduino), and much more.  AlienCortex's Spartan FPGA can be reconfigured as often as you like with new and different "cores"... so it's almost like a silicon etch-a-sketch in a way.
           
In the past, FPGAs have not been very easy for beginners to use.  The AlienCortex AV platform is set upon changing that with a simple, unified, GUI-based environment and a growing library of cores to base your own creations around.
           
In essence, AlienCortex AV allows you to harness the power of what an FPGA is capable of with the same skills level and programming environment as an Arduino.  It's library of pre-built cores turns AlienCortex into almost whatever you need it to be... a programmable video game console, a digital music synthesizer, a powerful robotics platform controller, a logic analyzer, and more. 
             
           
Even more exciting is that many of the AlienCortex cores are "multicore" capable, and the board also includes 512KB of synchronous SRAM allowing you to run as many as four independent Arduino sketches all at the same time.
           
Already built in are the most common ports to connect AlienCortex AV to the outside world, including VGA, audio, PS/2 mouse and keyboard, 2 joysticks, SPI, USB JTAG/Serial port, and a Xilinx JTAG port.
              
AlienCortex AV also has pin headers for 54 5-volt IO pins and 16 5-volt analog inputs arranged in an Arduino Mega128/256 form factor, making AlienCortex compatible with most Arduino shields. 

          
AlienCortex AV has already been designed, and the final series of prototypes have been built and verified.  This Kickstarter project is to fund the next stage... the first manufacturing run. Should this project be successfully funded, those who back this project at the $147 reward level (or more) will receive an AlienCortex AV from the initial production run
        
     
AlienCortex AV Hardware Specifications:
  • FPGA:  Xilinx PQ208 Spartan 3e (500K)
  • RAM:  512KB 133Mhz 16 bit Synchronous SRAM
  • SPI FLASH: 1MB (8 megabit) Numonyx Flash EEPROM for FPGA configurations, sketches, and other user data
  • Two 5V Atari-compatible joystick ports
  • PS/2 Keyboard and Mouse ports
  • Sixteen multiplexed 5V analog inputs (bit resolution is determined by the core being used)
  • 54 5V Digital/PWM I/O pins (Arduino Mega128/256 form factor)
  • Compatible with most shields designed for the Arduino Mega, Duemilanove or Diecimila.  (Most Arduino shields.)
  • 1 1/8" stereo digital audio jack 
  • 1 15 pin VGA connector
  • 4 Programmable LEDs
  • 4 Programmable Buttons
  • 1 Reset button
  • 1 FT2232 (Port A is dedicated to USB JTAG access to load cores, programs and sketches.  Port B serves as a USB serial port or Computer->USB MIDI.)
  • 1 Xilinx JTAG port (compatible with the Xilinx Platform USB Cable)
        
  FPGA Prototyping by VHDL Examples: Xilinx Spartan-3 Version  Embedded Systems Design with Platform FPGAs: Principles and Practices  Advanced FPGA Design: Architecture, Implementation, and Optimization
       
            
More information about FabulousSilicon HERE
More information on AlienCortex project HERE
More information on the Xilinx Spartan 3e 500K HERE
More information about FGPA HERE
         
            

Monday, June 13

Arduino, Interrupts And Timers

Most of us, when working on an Arduino project, put their code in the "Loop" function and this code is executed again and again. We can of course use "If" or "Switch / Case" statements, often related to sensors data, to execute some code only if a specified conditions are met. But honestly, they are situation where this way of doing things is not efficient at all.
            
The "Doorbell" case
To illustrate such a case, imagine being at home, waiting for a relative or a friend. If you had been programmed with a main "Loop" function, you would do whatever you do and then go to open the door to check if your friend is waiting, and then do whatever you do and check the door and so on...

The above case illustrated as a skecth
void Setup ()
{
  // no Setup needed 
}

void Loop()
{
  Do_stuff_1 ;
  Do_stuff_2 ;
  // ...
  Do_stuff_3 ;
  Go_Check_Entry_Door ;
  If (someoneAtDoor)
  {
    Invite_Host ;
  }
}

void Invite_Host()
{
  Action_01 ;
  Action_02 ;
  Action_03 ; 
}
      
Of course, no one would react in such a way. Instead, we do our stuff until we hear the door bell. Then we interrupts our activities and we go open the door. The door bell is  the "interrupt".
        
           
What Is An Interrupt ?
Interrupts are signals that interrupt the normal flow of a program. Interrupts are usually used for hardware devices that require immediate attention when events occur. More precisely, An interrupt is a signal sent to the CPU that does exactly what it sounds like: it interrupts the current program flow and makes it jump off in a different section temporarily, before returning to whatever it was doing previously. As far as the main program code is concerned, it doesn't even need to know that an interrupt has taken place. It will simply lose some time in the middle of whatever it was doing; other than that, everything will continue as if nothing happened. They can be very useful if you want your code to react fast to external events, while keeping your code simple.
                  
           
Using Interrupts with an Arduino
Most Arduino designs have two hardware interrupts (referred to as "interrupt0" and "interrupt1") hard-wired to digital I/O pins 2 and 3, respectively. The Arduino Mega has a total of six hardware interrupts, with the additional interrupts ("interrupt2" through "interrupt5") on pins 21, 20, 19, and 18, respectively.
         
By defining a special function called an "Interrupt Service Routine" (ISR) that you want executed whenever the interrupt is triggered, and then specifying the conditions under which that can happen. With an Arduino, you can trigger the interrupt under four conditions, which are predefined as valid values:
  • LOW to trigger the interrupt whenever the pin is low,
  • CHANGE to trigger the interrupt whenever the pin changes value
  • RISING to trigger when the pin goes from low to high,
  • FALLING for when the pin goes from high to low.

Note that  while an interrupt routine is running, all other interrupts are blocked. As a result, timers will not work in interrupt routines and other functionality may not work as expected. Therefore, always keep your interrupt routines short and simple.          
            
To Specify a function to call when an external interrupt occurs, use "AttachInterrupt" with the following parameters.
                     
attachInterrupt(interrupt, function, mode)
  • interrupt: the number of the interrupt (int)
  • function: the ISR; this function must take no parameters and return nothing.
  • mode: one of the four conditions listed above; Low, Change, Rising, Falling.
Note also that due to the fact that interrupts are blocked and timers are stopped during the ISR processing, inside the attached function, delay() won't work and the value returned by millis() will not increment. Serial data received while in the function may be lost. You should declare as volatile any variables that you modify within the attached function.          
          
If we examine our doorbell case with an interrupt approach we will now have the following code:
interruptPin = 0;
void Setup ()
{
  // declare interrupt with three paramaters
  // If the doorbell rings (pin 0 changes its state)
  // execute function Invite_Host
  attachInterrupt(interruptPin , Invite_Host, CHANGE);
}

void Loop()
{
  Do_stuff_1 ;
  Do_stuff_2 ;
  // ...
  Do_stuff_3 ;
}

void Invite_Host()
{
  Action_01 ;
  Action_02 ;
  Action_03 ; 
}
     
Reassigning Interrupts
Interrupts can be changed at any point by using the attachInterrupt() method. As soon as this is done, any previously assigned interrupt on the associated pin is removed.
          

Starting / Stopping Interrupts
Arduino also has the ability to temporarily ignore all the interrupts. You may want to do this if you have some sensitive code that must be executed without interruption. In this case you would issue a noInterrupts() call. Once your sensitive code block has completed, interrupts can be restarted by calling interrupts().
            
Removing Interrupts
Interrupts can also be removed by using the detachInterrupt(interrupt_number) method.
            
      
Timers on Arduino
There are 3 hardware timers available on the ATmega168/328, and they can be configured in a variety of ways to achieve different functionality.
  • Timer0 (System timing, PWM 5 and 6)Used to keep track of the time the program has been running. The millis() function to return the number of milliseconds since the program started using a global incremented in the timer 0 ISR. Timer 0 is also used for PWM outputs on digital pins 5 and 6.
  • Timer1 (PWM 9 and 10)Used to drive PWM outputs for digital pins 9 and 10.
  • Timer2 (PWM 3 and 11)Used to drive PWM outputs for digital pins 3 and 11.
While all the timers are used only Timer0 has an assigned timer ISR. This means we can hijack Timer1 and/or Timer2 for our uses. The PWM function on some of the I/O pins will be affected as a result however. If you plan to use PWM you need to know what is affected. I chose to use timer 2 so PWM pins 3 and 11 will be affected.    
        
The easiest way to use the timers is to download the TimerOne Library. This library will allow you to execute an ISR (Interrupt Service Routine) with regular delay.
             
The most important routines of the TimerOne library do:         
  • initialize(period)You must call this method first to use any of the other methods. You can optionally specify the timer's period here (in microseconds, 1/1000000 second), by default it is set at 1 second. Note that this breaks analogWrite() for digital pins 9 and 10 on Arduino.
  • setPeriod(period)Sets the period in microseconds. The minimum period or highest frequency this library supports is 1 microsecond or 1 MHz. The maximum period is 8388480 microseconds or about 8.3 seconds. Note that setting the period will change the attached interrupt and both pwm outputs' frequencies and duty cycles simultaneously.
  • pwm(pin, duty, period)Generates a PWM waveform on the specified pin. Output pins for Timer1 are PORTB pins 1 and 2, so you have to choose between these two, anything else is ignored. On Arduino, these are digital pins 9 and 10, so those aliases also work. Output pins for Timer3 are from PORTE and correspond to 2,3 & 5 on the Arduino Mega. The duty cycle is specified as a 10 bit value, so anything between 0 and 1023. Note that you can optionally set the period with this function if you include a value in microseconds as the last parameter when you call it.
  • attachInterrupt(function, period)Calls a function at the specified interval in microseconds. Be careful about trying to execute too complicated of an interrupt at too high of a frequency, or the CPU may never enter the main loop and your program will 'lock up'. Note that you can optionally set the period with this function if you include a value in microseconds as the last parameter when you call it.
  • setPwmDuty(pin, duty)A fast shortcut for setting the pwm duty for a given pin if you have already set it up by calling pwm() earlier. This avoids the overhead of enabling pwm mode for the pin, setting the data direction register, checking for optional period adjustments etc. that are mandatory when you call pwm().
  • detachInterrupt()Disables the attached interrupt.
  • disablePwm(pin)Turns PWM off for the specified pin so you can use that pin for something else.       
A simple implementation of the attachInterrupt of the TimerOne libray here below. This will execute myISR at a regular time lapse, a tenth of a second.
#include <TimerOne.h>

void setup() 
{
  
  Timer1.initialize(100000); // set a timer of length 100000 microseconds
  Timer1.attachInterrupt(myIsr); // attach the service routine here
}

void loop()
{
  // Main code loop
}

void myIsr()
{
  // The code executed every tenth of a second here
  // ....
}




More information on Arduino interrupts HERE
More information on TimerOne library HERE

Thursday, June 9

RobotShop Microcontroller Instructables Contest

RobotShop is partnering with Instructables, to bring you the Robotshop Microcontroller Instructables contest.  To enter the Microcontroller Contest, you will jast have to Create a new photo, video, or step by step Instructable. From simple buzzer,to high tech rover, no matter what the project is as long as it includes a microcontroller and that you share your code. A video showing what it does will be a big plus !
        
        
Prices.
500$ RobotShop Gift certificate and a DFRobotShop Rover for the grand prize, 250$ robotShop Gift certificate and a DFRobotShop rover for the second prize. A DFRobotShop Rover for the runner-Up Prize...
          
The three happy winners will also get a RobotShop/Instructables prize pack (which includes several promotional goodies such as pens, a mousepad, a screw driver, and more).
        
An extra special prize for the best instructable that makes something move with a microcontroller. 
          
Everyone entering in the contest will receive a 50% off for a DFRobotShop Rover.
       
       
Due date.
The contest closes for entries on July 3rd 2011. So Back to work and HAVE FUN !!!
           
             
More information about the Robotshop Microcontroller Instructables contest HERE
More information about RobotShop HERE
More information about Instructable HERE
        
          

Tuesday, June 7

The Robot Can, Mbed Controlled

Cool DIY robot...
          
Controlled by an Mbed controller...