WP_20131102_003

UberCubeX4- The MSP430 based benchtop LED Cube

I recently made a led cube. It is a project i was dreaming to fiddle with for quite a while(years). I finally managed to make one. Here is the complete video of the demonstration.Its basically a 4x4x4 Led Cube with various patterns programmed into it. I made it during Diwali-The Indian Festival of lights. The entire build procedure is documented in the video.

Want to build your own?

Keep watching this place and i will bring a complete tutorial in while!

Cheers,

IndianTinker

Update:

The source code is available on github .

 

 

Final Build

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:

Schematic

Schematic

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.

Board!

Board!

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..
Cheers,
IndianTinker

😀

Edit: Please vote for this project on instructables here !

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

(Thanks for sharing Aleš )

 

pic3

Tutorial:How Much I`ve got Left- The MSP430 Way

Ah.. Battery. The Best thing about MSP430 uC is that one doesnt need to give a second thought as far as powering the controller is considered. This guy accepts almost everything below 4V  (when nicely put and harshly i have used it at 4.2V which  is Voc of a 3.7 Li-ion battery used in Cordless phones in this part of the world). Added to it, one can exploit the low power modes to conserve the battery power.

That all been said..One question still persists in every battery powered device is “How Much I`ve Got?”.  This question has been answered by the designers of the chip by  incorporating an internal voltage sensor into the chip,whats better is that the output can also be read as ADC input which opens a lot of great possibilities of voltage processing to disable certain voltage related features on a product/project.

Now lets get digging . A closer look at the user`s guide page no.-561 :

pic1

So, the 11th channel is (Vcc-Vss)/2. Vss is GND or 0V . Hence, What the ADC will return will eventually be  Vcc/2 .

Thats pretty much, now you need to just code and read this value from the internal channel always or upon request. But there still is a catch.. Internal reference is  required because if you choose the default Vcc and Vss reference which will pretty much fall as you use your gadget so measuring the voltage will be a lunatic idea in this case. For the purpose , we have two voltage references in the device i.e. 1.5V and 2.5V. Its obvious that we will choose 2.5V as if Vcc=3.7V , then the ADC output incase of 1.5V ref will be 3.7/2=1.85 .So, the value will ride on 1023 all the time , hence , we choose the 2.5V reference.

pic2

However, there seems to be another draw back of 2.5 V reference, which is that at the 2.2V point or voltages below 2.5V , the reference will not be generated. But that can be neglected as most hobby parts dont work at such low voltages. A more robust strategy can be adopted as follows: Whenever the voltage falls below/nears the 2.5V point, we can quickly stop the ADC and change the reference to 1.5V

Further, on design pov , battery status need not be always read, it can be triggered by suppose a button press and indicated by LED flashes this is when you require the minimalist hardware in place for this task.. Of course we can use LCD displays to display exact voltage but thats usually an overkill as Battery is perceived better as a level than a value.

Now lets get started and code the application, i wont cover the idea of switching the threshold/reference as far as code is concerned

The code is available on my git here. This is a threshold one only!

Here is the code to blink the LED based on the voltage levels:


//Coded by: Rohit Gupta on 16th June`13 at 0127hrs

#include<msp430g2553.h>

#define SWC BIT3
#define LED BIT0
volatile float voltage;

