Now that we know how to read the sensors, we need to make sense of it. Lets have a good look at the sensor datasheet.
ADXL335 3-axis Accelerometer
Accelerometer, measures resultant acceleration acting on the sensor.
This ADXL335 outputs an analogue voltage based on acceleration. Its sensitivity of the ADXL335 is 300mV/g, which means that the output will change by .30v per 9.8m/s2 .
The ADXL335 has a ratiometric output, meaning 0g is always around half of the supply voltage Vcc, The datasheet stated that the zero Voltage is typically at 1.5V.
Hence,
Accel = Vaccel - 1.5V
BUT I prefer to get the actual count reading when the accelerometer is resting on horizontal position
and Sensitivity is typically 0.3V/g, the Arduino ADC gives a 10-bit value based on a 3.3v reference, the gain on the raw ADC value can be calculated by:
Hence,
(1g/0.3V) X (3.3V/1024) =0.01627 g/LSB
Hence,
Position of the accelerometer = Accel *0.011
IDG500 2-axis Gyro
This gyroscope measures angular rate and return a analogue voltage signal proportional to the rate of rotation. The at the 4.5x, IDG500 has a sensitivity of 9.1mV/°/s, i.e. the output changes 9.1.0mV for every °/s of rotation. Since the Arduino ADC gives a 10-bit value based on a 5v reference, the gain on the raw ADC value can be calculated by:
(1°/s/0.0091V) X (3.3/1024) = 0.354 °/s/LSD
deduct the factory set 1.35V from raw analogue input & multiplying result with 0.354°/s/LSD will return the angular velocity in degrees-per-second.
Gyro rate =(Gyro_reading - 1.35V)*0.354 deg/sec
Since we are doing discrete maths with our controller, we multiply the known interval between gyro reading which is the loop time; we get the change in angular position in degree
Gyro Angular change = Gyro rate * Loop time
Now we have enough data to measure angular position with the gyro with the following line.
Gyro angle= Gyro angle + Gyro Angular change.
What we had just done is to rationalised both the accelerometer & gyro output to angular position with the same unit of measurement.
It is now convenient to write code to compare the sensors on the same page.
Showing posts with label electronics. Show all posts
Showing posts with label electronics. Show all posts
Saturday, July 14, 2012
Friday, June 5, 2009
Arduino
It has been a few years since I’d started to look for a mean to start on micro controllers stuff. PIC is the recommended chips as I was told they are cheap and abondon locally.
Bought many books and spent hundreds of hours surfing the net with no fruitful progress…. These books eventually became my best cure for insomnia… It never fail to put me to sleep in 20 minutes…
Everything which I found require me to build some thing, either a programmer or hardware to actually make the micro chip work… Its too much challenge for me… so the search continue
Found this book while wondering aimlessly in my local book store a month ago.
By Massimo Banzi, co-founder of the Arduino Project. Published by Make Magazine.
The cover cough my eye.
“Arduino” has appeared with increase frequency in my google search for how-to starter packages for electronically challenged beginner like me. I didn’t dig this AVR based board as I was looking for PIC stuff. What a mistake!
This is the only book on MCU which I finish reading in one go… and awake!
I learn what Physical Computing meant, Arduino uses C language, everything is open source, the board contain the necessary hardware to operate and plugin USB.
Arduino is “ready-to-go”, no need to know about bootloading, I/O connections, I2C, USB chip, communication chip... etc etc which I couldn't care less, so that noobies like me can get our claws right into the fun part.
There is a growing community such as
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl
Seriously fun ppl.
and their web page is packed with great stuff such as ready made codes/programs, meaning we don't have to reinvent the wheel!
http://www.arduino.cc
The potential application is only limited by your imagination! We can do useless thing with it such as teaching our flower to call for help when they get thirsty, lights off in the absent of occupant, control an autonomous robot, intelligent home system, track the sun, control an miniature UAV, feed the monkey, skin the fish.... all of which you can jump straight in as long as you know what make things tick, perfect toy for tinkerers.
Just placed an ordered a "clone" Arduido starter pack, (wanted to go for the real thing but they have the best shipping charges.) should arrive by next week, can't wait to blink some LED....
Bought many books and spent hundreds of hours surfing the net with no fruitful progress…. These books eventually became my best cure for insomnia… It never fail to put me to sleep in 20 minutes…
Everything which I found require me to build some thing, either a programmer or hardware to actually make the micro chip work… Its too much challenge for me… so the search continue
Found this book while wondering aimlessly in my local book store a month ago.
By Massimo Banzi, co-founder of the Arduino Project. Published by Make Magazine.
The cover cough my eye.
“Arduino” has appeared with increase frequency in my google search for how-to starter packages for electronically challenged beginner like me. I didn’t dig this AVR based board as I was looking for PIC stuff. What a mistake!
This is the only book on MCU which I finish reading in one go… and awake!
I learn what Physical Computing meant, Arduino uses C language, everything is open source, the board contain the necessary hardware to operate and plugin USB.
Arduino is “ready-to-go”, no need to know about bootloading, I/O connections, I2C, USB chip, communication chip... etc etc which I couldn't care less, so that noobies like me can get our claws right into the fun part.
There is a growing community such as
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl
Seriously fun ppl.
and their web page is packed with great stuff such as ready made codes/programs, meaning we don't have to reinvent the wheel!
http://www.arduino.cc
The potential application is only limited by your imagination! We can do useless thing with it such as teaching our flower to call for help when they get thirsty, lights off in the absent of occupant, control an autonomous robot, intelligent home system, track the sun, control an miniature UAV, feed the monkey, skin the fish.... all of which you can jump straight in as long as you know what make things tick, perfect toy for tinkerers.
Just placed an ordered a "clone" Arduido starter pack, (wanted to go for the real thing but they have the best shipping charges.) should arrive by next week, can't wait to blink some LED....
Labels:
Arduino,
DIY,
electronics,
mcu,
phisical computing,
robot controller
Thursday, May 28, 2009
Tinkering 6DJ8
It has a large family which is fully compatible, namely,6922, 6N1P,6N11, ECC88, EC88C, E88CC, E188CC, E288CC, .
Plenty of tube rolling opportunity.
It is good sounding, wide applications. It's high Gm, medium gain and low Plate Resistance. With some circuit tinkering, we can build quality Pre-amp, Buffer-amp, driver for small power SE amp, headphone amp... etc
IMHO the only tube which will sound normal when connected as cascode.
There are plenty of NOS (New Old Stock) available, as well as current production.
Labels:
buffer amp,
DIY,
electronics,
headphone amp,
preamp,
tube amp
Wednesday, May 27, 2009
Circuit Theory for Tinkerers
Like it or not, we need some basic Circuit Theory for tinkering in electrical and electronics gadgets.
BTW, changing a plug, replacing a wire, spay some paint does not count as tinkering in my book. When I tinker, I dig deep.
Where did I picked up the circuit theory know-how?
All Engineers took electrical classes somewhere along the academic route; We enter the classroom, went through the motion of listening to the teach/lecturer, collect all the handouts, do some tutorials and off we go to the exams… to return the knowledge in written form. Hopefully, some of these knowledge will residual in our brain. In my case, Ohms Law, power and summation of component value calculation stayed….
Lucky me, enough for tinkering and be dangerous.
Ohms Law
V = I · R
V is for voltage, V is the unitI
I is for current Ampere, A is the unit
R is for Resistance, Ω ohm us the unit.
From here, we can derive the following equations
I = V / R
R= V / I
Power
P = V · I
Where,
P for Power or Watt, W is the unit
V for Voltage across the component
I for current running through the component
Summation of Resistance
Series Connected Resistor,
Rtotal in series = R1 + R2 + R3 + … + Rn
Where,
Rtotal is the resulted total Resistance of the series connected resistors
R1, R2….Rn are the Resistance of individual resistor
How to use them?
BTW, changing a plug, replacing a wire, spay some paint does not count as tinkering in my book. When I tinker, I dig deep.
Where did I picked up the circuit theory know-how?
All Engineers took electrical classes somewhere along the academic route; We enter the classroom, went through the motion of listening to the teach/lecturer, collect all the handouts, do some tutorials and off we go to the exams… to return the knowledge in written form. Hopefully, some of these knowledge will residual in our brain. In my case, Ohms Law, power and summation of component value calculation stayed….
Lucky me, enough for tinkering and be dangerous.
Ohms Law
V = I · R
V is for voltage, V is the unitI
I is for current Ampere, A is the unit
R is for Resistance, Ω ohm us the unit.
From here, we can derive the following equations
I = V / R
R= V / I
Power
P = V · I
Where,
P for Power or Watt, W is the unit
V for Voltage across the component
I for current running through the component
Summation of Resistance
Series Connected Resistor,
Rtotal in series = R1 + R2 + R3 + … + Rn
Where,
Rtotal is the resulted total Resistance of the series connected resistors
R1, R2….Rn are the Resistance of individual resistor
~handy tips,
When connecting same value resistor in series,
Use This --> Rtotal = Rindividual x Pieces of resistors
Parallel connected Resistor,
Rtotal = ((R1)-1 + (R2)-1 + (R3)-1 + …. + (Rn)-1)-1
Where,
Rtotal is the resulted total Resistance of the connected resistors
R1, R2….Rn are the Resistance of individual resistor
~handy tips
When connecting identical value Resistor in parrallell
Rtotal = R1 / pieces of resistorHow to use them?
- Ohm’s Law enable us to figure out how much voltage is across the component and how much current going through the component.
- We use this as the minimum required ratings, i.e. current, voltage and watt rating of the components. *PS* For Power rating, give it at least a double,I triple when I have the chance.
- Summation of resistor allow us to add/reduce Rtotal in the circuit. By changing the Rtotal, when use with Ohm’s Law, we can figure out how to adjust the current and voltage of the circuit and/or components. Which is an essential know-how for tinkering.
Labels:
audio,
circuit theory,
DIY,
electronics,
mcu,
tube amp
Subscribe to:
Posts (Atom)