CoffeeBreak Tutorial #3:The Easy Peasy Stepper Driver/Stepper Motor Test Circuit


Stepper motors are quite widely used for CNCs/3D Printers or other Electromechanical hacks like the polar plotter etc. ! There is as always a constant need to run the motor to check whether its aligned properly or not? Does the flex coupling has any issues? Is the driver dead or alive and the best one- whether the current setting is fine to generate enough torque to hold or move the lead screw.

Pestered by the same above questions i wanted to build my own driver/motor tester overnight and it ‘must’ be microcontroller-less since there is no actual use of a controller here! I stumbled open this awesome project that i saw on Hack-A-Day.

It uses an ATiny AVR microcontroller which is (no offence to the author) an over-kill as most modern stepper drivers like the ones from polulu  need just two signal i.e STEP and DIR.

A pulse on step pin will initiate a step to the internal indexer that handles what coil has to be energized based on the sequence and micro-stepping settings, while the DIR is a level signal whose level decides whether the internal indexer of the driver counts up or down!

So, only two inputs i.e Pulsed input for STEP and level input for DIR. This can be achieved using the 555 timer in the astable mode. The Output of 555 i.e pin 3 will go into the step pin and the DIR pin is pulled up using a resistor and it is also connected to ground via switch.

This gets the job done! We can also have a POT to vary the frequency since some motors dont respond to faster pulses due to rotor inertia.The driver i am using is based on DRV8825 from TI. It is slightly wider than the polulu one. (You might call me a TI fan boy 🙂 )

With the designing almost final , I grabbed a piece of perfboard since, i didnt had the time to etch the board.

The circuit is as follows:


It has two power inputs 12v, 5v and a common ground, all of which are sourced from an ATX! The circuit itself is pretty simple.

The final build on a 8mm perfboard is shown below.



I chose to use a SMD 0603 10K resistor between pin 8 and 7 to reduce the space and connected 104 (0.1uF) Ceramic caps as shown. The switch is a 10xx and the capacitor is required at the input of stepper driver to reduce supply dips when it draws current. I have used female headers for the motor since most motors come with a connector that can be easily wired up with a single strand wire. I used the Power Terminal connectors for the main 12V Driver supply as the driver is rated for 2.5A which is too high for the usual jumper cables !

top and bottom

TIP: If you are using the non-tinned/less tinned headers that have been lying around in the component box for a while, make sure to rub the connectors using sandpaper to remove corrosion residue on the contacts else it might seem soldered but it wont actually be soldered. Also you may use some extra flux.


Cheers !

Rohit Gupta


Open Agitator

After a somewhat woeful week at college that shook my belief in several sectors.. I mustered up my courage to realize an old project they knocked the door every time i used to Etch PCB boards. Since, the solution i use has already done close to 20 boards of small size one has to really keep shaking/stirring/Agitating the solution for a fairy long time.. ( ya 7-8 mins of man power is fairly long time 😛 )

The idea came to me when i visited my brother in Bangalore earlier this year. He was generous enough to give us a tour of his world class Biotechnology lab in India.. He showed us stuff and things/instruments which were difficult to pronounce in one go but they all had a thing in common- They ended with syllables like –‘-izer’,-‘ator’,’-ation’. 

One thing that they used for not allowing things/particles to sediment was called a shaker. It would be great if i could get one for myself that will take the work out of etching. When i returned i made an over-killed 3D model of the agitator that i had in mind. It would just be a 1-axis CNC with a stepper motor and belt, That was doing a lot for the task..

Here are some pics of the model:

Looks Cool Though..

Looks Cool Though..

Freewheel mount and stepper motor

Freewheel mount and stepper motor

Realizing the overkill design, I went on to an easier one earlier this month ( actually previous month ) when a relative who was ‘demolishing’ his old PC gave me some old CDROMs that didn`t work. The mechanics did work though..

So, I just ‘damaged’ the tracks around the main feed motor and attached my own custom circuit based around the MSP430 micro-controller and majority of TI parts as they can be shipped to anyone  with an address making it very easy to re build yourself.

Here is a proof-of-concept video i posted a while back where the Etchinator ( now Open Agitator after i realized it could do a lot more like cooling hot milk  😀 ) was etching its own control board  :

I used a L293D H bridge motor controller to control the forward and backward movement of the cradle with an adjustable speed by giving a PWM on the Enable Pin . People who had made LFR`s in the first/second year know its a child`s play.

After running the aforementioned set up for a while i noticed that  the cradle would shift to the farther end where the gear was slightly worn out. So, when loaded the cradle would :

1. Latch on to that part and stay stuck.
2. The whole system would move a bit forward each time and latch on the wrong part.

So, an end-stop detection was required which would keep the cradle in the fixed portion.. some what similar to the ones i had seen in the CNC`s which tell them their legitimate playing fields.

