Posts Tagged ‘arduino’

Manually controlling bipolar stepper motor with Arduino and EasyDriver

Stepper motors are great for accurate positioning because they move in discrete steps – a feature that makes them very appropriate for CNC software control. But every once in a while you have an application where you need to press a button and rotate some kind of a jig at a preset angle or move something a preset distance if it’s a stepper-driven linear stage. So, I decided to modify an earlier Arduino sketch I wrote for testing the world’s smallest stepper motor to make it a bit more useful (and clean any bugs in the process). Keep reading to see what came out … Read the rest of this entry »

ATtiny13 12-LED blinker with motion detection and scripted blinks

I can hear you screaming:”Not another LED blinker!” and yet here it is, packaged into yet another transparent Ferrero Rocher chocolate box, just like the first one. Why another ATtiny13 LED project? I needed to change the software to add a new feature and I had another box stashed away after Christmas – that alone should have been a reason enough :) Additionally, I have to admit right here that there will likely be one more post that includes an ATtiny13, LEDs and chocolates before I let it go (soon, I promise) and move onto more serious things, such as the DVD-CNC project that’s been languishing on and off my workbench for more than a year now.

That said, if you are still interested in programming ATtiny13 with the Arduino IDE to blink 12 Charlieplexed LEDs, respond to motion (shaking) and have the LED on/off sequence scripted in an orderly fashion rather than random or simply 1 through 12, then read on! Read the rest of this entry »

Arduino shrunk – how to use ATtiny13 with Arduino IDE

Lots of different MCUs can be worked on using the Arduino IDE, not just the Arduino boards!

Lots of different MCUs can be worked on using the Arduino IDE, not just the Arduino boards!

Arduino IDE (Integrated Development Environment), currently in version 1.0, is a great system for programming the Arduino boards. It has an easy-to-learn intuitive interface and comes with all the necessary settings for the most common Arduino boards – Uno, Duemilanove, Nano and others based on ATmega168 and ATmega328 microcontrollers. The latest version also includes some of the most recent ATmega1280 and ATmega2560 boards.
But you wouldn’t be using all of its great capabilities if you had to switch back to a text editor every time you needed to program a smaller Atmel chip, such as ATtiny13 for example. The engines behind the Arduino IDE – AVR-GCC compiler for C and C++ and avrdude – an in-system programming software for Atmel’s AVR series of micros – are already there and capable of coding for and programming the smaller chips, we just need to add a little bit of configuration magic to the Arduino IDE to be able to switch hardware freely without leaving your favorite Integrated Development Environment. Here is how: Read the rest of this entry »

Free your Arduino code from the Arduino board

Atmel AVRISP mk II programmer is getting ready to burn some Arduino bootloader code

Atmel AVRISP mk II programmer is getting ready to burn some Arduino bootloader code

Arduino as a system is a great development tool that makes it incredibly easy for a beginner to start programming microcontrollers and for a seasoned programmer to whip up a quick code in a hurry or keep a large embedded project organised when needed. I think it is very valuable for a user-friendly development environment to have a familiar setting to work in: a familiar IDE, set of libraries and a well-known hardware configuration, all of which Arduino provides splendidly.

However, the hardware – the Arduino boards, all 150,000 variations of :) – may not necessarily work very well for every occasion. Depending on your application there may simply be no space for a 2″x2.5″ board. Additionally, there’s always the question of cost: an MCU chip and a couple of extra components that you actually need for the project may not always justify the cost of the whole Arduino board, voltage regulators, LEDs and all of the extra goodness it provides.

I set out to figure out what it’s going to take to create an MCU development environment in which the code could be developed using all the familiar Arduino tools and then transferred to a stand-alone Atmel MCU so the Arduino board could be reused for future projects, along with all the above mentioned savings. My item of particular interest was to make all this work in Ubuntu Linux – my OS of choice for the last 4 years.

The quest has been helped in no small part by Newark – an electronic components distributor – who has generously provided an Atmel AVRISP MKII programmer – an essential tool for moving the code to stand-alone MCU chips. They carry a whole line of MCU development tools for your MCU family of choice and the AVRISP is one of the most economic ways to get you started programming Atmel chips. Check them out! Read the rest of this entry »