void blink(int t)
{   int i;
    P1OUT=0;
    P1DIR|=LED;
    P1OUT|=LED;
	for (i=0;i<t;i++)
	{
	P1OUT|=LED;
	__delay_cycles(500000);
	P1OUT&=~LED;
    __delay_cycles(500000);

	}

}
void delay_ms(unsigned int ms ) //Delay_MS
{
      unsigned int i;
      for (i = 0; i<= ms; i++)
        __delay_cycles(5000); //Built-in function that suspends the execution for 500 cycles
}
void main()
{
	WDTCTL = WDTPW + WDTHOLD;
	 BCSCTL1 = CALBC1_1MHZ;
	 DCOCTL = CALDCO_1MHZ;
	P1DIR&=~SWC; // Input
    P1IE|=SWC; // Interrupt Enabled
    P1REN|=SWC; // Internal Pull Ups On // Do not use internal pull ups on Launchpad V1.4
    P1OUT|=SWC; // Yay! Its a pull up!
    P1IFG&=~SWC; //Clear Flag if not set!

    __bis_SR_register(GIE);

	while(1)
	{

	}
}
#pragma vector=PORT1_VECTOR  //ISR Sub-routine
__interrupt void Port_1(void)
{   unsigned int value=0;
	if(P1IFG&SWC)
	{
		ADC10CTL0=SREF_1+REFON+REF2_5V+ADC10ON+ADC10SHT_3; // Using internal reference of 2.5V
	    ADC10CTL1=INCH_11+ADC10DIV_3;   // Internal Voltage
	    __delay_cycles(1000);                   // Wait for ADC Ref to settle
	    ADC10CTL0 |= ENC + ADC10SC;             // Sampling and conversion start
	   while (ADC10CTL1 & BUSY);             //waiting for conversion to finish
	        value = ADC10MEM;                    //fetching adc value
	       ADC10CTL0&=~(ENC+ADC10ON);
	        voltage=(value*2*2.5)/1023;           // Converting To Legit Voltage Values in Volts

	  if(voltage>=3.5)
	  {
		  blink(5);
	  }
	  else if (voltage>=3.0 && voltage<3.5 )
	  {
		  blink(4);
	  }
	  else if (voltage>=2.7 && voltage<3.0)
	  {
		  blink(3);
	  }
	  else if (voltage>=2.2 && voltage<2.7)
	  {
		  blink(2);
	  }
	  else
	  {
		  blink(1);
	  }

	  P1IFG&=~SWC;	 //clear flag
	}

}

The video grab when you run the code and “do the watch expression thing” to see the value of voltage variable is as follows:

pic3

PS: This method is applicable only when you are measuring battery directly connected across the power pins of the MSP430 not thru a regulator. For that case, you will need to use the resistor divider+snubber circuit into an ADC Channel externally.

Here is a detailed video from compiling the above code to running it and pressing the button. You can certainly test by bread-boarding the MSP430 and apply different voltages as i did with my bread board power supply

Cheers,

Rohit Gupta

IMG_0754

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!

Micro-Nodes!

Micro-Nodes!

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!

Touchscreen setup

Tiano-MSP430 based TouchScreen Piano

Touchscreens..huh.. They are all around us..Phones ,tablets, phablets and now even laptops. Most of them have a capacitive touchscreen where the change in capacitance at a point is used to sense it and then perform the corresponding action. Capacitive ones are multi point sensing. They sense more than 2 points and hence we get those pinch to zoom features etc.

On the other hand , almost archaic version on touchscreen is the resistive version. That are pretty easy to interface with almost any microcontroller with an ADC. In this project i did over the weekend i tried to interface a touchscreen ( resistive one..) ,available at mobile repair shops in Delhi with a MSP430G2553 (Although MSP430G2231 would also do)  to make a piano.

Touchscreen setup

Pre-requisites: The touchscreen may not be easier to get. I got mine from a mobile repair shop in LR. It is a 4-wire Touchscreen, pretty common with horribly thin contacts that took a lot of patience to solder.There is a lot of literature available on Touchscreens on the internet. I found two app notes that were best. First one from Atmel , that explained the working of the touchsreen in a pretty clear way and one from TI that some what helped in the software part.

You must read the atmel one ( atleast the first few pgs to get how it works). Its essentially a resistive voltage divider. The value of the touch point is determined by the ADC value read.

formula