The answer was using the old mouse push button that came with the CD-ROM. Its softer and probably made to withstand greater number of press-cycles than a standard SPST Tactile switch.

So , now the logic would work like, whenever the button/EndStop is pressed, the direction will be reversed for a fixed time and then reversed again.. So, the cycle keeps on going.. .. .. ..

Here is the final  schematic i came up with:



Since, i did`nt wanted to leave any pins un-used i included 3 LED`s which show the different states of the agitator.

The power supply needs special mention as it converts from a standard 12V DC adapter to 5V for the logic of the bridge (L293D) and again an LDO LP2950-3.3V for the MSP430. The LDO can be sampled from TI and 7805 is available locally with every tinkerer.

Even the driver i.e L293D can be sourced from Ti. The brain of the device is a MSP430G2231 also sampled from TI and programmed from the MSP430 Launchpad. So, This project was indirectly sponsored by TI 😀

The next came the board layout.. I designed it to have the least number of  vias (They can be a pain sometimes) while fitting at the back of the CD-ROM. Here is the one with just two vias.



Since, the position of motor/EndStop switches were flexible they eased out the routing a bit. You can also add a DC Jack to it if you like. The files are available on github here.

Here are pictures of the final build i managed to pull off.

The EndStop

The EndStop

Shiny Copper Board

Shiny Copper Board

All in Place

All in Place

Scratchy Soldering

Scratchy Soldering

Power Test Complete

Power Test Complete

Fixed to the back of the CDROM

Fixed to the back of the CDROM

The next thing that was left was to give it a sturdy base. I choose two planks of wood that were lying around. It was essential to leave it without any base on the middle section as if ‘ever’ there is a chemical spill that can be cleaned without unscrewing the entire assembly!

So, Here is the final build :

Final Build

Final Build

You can fork the complete code and design from my git.

Here is a video of me explaining the build.. Please ignore the following :

  • Bad camera quality
  • Some goof-ups with the IC names.. Keep an eye on the Sub Titles/Captions
  • Background Noise (if any)

Hope you like it and build one for yourself..


Edit: Please vote for this project on instructables here !

See another make of my project by a reader on instructable:

(Thanks for sharing Aleš )


Travelogue: Bangalore

Bangalore! Bangalore!!Bangalore!!! . Twice i have missed chances to go there.. The last missed chance was when i had invested a full weekend in planning out the probable travel outings after my presentation ends.. But due to unforeseen reasons.. I missed that opportunity.
Being a an Engineering Student and that too in the Electrical Engineering School , one never gets time to visit places too often ( Thing only an Engineer can understand ).

Long story short, I and my friend [Jaspreet] had made a project for TI-ADC 2012-2013 which ultimately got selected as ‘Consolation Prize Winner’. You can see the project video that we submitted  here . Basically it was  initially developed to log the data from our solar car and display it on the GUI wirelessly. Not only that we can switch many loads inside the cars like fans and lights but also we can monitor and control everything except the driver! We scaled up the project into a multi-nodal sensor system. The use of it is that we now don`t need to wire these units physically. The GUI does that entirely!



As consolation prize winners we had to present the paper at TIIEC-2013  and demonstrate the project at NIMHANS Convention Centre,Bangalore! At about the same time, another college team of [Shashank a.k.a Shank] and [RohitKrSingh a.k.a RKS], our juniors also made it to the Consolation stage with their Autonomous Ship Navigation System. It was great!! Now we all had to reach bangalore. The possible ways was by train or air! Train took a hell lot of time ( almost 2 days) and plane took just 2 hours. So we booked Air Tickets and We were soon on board Spicejet SG-211 !

All the participants will be grateful to TI as they had arranged accommodation for two in an awesome IBIS Hotel,Hosur Road ,  All meals, all travel and were even reimbursing us train tickets.. In the mean time ,since we had planned to visit and roam around in Bangalore and maybe visit Mysore we need accommodation for an extra 2 days.. Since we wont be staying in the hotel after the conference we needed some alternative place.. I ringed some relative and cousins in Bangalore and finally got us an accommodation for the next 2 days! I also made some city roaming plans in my little diary. I had heard that Public Transport connectivity is pretty good in Bangalore and one should refrain from taking the “AUTOS” . So , i noted all the major route and at least 3 alternative routes with bus numbers in case Google Maps ditched me! ( more on this later)

Sambhar Dosa- Not like the one we get here  in Delhi.Chutney and Sambhar served in equal qty.

Sambhar Dosa- Not like the one we get here in Delhi.Chutney and Sambhar served in equal qty.

Conference was great! We talked with a lot of like minded people from across our country and made new friends , learned some “Marathi” from the team we shared our booth with. Their description of the marathi songs we heard in some TV shows was enlightening !

It was the best exhibition i had attended and the best part was that our booth was the first of all, nearest to the gate. So , everyone would first come to our booth. [Jaspreet] did all the explaining most of the time. I was mostly roaming here and there, asking others exhibitors about their stuff ( Courtesy: Restlessness ).
I would be great to bring the fact that the Conference was inaugurated with an electronic lamp which is a project i was involved in.You can read about it here!

In between the conference after the day got over, i had to make a quick run to my aunt and the case was same for [RKS]. Apparently the route was pretty much the same. We had planned that all four of us will go, but that did`nt panned out . So, only two of us were going at their respective aunts. We walked to the Bomanahalli bus stand waited for like 40 mins. It was 9pm and none of the buses google said i could get, were coming.. Further, the place where my aunt stayed was kadubesanalli. I repeatedly kept saying it to the drivers/conductors and they all made faces like ” What the hell?? Is that a place , in around here? “.I found out i was pronouncing it very badly. Finally at 9:15 pm a bus came and a passenger said that go to the “Silk Board” and catch the bus. No bus goes directly from here.