World’s Smallest Stepper Motor with Arduino and EasyDriver

This little wonder of electromechanical engineering came from inside a laser diode sled of an HP CT10L Bluray drive I’ve opened some time ago. The device on the picture consists of several parts, all easily fitting on a dime coin: a bipolar stepper motor with lead screw, a linear stage, a lens, and even an end position sensor (I’ve yet to make use of the sensor though). The entire assembly is only 14mm x 9mm x 4mm. This post is about making this tiny motor move. Keep reading! Read the rest of this entry »

Brushless DC (BLDC) motor with Arduino. Part 3 – The Stroboscope Project

It has been all dry theory in the Brushless DC (BLDC) motor with Arduino series up to this point. This is where it gets to be more fun. If you’ve just arrived, please check out the previous two installments:

  1. Driving a three-phase brushless DC motor with Arduino – Part 1. Theory
  2. Brushless DC (BLDC) motor with Arduino – Part 2. Circuit and Software

In this final part of the trilogy I am describing the hardware part of the stroboscope project and the making of the zoetrope animations themselves, in hopes that my visitors can take this further and come up with their own animations, which I would absolutely love to see. More details below! Read the rest of this entry »

Brushless DC (BLDC) motor with Arduino – Part 2. Circuit and Software

In this post I will describe the hardware and the software part of a project involving the use of BLDC (Brushless DC) motor salvaged from a broken XBox 360. This is a second installment in the series of posts related to Arduino and brushless DC motors. Please see the first part for a bit of info on the theory behind the commutation sequence. Once you understand the commutation sequence for the particular design of the BLDC motor, the circuit design for the BLDC driver becomes pretty clear. It is not much different from a bipolar stepper driver in that we need the be able to both source and sink current at all ends of the windings, except of course in this case there are only three ends whereas the bipolar stepper has four.
Read the rest of this entry »

Arduino Code Syntax Highlighting Plugin for your WordPress Blog

Arduino Brush for SyntaxHighlighter Plugin - sample of output

Arduino Brush for SyntaxHighlighter Plugin - sample of output

Ever since I published the first lines of Arduino code on this site I was not satisfied with the way it looked. I’ve been using various IDEs (Integrated Development Environment) and advanced text editors for programming for a very long time and have gotten quite used to the software marking various important parts of my programs with different colors and bold fonts. Indeed, Arduino’s own IDE does exact same thing although I have to admit I would love to change the way it marks things a little bit, whenever I get time for it. Nevertheless, Arduino IDE’s color-marked up code is very useful and makes for an easier read, especially for someone not familiar with its specialized functions such as digitalWrite() and such.
It this kind of color markup that I wanted for the code posted on this site. Enter SyntaxHighlighter Evolved WordPress plugin
Read the rest of this entry »


Coming soon ...

Recent Comments
  • Ron: One correction. The original 7200-BN bulbs were 2.5 watts. I also have 3 of the vented replacements left for...
  • Ron: I have some of the upgraded 7200LED-BN bulbs that LOA sent me a year or so after I installed 2 4-puck strings in...
  • Chisight: You seem to be trying to implement a constant current supply but the LT1121 doesn’t have a constant...
  • Joshua Donar: Would you happen to know where the driver is for the CT10L drive is? Haven’t been able to locate...
  • Albert: Hello Thank you for sharing Tell me please meaning D4 zener. Meaning the role in this schematic. Looks like...
  • Will: I also aquired a scorbot 3 without a controller and in my spare time I have been developing a simple servo...
  • YamZYang: Hello, I learned alot from here. I have a question about the H-bridge motor driver, are there any special...
  • John: I’m trying to use this code to rotate a 14-pole, 12-slot BLDC motor. However, I’m getting some very...
  • admin: The signal is most definitely a square wave of varying width. Its resulting torque might look like a sine wave...
  • Andrei: Hi there, Great article. Really helps to explain the BLDC control. I was thinking of a way to control a BLDC...