Nope! I’m not dead, dear bots!

I’m working quite hard last few months, I barely have time to my hobbies. But I’m not dead, and when I have time I work a little on it!! I got slapped in the face when the company’s IT I work for deleted all my personal files and uninstalled all programs that doesn’t belong to “company’s police” that were in the laptop I work… Bit me! So I bought a MacBook Air to do my own stuff and specially this projects!

In the go-kart area, as usual I’m facing problems with engine. For costs reason there’s a bunch guys here that uses the engine of the old Yamaha RD135, bit of smoke, lots of noise and lots of power above 7500rpm! I’ve heard some guys talking about 45hp… Sounds like too much for me compared to the original 16hp. But I wouldn’t say less then 25hp! Anyway… Here’s my last few laps last Sunday. At the time I had drove the whole day, so no more arms left!

And in the Arduino area, there’s one good news… I found a better magnetic sensor switch for the dashboard project. It’s exactly what I was looking for! Works the same way the others I already have, so no changes in the code. You can find here the link for DX. And this is what I’m talking about:

Hall effect sensor

 

Only exception is that the wires doesn’t seem so resistant. The idea is that it’s fixed, with almost no moves, except in the steering wheel, but I’ll mange to find a way keep it safe! :)

Regards…

Testing TM1638 + Go-Kart dashboard project

Hello world!

Well… Since my go-kart engine still in maintenance, I found another way to play with TM1638 display that I bought here: http://dx.com/p/8x-digital-tube-8x-key-8x-double-color-led-module-81873

Basically it read the values from the potentiometer and maps to 1 to 10000, more or less the rpm of the engine, and shows at display. Also turns on the leds mapping the value of the potentiometer from 1 to 16.

The small piece of code I wrote to do it is here:

#include <TM1638.h>

TM1638 module(8, 9, 7);
int potpin = 0;
int val;
int val2;
void setup(){}

void loop()
{
val = analogRead(potpin);
val2 = map(val, 0, 1023, 1, 16);
val = map(val, 0, 1023, 0, 10000);

switch (val2) {
case 1:
module.setLEDs(0x1);
break;
case 2:
module.setLEDs(0x3);
break;
case 3:
module.setLEDs(0x7);
break;
case 4:
module.setLEDs(0xF);
break;
case 5:
module.setLEDs(0x1F);
break;
case 6:
module.setLEDs(0x3F);
break;
case 7:
module.setLEDs(0x7F);
break;
case 8:
module.setLEDs(0xFF);
break;
case 9:
module.setLEDs(0x100);
break;
case 10:
module.setLEDs(0x300);
break;
case 11:
module.setLEDs(0x700);
break;
case 12:
module.setLEDs(0xF00);
break;
case 13:
module.setLEDs(0x1F00);
break;
case 14:
module.setLEDs(0x3F00);
break;
case 15:
module.setLEDs(0x7F00);
break;
case 16:
module.setLEDs(0xFF00);
break;
}
module.setDisplayToDecNumber(val,0,false);
delay(1);
}

More detailed information about how to use the TM1638 you can find here:

http://tronixstuff.wordpress.com/2012/03/11/arduino-and-tm1638-led-display-modules/

Also from this link above comes my inspiration to the dashboard I’m planning to do for my go-kart, this video:

More information about this project you can find here:

http://fergotech.net/diy-shift-lights-and-dashboard/

That’s why I bought magnetic switches… The idea is that one of this goes to rear axle, and each time ir switch from 0 to 1, Arduino reads it, calculate the time needed to turn one time and convert to km/h, according to the tire circumference.

Same for the RPM, each turn of the engine is has X milliseconds, based on that it’s possible to calculate how much rotations per minute it represents.

On both cases it’ll be used Arduino’s millis() function. Maybe for RPM I’ll need micros() instead, but I’m not sure yet. According to my calculations, millis() could not be so precise for this case… But I’ll need to test, and for sure I’ll post it here.

Have fun!

Temperature Sensor

Hello again, world!

Temperature is also important for my go-kart project (later I’ll write about the project itself). It’s pretty important to know how to change the fuel mixture to avoid doing a hole in the piston and screwing up the spark.

Considering that I bought a temperature sensor in DX and here it is:

IMG_0631[1]http://dx.com/p/diy-lm35-linear-temperature-sensor-module-black-166653

I put my finger close to it, so you can see how small it is. It uses the LM35 sensor, and here you can find its data sheet.

It works more or less like a potentiometer. You put on it 5v (or 3.3v, but you should change the code), and the output is mV, so we need analog pin. This sensor has a precision of 10mV/C, so for each Celsius degree output increase/decrease 10mV. And for each mV… you can do the math, right? :)

Arduino ADC has a precision of 10 bits or 5v / 1024 or ~0.0049. If we read the pin, we’ll have the value in volts, to convert it to millivolts we must multiply by 1000 and how the sensor precision is 10mV/C we must divide by 10… in other words “pin * 0.0049 * 1000 / 100”. Or being less stupid “pin * 0.49” and to convert to Fahrenheit multiply by 1.8 and then sum 32.