We went to silk board and got the bus!
MISSION ACCOMPLISHED! The buses were great, very clean and with an air conditioner that was really effective! Reaching at my aunts place was not difficult after that. We returned at about 12 that night and crashed on the bed to go to the conference the next day!
I presented my first paper and then the next day was the Awards night!
Now, we had planned to roam around for the next two days! The IBIS Hotel offered us extended luggage vault this saved us a lot of miles else we would have to run to my brother about 20km away and that would cost us quite a part of the day.

As suggested, we took the One Day AC bus Pass ( Which i have secure in my ‘Ticket Collection’ ). As planned we would go to Banerghatta Park to watch some animals, then go to a couple ( which ultimately came down to one! ) museums. It was Saturday and roads to park was packed! The AC bus driver was playing local songs in Kannada ( i guess). The other passengers were enjoying it.. It was alien to me but i enjoyed the tune..
The bus conductor dropped us about 1.5km before the entrance of the park. I still don`t know why as the bus was there at the park when we reached. As we walked towards the entrance, we saw a group of “Art Of Living” volunteers on a cleaning mission, we shopped some drinks and local “namkeens” (which i am really fond of  tasting where ever i go) and at last reached the gate. Then, i turns out there are several options and ways to browse the park, we went with the most common one that is normal bus with cage like windows! If somebody happens to have been to Borivali National Park, the bus is pretty much the same! But the catch is that you have to occupy the seats in order of your entry to the bus and they are hell strict about  it.The Park is very well maintained and its not allowed to take any plastic stuff inside the park and the guard on the gate packed all the “namkeens” i had bought into separate paper bags!

Phew! We happened to be at the last one and we got the back seat and also there were lesser people so, we could choose, Right or Left??
We ended up on the Left Side ( which was an awful choice as it turns out later ). The bus started, everybody got their shooters out . There are separate areas( bigger than those as in Borivali National Park ) for lions, tigers,bears, deers and elephants! The bus driver would stop at every place from where we could see any animal. This time we were in the cage and animals were in open. You can check out the pictures below and have a look at all the animals we saw. The bad thing happened on that particular day all the animals choose to come on the right side and we could hardly see then with all the people busy finding their niche in those 7 windows of the bus !  :/ . But thankfully [jaspreet] and [rks] chose the right side and they could click some pics which we rejoiced later!It was pretty hot that day, most of the animals were either in water or near water .
IMG_0681 IMG_0684 IMG_0713 IMG_0707
After the bus ride got over, we were left like in the middle of nowhere , A walk with the other people on the bus, ended up at the ButterFly park! It is a good place to visit and has a lot of nasty butterflies roaming inside the specially prepared bio-dome for them which creates the right amount of humidity for them to survive. There is also a museum about the butterflies which we quickly breezed through. We saw a lot of people bringing macro lens clad DSLR to click those tiny restless butterflies. Wonder how they (butterflies ) felt about the photo session (Random Thought !) 😀

Here are some we manage to catch in our CMOS-CCD!

IMG_0733 IMG_0738 IMG_0754

Having spent the day, in such a wonderful way was just great! To make it better, we wanted to go it HAL Museum which was pretty far. So, we boarded the Bus , which dropped us at Richmond and then we boarded another bus to HAL Museum. The stomach was ringing hunger bells but it can be ignored for a while as the museum entry closed at 5pm and it was already 4pm. We had to hurry! Fortunately the bus came in about a minute and we were on the way to the HAL Museum. But this time again, even after mentioning to the conductor that we needed to go to the “MUSEUM”. He dropped us 2.5km before. With the time not on our side and no bus stop near we had to walk..walk..walk..walk. During, the walk we saw some great labs (from the outside ) like Shape Memory Alloy Lab and Metal Workshops also. Being students of engineering the very sight of “Textbook” words written  on laboratory doors was pretty spell-bounding and assuring that what we are studying is not fiction.

So, we reached the Museum all drenched in sweat and thankfully the doors were open. We got in.. We saw a PSLV Heat shield (used/recovered/prototype ) in which the satellites are protected during the launch!

Heat Shield Inside!

Heat Shield Inside!

There are several real models of planes used in Indian Airforce and they are pretty well presented. Apart from that there is a whole museum of circularly arranged chambers which show Indian History as far as Aeronautics is concerned. We were blessed by the presence of [RKS] who in my eyes is the mobile wikipedia of Aeronautics. The moment he say a name plate which may be of an engine , ejection system or the plane.. He would tell us about the history and specifications of the engine and all such details which none of the display boards mentioned. It is a great place for someone who is interested in seeing planes.

DSC05717 DSC05724

We spent close to an hour in the museum and then we were back at Mc`Donald`s for feasting! We then boarded the bus back to IBIS Hotel (actually a couple of buses) to get our luggage and move to JNCASR,Jakkur where my brother was waiting for me!

Ah! What a day spent after a wonderful conference!

We had plans for Mysore the next day! Catch it in the next edition i.e Travelogue: Mysore!

Stay Tuned!

Micro Adjustable Bread-Board Power Supply

I always wanted an adjustable Power Supply that would shell out about 1-1.5A for most of my applications as a hobbyist. But the Space they occupy and the price they come with are always a problem. So, I thought of building a very small power supply that would serve my purpose.

Having worked with LM317 earlier , i choose to build my around it. LM317 can give out about 1.5A according to the datasheets which is more than enough for most of my applications. Now the next hurdle was to make it as small as possible. The schematic is given below:



It took a couple of design iterations to make it suitable for a single sided board and i was finally able to come up with a very small one.
The size i was able to build was 3cm X 2.5cm with all components included on board.
Before making(etching,soldering) it was necessary for me to do some 3D- Rendering of the PCB so that i can have a better Idea of how the final board will look. I used Google SketchUp for the same. The Isometric image is provided below:

3D Rendered Board

3D Rendered Board


The Final Rendered Image

The Final Rendered Image

It took me a while to make the board as the Bourns Pot i had was faulty and the local store took some time to get it for me.The board has a heat-sink for LM317 glued using processor heat glue to dissipate heat.There is also a small switch that i managed to squeeze on the board and a diode..just in case you had polarity issues.

The completed board that i built looked like this:

Small and wastes no holes

Tiny and wastes no holes

This is the demo picture showing the output as 2.9V at a 8V input from a standard AC adapter.

In Action :)

In Action 🙂

Cheers and Regards,

IndianTinker 😀

TI MSP430 Dice( and other experiments)

7 Segmented Displays are pretty low tech and have been around for quite a while.They have a lot of wiring clutter with them..But still they are by far the most easiest(and cheapest) way to give out a (alpha)numerical output..I had interfaced 7segs with MSP430 a while back directly but owing to the low current capabilities of MSP430 the display wasn`t very good and clear . We were recently ‘taught’ about the BCD-7 segmented display in our semester..So i thought about interfacing the 7 segmented with the CD4511..This will save some precious pins and plus drive the 7 seg directly. The CD4511 IC can run from 3V Supply..So no power supply issues and the logic high(input) is about 2V which is also apt as on MSP430 we have this about 3.3V.

