nitro_car_project

/media/uploads/joe/_scaled_ansmann-20terrier.jpg/media/uploads/joe/_scaled_mbed-microcontroller-angled.jpg/media/uploads/joe/_scaled_20082010-007-.jpg

I came to ARM as part of my young apprenticeship and I had little experience of embedded chips and no experience of programming them. On my first couple of days I was playing around with the compiler and the mbed making the LED’s light up. As I got the hang of programming I started to think of a project that I would like to do and that would be useful to me. So I started to think about hobbies I do and an idea jumped out at me. I could improve the technology on my nitro R/C car! I now had an object to improve but I had to think of what to add to it, so I came up with a list:

• Engine temperature

• RPM

• Fuel level

• Speed

• Range finder

• Engine stop

• An accelerometer

/media/uploads/joe/_scaled_18052010-001-.jpg

I chose the three that I wanted to do the most and I chose to measure the RPM to make the engine stop if the car flipped and because we needed to use an accelerometer for the engine stop I chose that as well. We also thought that because we have this data it should be saved to a flash drive. We thought because the accelerometer was the most important part we would start with that, we used the LIS302 because it all ready had a library for it and it was easy to use. I wired it up to a LCD display to check the readings where correct but it printed lots or random numbers. I tried to work out what was wrong but in the end I just rewired it up and it worked! I next went on to making a program to work out the RPM there were a couple of things we could have used but we decided to use a QRD1114.

/media/uploads/joe/_scaled_11052010-001-.jpg

The QRD1114 detects black and white and the voltage is different for each (black is 0-5v and white is 5v+). I had a problem trying to get it to work because I could get it to give readings but they were not right. So I did tests on it and found that the QRD1114 was a dud so as soon as I changed the component it started to work! The penultimate component that I needed to get working was the servo. All I needed to do for this was use the calibration program in the mbed cookbook. To make the engine shut off we needed to make an array so if the accelerometer read a certain value for 2 seconds or more then it would turn the servo 90°. The servo would be attached to a butterfly valve inside the exhaust of the car and when it was closed the car would stop.

/media/uploads/joe/_scaled_16082010.jpg /media/uploads/joe/_scaled_20042011-004-.jpg /media/uploads/joe/_scaled_20042011-005-.jpg /media/uploads/joe/_scaled_26052010.jpg

The final thing that I had to do was to get the data to save to a USB memory stick. This was no problem because I only had to change a little bit of my program. So I had made all the programs that I needed all I had to do was put them together (easer said than done). I started by getting the accelerometer and the QRD1114 to save to the flash drive and then I wired up the servo and added the array. The main problems I had was getting pieces of the different program in the right places. I did not think that it mattered but apparently it did. One of the most frustrating things was that the program would run but it would not do what I wanted it to do so I had to go through my program to work out what was wrong.

When we did our first test run on the QRD1114 only read 0RPM all the time so we decided that it could not determine the white and black at 31,000RPM, but there was one upside everything else worked almost perfectly. We decided that the best thing to do was to change the QRD1114 to a photo-interrupter (the KTIR0611S) luckily it worked with the same program so we did not have to make any changes. So I had finished my program. The photo interrupter went on the rear axle as you can see below. We added a bigger grub screw to the axle so it would pass through the photo interrupter showing that it had completed one rotation.

oldnew
/media/uploads/joe/_scaled_20082010-010-.jpg/media/uploads/joe/_scaled_20042011-007-.jpg

