Tuesday, September 30, 2008

LCD

well...it started with a series of phone calls at 9:00pm and some rumours tht sir was going to bring the lcd the next day

we all thought that programming an lcd was the most difficult thing in the world (after making a micromouse and convincing monica bellucci to go out on a date with you (for the other guys not for me))....so we all turned up expecting a hard days work...sat around with the mazidi....figured out what rs, rw en etc meant (though we still do not know what strobing a pin means)...nebody who has an idea may kindly leave a comment

pleasantly surprised when malhotra finished the hardware in about 5 minutes( or was it 6) and then tried to be modest about it.....the programming part was quite easy...especially since we have got the hang of C

now for the adc....lets wait and watch

Saturday, September 27, 2008

MOTORS AND BATTERY

what about the torque of the motor....and how did u get the dimensions...if theres ne mail tht i dont have pls send it to me

also the 2000mah battery pack means tht we need about 3-4 battery packs so we can run the mouse around for enuf time

and about the adc....dont worry its gonna work....we know the software is correct..so is the hardware

First time with the ADC

Finally laid our hands on an ADC chip. After looking up the datasheet on the net, I tucked myself in a cosy corner of the lab and got to work. The next one and an half hour was spent soldering wires and fixing the microcontroller to the sensors and ADC. The idea was to use one ADC for the three light sensors. The three IR Leds always remained ON and a transistor (base connected to the µC) in each of the sensors was used to start the phototransistors in a cyclic fashion (to get the readings of the three sensors one after another).
Three Leds were used to tell us the range of the output given by the ADC (for the light sensor whose phototransistor had been activated).
After the cricuit was done, Ankush and Vishesh got down to write the program (in C).
Apart from the fact that they were using C to control the µC for the first time (i think), they had major difficulties due to the peculiar behaviour of our lab's computer. Now whenever this computer senses that some important work is being done on it, and the user has forgotten to do the Ctrl+S routine it for some reason realises that to shutdown at that very moment will be a good idea. After a few tries they had to retreat to another PC (Win 98) and do their coding using Turbo C++. (and transfer it to the other computer to burn it onto the µC).

The circuit did not work in the first try (like always). We figured there could be many reasons- ADC wasn't working, wiring was loose, some problem with the code, we hadn't connected the ADC properly or weren't using it in the right way etc.

One confusion was regarding the "Vref/2" pin in the ADC. On thursday when we had tested the light sensors, they were giving an output range of 0V to 5V (for this range the datasheet required the Vref to be connected to ground). But on checking again, we found to our surprise that the output had now changed to 0V to 1.2V (and this required the "Vref/2" pin to be connected to +o.7V). We used a potentiometer to serve the purpose but the circuit was in no mood to work....

To close in on the victim, we connected 8 visible Led's to the ADC's output (hoping to observe some pattern) but all the Led's glowed continously (which meant the ADC was giving a value of 255 at all times). This confirmed our suspicions about the ADC - it wasn't working! and (as sir pointed out), the way we had tried to connect the three sensors to the ADC wasn't exactly correct.

With 30 minutes of school left (and a fried ADC) the only thing we could do was to see if the code was working, some tweaks here and there and we discerned that it was working perfectly (good work guys!).

All in all a SHIT day for me, hoping the singapore GP chirps me up... (go Kimi!)

Friday, September 26, 2008

Tracking battery and motors..

Sir mailed the pics of steppers motors and battery pack. The size of the motor as mentioned is 4.8cm x 4.2cm x 4.2cm (L x B x H when shaft is horizontal)....i think that should fit in the cell as when two motors when combined back to back will be 4.8 = 9.6 ~ 10 cm and the breadth of the cell is 18 cms.

The battery pack is Li-ion and power is 2000 mAh






These are the motors.

(the motors do look sturdy)

and today we have been working on ADC with Dhruv displaying his great hardware skill (yet again); I must say the wiring was very complex and doing it on the bread board makes it harder.
Though it didn't work successfully but I do expect good results once we change the ADC chip.

Thursday, September 25, 2008

MY first post

1. i cant believe we just changed the url from 35c2435.blogspot
2. i cant believe that im actually coming to school tomorrow (my first time this year tht im coming for 5 days in a week)
3. and pls i need atleast 1K of ram.....find a dip 40 with the max possible ram

The Light Sensors

For the light sensors we initially decided on an IR Led and TSOP pair. My brother had worked with them for a line following robot so i called him up and he told me that IR Led's are very "moody" so to make them work we have to use TSOP 1738 (38 kHz) and a 555 oscillator circuit to generate the 38kHz wave.
The circuit was taken from the first link we got on Google searching "TSOP 1738". (can be seen on the right)

Next day in school it turned out that our sir had already worked with TSOP's (for a car alarm or something) and suggested we use two 555 oscillators. This, due to the fact that the TSOP 1738 doesn't detect a 38Khz signal but infact a "change" in it.
So the first 555 oscillator was to generate the 38Khz wave and the other to make a much bigger wave (as in wavelength).

Sir's schematic

This circuit obviously had a lot of chunks we did not need so the final circuit was divided into a receiver and a transmitter. (having fried an IC in the past week we kept things simple and tested the circuit by a putting a LED across the transistor)
.

We began making the light sensor on the bread board with vigor and after countless tries and misses the sensor finally started working at a decent range but
1) the circuit was no good in measuring distance (to make sure the mouse moved straight) it just told us wether there was a wall or not.
2) gave a discontinuous output (a pulse) which we realized posed a major problem
To check the value from the sensor we could no longer simply compare the value and check, the pulse could be read both as a 1 and a 0 by the microcontroller. To resolve this, we found two ways out- using interrupts in the microcontroller (of which the IC we were using only had 2) or using a circuit to convert the pulse into a continous signal.

Things looked good till Ankush had the marvelous idea of mailing one of our seniors, (who also had tried making the micromouse) Mohit Taneja. In his reply he suggested we use an IR Led and Phototransistor pair and an ADC (analog to digital converter) to sense distance. (He suggested quite a lot of stuff but maybe thats another post..).

We unanimously decided to junk the old circuit (who dare not heed the advice of mohit taneja?) and replace it with a new one which looks like the one on the right (we just replaced the 22oohm resistor with a variable one).

After checking the circuit on the bread board (and boy does she work smoothly) we have now made three of these light sensors and mounted them on an acrylic wheel.

Today, as Ankush mentions in his post, we tested them and tried to calibrate their readings.
We were successful in doing so with two sensors but the third one was showing an altogether different range of output values so i guess we'll use that one as the front sensor and the other two on the right and left.


The Readings (which Ankush hoped so much that I'll post)
The first column is for the distance from the light sensor (in cms). Notice how he jotted them down on the first thing he could lay his hands on.

AT89C51AC3 dropped

As an analog-to-digital converter (ADC) was required for the light+distance sensors we were looking for a 8051 variation which had on chip ADC and at least 1kb of RAM. We (myself and vishesh) finally chose AT89C51Ac3 for the purpose but we (myself and Dhruv; ie Vishesh still doesn't know about it) finally decided on the good old 8051 DIP 40 as it quite easier and we already have a programmer kit in the robotics lab.
tomorrow the class is going out for some CSIR workshop hence we can sit back in the lab and get down with interfacing ADC with 8051 ie if sir can get the chip tomorrow...
The light sensors were sucessfully mounted and tested today. i do hope Dhruv will post the "observation table" of the sensors' readings.

...and i like that name - gunsngears

Wednesday, September 24, 2008

First Post

Finally decided on the URL.
Made the blog in the english period... math's next so keeping the first post short