The datasheet is available  here

The only thing that was bad was the wiring clutter  has increased and there were (as always) a few loose connections.After a few minutes,I was up and running with the display.

The Fritzing Schematic is given below:


Do everything according to the picture above for the code to run. If the Schematic is not clear..then refer to datasheet linked above.Everything has been done according to it..The LT(bar) and BI(bar) have been connected to +VCC and LE to ground.The display is powered from the ‘board’.

The connections (from the MSP430 end to CD4511) are:

P1.4 -D




#define D BIT4
#define S BIT5
#define B BIT6
#define A BIT7

The code to drive the CD4511 “According” to the above config is:

void CD4511(int numb)
				case 0:P1OUT&=~(B+A+S+D);
				case 1:P1OUT|=(A);
				case 2:P1OUT|=(B);
				case 3:P1OUT|=(A+B);
				case 4:P1OUT|=(S);
				case 5:P1OUT|=(A+S);
				case 6:P1OUT|=(S+B);
				case 7:P1OUT|=(S+B+A);
				case 8:P1OUT|=(D);
				case 9:P1OUT|=(A+D);

Just to clarify :The code uses ‘S’ instead of ‘C’ because C was being used as an internal macro in the header file!

The video is down here..It first shows the simple counter..then the push to change count and then the Dice.
To get the complete source can comment below..The comments are moderated so you email will not be leaked.
Thanks for passing by!
#Sorry for the bad cam! 😛