-
Microcontrollers
I don't know if any of you work with microcontrollers, but that is how I spend about 20% of my free time.
I recently got one of STMicro's STM32 F3 Discovery boards, a deliberately low cost evaluation board aimed at capturing the starving-student and hobbyist markets.
I've been getting started with their peripheral libraries, and what I am doing right now is re-writing and expanding their MEMS magnetometer (read: digital compass) code example:
http://youtu.be/pfnlU2HmLxQ
I will be at least doubling the precision of the compass indicator by using a multi light scheme to indicate postions between the 8 LEDs. I will also try to develop a different clinometer which could be useful for navigation and range finding, using the board's MEMS gyroscopic sensor.
The accellerometer could easily be used for a pedometer, or similar scheme for measuring distance traveled. I could easily add a serial GPS module, and a TTF LCD display and this micro could have all kinds of cool applications as an outdoors oriented personal navigation device. It would be no Garmin, but would be a heck of a lot of fun to design and program.
Sorry for the janky video. It's rough to try to take down-facing video with a webcam built into a notebook.
-
I've also got some serial digital radio transceivers from Texas instruments [cc11xx and cc25xx series] and Nordic Semiconductor [nRF905] for another project, so some radio telemetry could be useful in this project too, though that sounds like a much more work.
I'm looking right now to see if there's a convenient way to do RSSI measurement with the Nordic chips. That and a directional antenna would be usefull for direction finding. Could be cool for camp and personal beacon location :D
-
Well I finished this portion of enhancing the compass demo. I now have 22.5 degrees of precision, which of course is only the minimum of the resolution, thanks to our mighty human brains. This is only the limit of the LED output, it being a little ring of 8 LEDs. The MEMS sensor is actually precise to fractions of a milliradian, and on all 3 axes. The downside is that it seems to be even more sensitive to spurious magnetic fields than conventional mechanical compasses. It doesn't seem to be a problem except when I hold it over my computer.
I'll probably try to get started on the clinometer functionality next. That sounds like fun, and maybe a little like pulling teeth.
-
-
-
Wow,.....so what exactly are you building.....?....or intended use?
-
I play with PICs, program them with Proton BASIC which supports floating numbers! Been having a ball with this setup. Chips are cheap too, I design and build on a large breadboard... then draw a schematic of the finished project. Then with Pad2Pad lay out the PCB, flip it and print it on real glossy paper... Then with a high dollar laminator I affix the transfer to the copper clad and etch with hydrochloric acid and hydrogen peroxide (a 50/50 mix works well enough). Make sure you agitate for fast & even etches and so the etched edge does not get too thin.
Your project looks cool, can you add an LCD display to show the actual azimuth?
Cheers,
Andrew
-
I want to go back to the 1980's so I can remember some of the crazy stuff I did and can't remember:confused: So send me one when you are done with it:smartass:
-
Last time I was at Radio Shack they were fresh out of "Flux capacitors"......on back order.
-
EB, Yes, I could. I could even get a touch screen, and thanks to andy brown, I could even save myself much of the work: http://andybrown.me.uk/wk/2012/01/07...screen-driver/
Hunter: I'm building some navigation related outdoor toys.
-
Cool! I started out with the PicAxe, but found it seriously limiting for what I wanted to do... Invested about $100 in a good programmer and went to the PIC chips, with Proton BASIC I can pretty much do anything I can imagine... Very rewarding to work with these devices!!!
Id love to do a CW decoder program some time, but I think that is beyond my abilities, software wise.
Andrew
-
-
EB: have you seen TI's MSP430 offerings? they are a broad range of 16bit micros and are well documented, as well as having a very active support forum and there are a hand full of active hobby communities online. They sell an evaluation board with a built in usb programmer/debugger that comes with two DIP microcontrollers from their value line for the promotional price of $4.30 shipped. I've got several of them.
I've also got a pic kit 2 wtih the LPC experimenter's board on long term loan from a friend who bought it for his college courses.
I must say though, the ARM Cortex M3 and M4 chips have considerably more muscle and memory. It's actually overkill for this project, but that leaves plenty of room for expansion, and the board is currently being promo'd as a free sample. Their whole range of discovery boards are deliberately priced low anyway, and also include the programmer/debugger (the ST-Link 2, which on it's own would sell for $50). these discovery boards range from $8 to $20.
One of the benefits of using such a powerfull micro here is that it can do all kinds of math that the wimpier ones can not, or can not easily without some slow, memory hungry software tricks. An example is great circle distance computation.
-
So, back on Track; the compass as I said before uses the ring of 8 LEDs in a circle, 45 degrees of arc apart. I modified the example code so that when magnetic north is in a position between within 11.25 degrees of the half way point between two lights, they are both lit. This is how I doubled the precision of that demo.
The next thing I'm thinking of doing is doubling the precision further, to get 11.25 degrees of precison, by dividing it into 32 segments, so that when north is in a position between two of these 16 positions, the one it is further from blinks, and the one it is closer to is continuously on. I will have to have a different blinking scheme then to differentiate when it is only 11.25 degrees from one of the eight cardinal and ordinal directions, which could simply be a different blink rate. I'll have to work that out, but if anybody is following me, feel free to make suggestions.
The clinometer is proving to be quite the head-scratcher, but I think I should be able to use nearly the same formula used to get the compass heading in degrees from the 3 floating point axes of the magnetometer to get the divergence from plane on that axis from the 3 axis gyro-sensor. It's really teasing my dyslexia because I have to get it to give the correct plane which the device is turned up on it's side (so that one eye can see the display while sighting along it's side edge.
It's just too bad a high output diode laser rangefinding system would add too much cost to this project, or there would be some really serious potential in this, like an all around swiss-army-navigator :D
-
Wait a minute; I just had a spark of recognizing the obvious! To increase the resolution I don't have to blink the LEDs at all, I can just turn them off. E.g. half way between NW and NNW, the LEDs will indicate by turning off.
-
-
of course last night, with fatigue and brain fog long set in, I sat down with a notepad to figure the minimum, center and maximum angles for all the points for my compass. This is not a difficult thing to do really, unless you're inside my tired little brain, but I never even thought to cheat:
http://en.wikipedia.org/wiki/Boxing_...Compass_points
They have a nice, neat little table. of course it would have been easier just to write a nice little script to generate the whole block of C code for me, since it is inherently iterative and derivative.
E.g. it is much easier to go:
Code:
<?php
echo "<pre><br />";
for ($n=5.625; $n < 360; $n += 11.25) {
echo(" if((myHeading=>".$n.")&&(myHeading<"); $n+=11.25; echo ($n.")) {<br /> ...<br /> }<br />");
}
echo "<br /></pre>";
?>
than to write out the resultant code:
Code:
if((myHeading=>5.625)&&(myHeading<16.875)) {
...
}
if((myHeading=>28.125)&&(myHeading<39.375)) {
...
}
if((myHeading=>50.625)&&(myHeading<61.875)) {
...
}
if((myHeading=>73.125)&&(myHeading<84.375)) {
...
}
if((myHeading=>95.625)&&(myHeading<106.875)) {
...
}
if((myHeading=>118.125)&&(myHeading<129.375)) {
...
}
if((myHeading=>140.625)&&(myHeading<151.875)) {
...
}
if((myHeading=>163.125)&&(myHeading<174.375)) {
...
}
if((myHeading=>185.625)&&(myHeading<196.875)) {
...
}
if((myHeading=>208.125)&&(myHeading<219.375)) {
...
}
if((myHeading=>230.625)&&(myHeading<241.875)) {
...
}
if((myHeading=>253.125)&&(myHeading<264.375)) {
...
}
if((myHeading=>275.625)&&(myHeading<286.875)) {
...
}
if((myHeading=>298.125)&&(myHeading<309.375)) {
...
}
if((myHeading=>320.625)&&(myHeading<331.875)) {
...
}
if((myHeading=>343.125)&&(myHeading<354.375)) {
...
}
by hand, doing the math yourself.
-
Cool project, I like typing code but I haven't done it in so long I have probably forgot everything.
-
Coding is good for the mind, provided you don't do too much of it.
-
I like that PHP script you wrote, to write your code!! Ive done similar with QB4.5 to a text file and copy/paste that into my software!
Do any of the uc you mention offer any BASIC compilers? Im not a C guy, nor do I desire to invest the time to learn C just for a specific chip, not for a hobby. I like the Proton BASIC, I can *COMPILE* to a native hex file and dump right to the PIC.
Andrew