Personal G-Force Meter

Questions and Comments on All Projects
kimikarts
Newbie Pyro
Posts: 4
Joined: Tue Sep 16, 2008 3:08 pm

query

Postby kimikarts » Wed Oct 08, 2008 6:59 am

hello!
i am a novice in microcontrollers. i want to know if i can use the olimex p40 usb instead of the olimex p40(serial port). i just need to burn the code onto the microcontroller using the p40 and then use the IC in the accelerometer circuit right?

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Wed Oct 08, 2008 2:21 pm

Hey kimikarts,

The development board you use doesn't matter. If you have a USB pic programmer, the P40-USB board is a good choice.

If you have a serial programmer, the P40-Seial is a good choice.

hernanfire
Newbie Pyro
Posts: 1
Joined: Fri Nov 28, 2008 11:15 am

Postby hernanfire » Fri Nov 28, 2008 11:27 am

hello! i was testing the code (just cut and paste :D ) but the compiler does not buit it, show me some errors on
#include <delays.h>
#include <adc.h>
because these lines don`t belong to de directory and problems on
PORTB = all_digits[char_disp...... like is the wrong way to do this....
:shock:
Iam using CCS for the compiler. Somebody can attach the firt two files, sure it have to be a problem of the compiler and not the code (i see many people using it!!)
Thanx :

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Sat Nov 29, 2008 6:30 am

Hi,

CCS is the wrong compiler to use if you're trying to compile code from this project. It will not work.

You'll need the C18 compiler from Microchip, it's free from their website.

kimikarts
Newbie Pyro
Posts: 4
Joined: Tue Sep 16, 2008 3:08 pm

help!

Postby kimikarts » Tue Jan 06, 2009 3:32 am

Could you please tell the how i should go about compiling the code on c18 compiler? I have tried several times but no avail.Please guide me through the process of compiling the code.

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Tue Jan 06, 2009 6:46 am

It's all in this tutorial:

http://www.pyroelectro.com/tutorials/pi ... index.html

Just follow it step by step :D

kimikarts
Newbie Pyro
Posts: 4
Joined: Tue Sep 16, 2008 3:08 pm

re:

Postby kimikarts » Wed Feb 04, 2009 6:01 pm

hi! i have constructed the circuit and burnt the dual axis code(found in this forum) onto the PIC18F452. But whenever i switch on the circuit i get no output- the output pins show a constant 3.80V and nothing appears on the 7 segment display.Any idea as to where could the problem lie? I am pretty sure that the circuit rigged up is correct. Are there any other connections to be made other than the ones made in the tutorial?

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Sat Feb 07, 2009 3:17 am

You should be set, it sounds like a matter of troubleshooting the hardware at this point. Output pins should not be constant at 3.8v so something really strange is going on there. That's where I would start troubleshooting. Find out why that output occurs then move forward.

windummy
Newbie Pyro
Posts: 1
Joined: Tue Apr 28, 2009 5:27 pm

Thank you for this excellent project!

Postby windummy » Tue Apr 28, 2009 10:25 pm

I have been following the development of the ADXL-3xx Accelerometer since 2002.

I was extremely happy to find your web page.

Not being a C+ programmer (learning little bits by building), but able to solder OK. I would love to build this device.

My dream back in 2002 was to have a meter with the ability to recall the Max G's .

How hard would it be to expand this project to add support for displaying maximum recorded acceleration?


Could you or someone help me with this quest?

Thanks
Windummy

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Wed Apr 29, 2009 6:00 am

Hey windummy.

Well from my perspective this would be achieved quite easily, far more easily than the project I have here.

Code: Select all

int acceleration_value=0;
int acceleration_value_new=0;
while(1){
    acceleration_value_new = get_acceleration_value();
       if(acceleration_value_new > acceleration_value){
         Update_Display(acceleration_value_new);
         acceleration_value = acceleration_value_new;
       }
}


The above simple sample code can give you an idea of the program loop you would need. This would only work for positive g-forces.

However, to build this project would require you to learn a little bit about programming & embedded devices. So unless you're willing to get your feet at least a little wet, I might suggest against building this exact device.

If you do decide to try and duplicate or build a similar device and need help, just stop by and ask, pictures are always welcome! :D

nicorici_florin
Newbie Pyro
Posts: 1
Joined: Tue Jun 23, 2009 6:35 pm

G-meter

Postby nicorici_florin » Tue Jun 23, 2009 6:45 pm

Hy

I need to understand the code to explain it to my teacher but I don't understand this at all
g_val = current_result - gravity_ss;

Why is gravity_ss 512? how do you know that 1g is 512 when usibg a 10 bit adc?

g_val = g_val << 5;
g_val = g_val / display_divider;
this is a claibration ?

please tell me how did you find out that 32/20 is right.

thnaks

cgeezy
Newbie Pyro
Posts: 1
Joined: Sun Dec 20, 2009 2:39 am

Postby cgeezy » Sun Dec 20, 2009 2:43 am

Does it matter whether the 7-segment LED's are Common Anode or Common Cathode? If so, which type is used in the project? Thanks!

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Re: G-meter

Postby ThePyroElectro » Tue Dec 29, 2009 7:40 am

nicorici_florin wrote:Hy

I need to understand the code to explain it to my teacher but I don't understand this at all
g_val = current_result - gravity_ss;

Why is gravity_ss 512? how do you know that 1g is 512 when usibg a 10 bit adc?

g_val = g_val << 5;
g_val = g_val / display_divider;
this is a claibration ?

please tell me how did you find out that 32/20 is right.

thnaks


If the ADC return 512 that means no acceleration is seen, so you can think of it as a baseline.

The g_val formula you see there is so that no floating point division will be used. To be honest I've forgotten how I came up with 32/20, made this one a year ago. Sorry.

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Tue Dec 29, 2009 7:41 am

cgeezy wrote:Does it matter whether the 7-segment LED's are Common Anode or Common Cathode? If so, which type is used in the project? Thanks!


Man I really don't remember. I'm pretty sure there was just one ground pin and power went to each individual led pin.

If you take a look in the C code, you should be able to figure it out for 100% sure.

ne558p
Newbie Pyro
Posts: 2
Joined: Wed Mar 24, 2010 5:05 am

G-meter help

Postby ne558p » Sat Oct 30, 2010 4:44 am

Ok i made a hex from your C code, Used winpic burn't the chip 5 times not working using the device config i think is right. Can you please post the configuration bits or Hex file.

Thank Dave


Return to “Projects”

Who is online

Users browsing this forum: No registered users and 5 guests