We thought that that it would be a good idea if every time the program made a file it used the RTC as a base for the file name that meant that the data would not be over write and we would know exactly when the file was created (we used the website http://www.unixtimestamp.com/index.php to get the time for the RTC. That is why we have a coin cell in the circuit to power it all the time so it does not need to be set every timer the mbed it turned off.

This is my finished program and circuit!

http://mbed.org/users/joe/programs/nitrocarproject/latest

/media/uploads/joe/_scaled_20082010-011-.jpg/media/uploads/joe/_scaled_18082010-004-.jpg

(It’s a bit messy because it is only the prototype!)

This is just a little test I did using my hands to spin the wheel and to move the accelerometer.

/media/uploads/joe/20091503.xls

I have now started making a PCB for my circuit. I have to make two PCBs because the light gate needs to be at the back of the car and the mbed with the other components, I am trying to make the boards as small as possible and I have managed to make the light gate board (KTIR0611S) 27mm x 19mm and the mbed board is 42mm x 79mm. I have been using the free version of eagle ( http://www.cadsoftusa.com/ ) and it has been easy and fun to use. On this soft ware there is a very useful feature called auto router and as you can probably gather it auto routes the signals but I did not use this feature because it was more useful for me to do it myself. The prototypes are going to be made at ARM so we can check that it all works properly and when we are happy that it does what it is meant to it will be sent off so a proper one will be made. The equipment that is used for making the PCBs at ARM is not very accurate so I had to make all the vias bigger than they would normally be. This is so the top and bottom layer of the controller PCB will line up and so it is easier to make because the two layers have to be lined up by eye! This means the prototypes will look slightly different to the final PCB but all the wiring will be the same it will just be a bit bigger. We have tried to make the PCBs at ARM and we managed to make the KTIR0611S PCB but for some reason we could not make the controller. We tried for about 2 hours to make the board but to no avail. What we might have to do is get both of them properly made so they can be tested. I have soldered up the KTIR0611S PCB and tested it, good news it works better than the original :) The only change I made was that I removed the LED and changed the resistor to a 4k7.

These are my two boards and schematics (you will need to have eagle to see these)

/media/uploads/joe/nitro_car_project_2.zip

(This one is just images of them so you can open it without eagle)

/media/uploads/joe/nitro_car_project.zip

So I finally have my two PCBs and they look really good. I have soldered up the KTIR0611S PCB and the readings are the best I have ever had. The controller I have had some problems with as the accelerometers pins are slightly too big for the holes and i am trying to work out how to get the USB connector to lie flat.

I have now finished soldering both PCBs and I have attached them too! All the components work exactly how I need them to and I am going to run the car tomorrow to hopefully collect some data. The only part that is not connected up fully is the servo to the butterfly valve as I need to make a bracket for it and I can’t do that at ARM. /media/uploads/joe/_scaled_20042011-001-.jpg/media/uploads/joe/_scaled_20042011.jpg/media/uploads/joe/_scaled_20042011-003-.jpg/media/uploads/joe/_scaled_20042011-002-.jpg

This the parts list for my project:

PartDescriptionPlace of purchase
Resistor 1100khttp://www.rapidonline.com/sku/Electronic-Components/Resistors-Potentiometer/Carbon-Film-Resistors/CR50-0.5W-Carbon-film-resistors/29579/62-0604
Resistor 24k7http://www.rapidonline.com/sku/Electronic-Components/Resistors-Potentiometer/Carbon-Film-Resistors/CR50-0.5W-Carbon-film-resistors/29579/62-0572
KTIR0611S Photo interruptersingle transistor output slotted photo interrupter featuring an aperture comprising an infra-red emitter and sensor housed in a black polycarbonate body. Available with 3 x 6mm or 5 x 7mm slothttp://www.rapidonline.com/Electronic-Components/Optoelectronics/Photodetectors/Transistor-Darlington-photo-interrupter/68054/kw/KTIR0611S
A mbedyou all know what the mbed ishttp://mbed.org/order/
A USB socketa USB socket that will attach to the PCB under the mbed so the data collected and be saved to a flash drive. i have used the coolcomponents USB board so the socket lies flat saving space and letting the mbed go on top of ithttp://www.coolcomponents.co.uk/catalog/product_info.php?products_id=556
A voltage regulatorthis is to change the 6v from the battery pack to 5v for the USBhttp://uk.farnell.com/texas-instruments/lm317lilp/ic-adj-linear-reg-1-2v-to-32v-to/dp/1534499
A simple switcha two way switch to start and stop data logginghttp://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=0334101
A LIS302 AccelerometerAn LIS302 is a 3-axis accelerometer, accessible via a digital SPI interface with a selectable range of 2g or 8g.http://www.sparkfun.com/commerce/product_info.php?products_id=8658
A 6v battery packyou can use 4 1.5v batteries (4xAA). This is power is used to power the mbed, the servo and the USB socket. You can run everything from your car but you will get a lot of noise so you will need to add some capacitors to the circuithttp://www.rapidonline.com/Electrical-Power/Batteries/Boxes-Holders/AA-Battery-holders/71696/kw/18-3687?source=googleps&utm_source=googleps
A 3v coin cell + holderthis battery is used to power the RTCbattery: http://www.sparkfun.com/commerce/product_info.php?products_id=338 holder:http://www.rapidonline.com/Electrical-Power/Batteries/Boxes-Holders/Coin-cell-holders-Keystone/71110/kw/18-3627?source=googleps&utm_source=googleps
A servothe servo is used to turn the ball/butterfly valve. You can use almost any servo as long as it will be able to turn the valve remember that there will be a lot of pressure from the engine. I used the SRM-102 from sanwa but I’m sure there is a better one for the jobhttp://www.moormodels.co.uk/acatalog/SANWA_SERVOS.html
A ball or a butterfly valvethis is used to turn off the engine. I tried to make one but I was very had to make a complete seal so I ended up buying one. The problem with this is that the hole is restricted a lot even when there valve is open so you do lose power! So I am having a look to see what else I can do if anyone has any ideas they would be welcomed.http://www.screwfix.com/search.do;jsessionid=3G4M044AXHU3ACSTHZOSFFY?_dyncharset=UTF-8&fh_search=89226&searchbutton.x=12&searchbutton.y=4 (I then had to machine it in the lathe to make it fit into the silicon adapter)
This is not too important but it could be handy to have: a silicon adapterThis is the part where you put the valve inside and because you have to cut this seal you might want another one or two just in case you get it wrong. (I’m speaking from experience)http://www.fusionhobbies.com/ProductDetails.asp?ProductCode=AR201000002&click=2
Capacitor 210uFhttp://uk.farnell.com/jsp/displayProduct.jsp?sku=3017357&CMP=e-2072-00001000
Capacitor 1100uFhttp://uk.farnell.com/jsp/displayProduct.jsp?sku=8767122&CMP=e-2072-00001000
Pin headers (male/male)I used them to connect the USB socket to the PCBhttp://www.coolcomponents.co.uk/catalog/product_info.php?products_id=241
Pin headers (female/male)these are used to raise the mbed off the PCB to save space as you can put components under the mbedhttp://www.coolcomponents.co.uk/catalog/product_info.php?products_id=377

All wikipages