From the illustration above(borrowed from TI App Note). One can easily see how the co-ordinates are read. In order to find out, what wire on your touch sreen corresponds to X and Y meshes. You can use a multi-meter first to measure the resistance between pins ,usually the alternate pins belong to same axes. in my case it was X-,Y-,X+,Y+  then to differentiate between x and y , one probable method will be to power the touchscreen i.e. giving the drive voltage and then find out the voltage at any other terminal w.r.t. ground and see whether is changing horizontally or vertically in your reference plane.

CAUTION: Be careful about the current while powering the touchscreen externally!

After this coding part is pretty simple. For the algo refer to page no.7 on the TI App Note. If you plan to run your end application on a battery and you have hard-coded the co-ordinates and the Vdrive is sourced externally i suggest that you sample the Vdrive as well . If you are using  microcontroller pins to supply Vdrive then this can be neglected.

I have a desire to learn to play music but unfortunately due to my low patience levels , i have failed to keep up. 😀

So, i made this Piano using the MSP430 Launchpad and a touchscreen along with a speaker. The code algo is pretty same as TI App Note Suggests and i encourage the reader to code it himself . Any difficulties can be discussed. It uses the tone library i posted earlier to generate the solfeggio.

Here is the shaky and horrible video i made:

Cheers! 😀

DSC05610

Reverse Engineering an Automobile Fuel Gauge using MSP430 Launchpad

I have been keeping my hands off the blog for a while after the previous post.. I had exams at university. But in the meantime i had some time to get my car`s faulty petrol/gasoline Gauge Indicator Changed. I got the old one and as usual i tried to reverse engineer the gauge with all the simple tools i had. Technically, Its a ” Floating type Liquid Level Resistive Transducer’ (You can trust me on that..I am a student of Electrical Engineering 😀 ). So basically its a variable resistor much like the LDR or a Potentiometer. The one that i have is a pricol make for Maruti Suzuki Cars. You can have a look at the pictures below. DSC05612

DSC05610

Using the TI MSP430 Launchpad i decided to sort of simulate how the Indicator would actually work in real situations. So i pulled up the ADC Pin on the MSP430G2231 using a 220 ohm resistor and connected the fuel gauge indicator as in the set-up picture you can see below.You can use any platform you like arduino,stellaris etc. all you need to do is read the ADC value and produce a corresponding brightness for the LED and when at a low level raise a low fuel alarm which in my case is the RED led. I used Launchpad as it has Two on-board LED`s while my arduino has only one ; additionally i was lazy enough not to wire another led to arduino 😛 .

DSC05614

On measuring the resistance across the fuel gauge i found that when at the lowest position it has a resistance of about 112 ohms and at the maximum it was about 7.2 ohms. On the sticker pasted on the top its mentioned-” Do not connect direct 12 volts”.Which is pretty obvious because since the resistance is low, the current will be pretty high.

12/112=0.1amps

but on full scale its about 12/7.2 ohms=1.67amps

This current is pretty high and will surely burn the coil.

So we now know why the sticker is there! 😀

The program simply blinks the red led when there is low fuel. Rest of the time the intensity of the Green LED is proportional to the amount of fuel thereby producing a variable DC voltage which can be sensed using a voltmeter quite similar to the one fitted in the car console.

TL;DR

Watch this video:

Thanks and Regards,

IndianTinker 😀

DSC05412

Texas Instruments India Analog Design Contest 2012-2013

Recently me and my friend partnered for TI ADC 2012-2013. We made a ‘multi nodal wireless instrumentation and Telemetry system for Solar Cars”. This was entirely based on Ti products and the same model can be extended to low cost plant monitoring systems also.

These are the Booster Packs for Launchpad we made in the process. The lower one contains all the required stuff  i.e. regulators and connections for driving heavy automobile loads..The upper one contains the sensors and an optional LCD just in case of monitoring the system dynamics.

DSC05412

You may have a look at this entry video we made!

Edit: We have won a consolation prize in the event 😀   ContestPost

Cheers and Regards,

Indian Tinker

😀