The left pin has a “-” close to it, what makes me know it’s the ground pin, the right one has a S close to it and I guess it is the output pin (if someone knows what “S” means, please let me know). The pin in the middle could only be VCC. Well… Now it’s easy to wire it… Left pin to Arduino ground pin, middle pin to Arduino 5v pin and right pin to Arduino A0 pin.

I wrote a small code to read the temperature:

int analogPin = 0;
int readValue = 0;
float temperature = 0;

void setup() {
Serial.begin(9600);
}

void loop() {
readValue = analogRead(analogPin);
temperature = (readValue * 0.49);
Serial.print(“Temperature: “);
Serial.print(temperature);
Serial.print(” C “);
Serial.print((temperature * 1.8) + 32);
Serial.println(” F”);
delay(1000);
}

The output is:

Output from Temperature sensor

The value grows when you put the finger in the sensor, as you may notice in the picture above.

Have fun!!

Magnetic Detection Sensor Module

Hello world!

Some words about my tests with sensors I bought to go-kart project…

All of them work basically in the same way, you must connect VCC pin to Arduino 5v pin, G pin (or ground, or “-“) to Arduino groud pin and Out pin (or whatever its named) to some digital pin, in this example I used pin 2. When it detects a magnetic field (like a magnet) they change the status from 0 to 1, or from open to closed, or from LOW to HIGH… Whatever you need! Using digitalRead() function in Arduino is pretty easy to use them.

There’s one and a half exception only: The real exception is the last one (right side) in the picture below changes from 1 to 0 instead. For sure this is not a problem, you must just remember it when you’re writing your code. The “half” exception is the first one (left side) that looks to have also an analog output, I didn’t even tested it or Googled to know how it works… And I’m not planning to do it so soon…

.IMG_0630[1]

By now I tested them with a pretty small rare-earth magnet I found at home. The better one in my opinion is the red one in the right. It detected the magnet more or less from 1,5 cm and the others about 1 cm. I hoping to have better values with bigger magnet, otherwise I’m in a bad shape for what I’m planning to do.

To test it I wrote this small code that turns on the led at port 13. (or turn it of, in the case of right one).

int magnet = 2;
int led = 13;

void setup() {
pinMode(led, OUTPUT);
pinMode(magnet, INPUT);
digitalWrite(led, LOW);
}

void loop() {
int magnetState = digitalRead(magnet);
if (magnetState) {
digitalWrite(led, HIGH);
}
else {
digitalWrite(led, LOW);
}
delay(1);
}

Easy, isn’t it? You can replace digitalWrite(led, HIGH) or digitalWrite(led, LOW) for whatever you want to do when it detects the magnetic field.

DX links to the magnetic sensors (in the order of the picture):

Btw… I also tested a Funduino Uno that I bought, since DX is not selling Arduino (I know it was fake) anymore. So far now it seems to work as an Arduino Uno!

Houston we have a problem!!

Well… I’m pretty sure that no one will read this, but let’s keep it just for record…

Two weeks ago the engine of my go-kart opened a hole at the piston and cut the “head” of the spark because of too poor mixture. I must say that it’s not funny when this happen at 100 km/h in a small piece of metal (the go-kart :)), the engine got stuck and you start spinning around… Some pictures of what happened inside:

983860_456821574410488_1856808364_n  Spark

I needed one whole sunday to open the engine (thanks God it’s a simple 2 stroke) and fix the damages, but was ok…

So last saturday I went to track again to test and have fun… And this happened ok the whole day… In the end of the day my brother in law was driving when the gearbox broke. It is not his fault, the gearbox was “telling” us that this was going to happen soon. At leas happened in the end of the day!

I was planning to start doing some stuffs with the hall effect and temperature sensors I bought for telemetry, but now I need to spend next days fixing the gearbox. I’m a little bit sad that I need to postpone Arduino stuff, but pretty excited to open the gear box and see what’s going on inside.

I did some tests with sensors today, just to learn… I’ll write about it later!

And to finalize a video made from a friend of mine driving my go-kart! Just for the record… I’m about 10 seconds faster than him… He doesn’t know how to shift gears well yet…

The beggining

Hello all!

The main purpose of this blog is to share with the world my experience in projects I’m doing. By now I have 2 projects, first one is some kind of telemetry system for my go-kart and the second one is an airplane model I’m building slowly (made of plastic bottles, I show some pictures later!).

Both projects are going to be done using Arduino, but I’m not planning to share my whole codes and I tell you why: you’ll lose all the fun and the knowledge if you easily copy and paste the source codes and use the same schematic that I’m using. Am I right? Of course I’ll share some tricks or how to solve some problems that I’ll have, that’s the purpose of internet, right?

Some words about me? Well… I’m a Brazilian guy (sorry about my bad English btw) graduated in computer network that works for an automation company. As a hobby I like to race go-karts and this year I was introduced to Arduino world then I decided to do by myself an airplane model and this telemetry for my go-kart. And no, I don’t have big knowledge with electronic stuff and/or Arduino. All that I know I found at Google or some friend helped me.

Hope you like it!

Regards!