Making a digital level
Dietrich
Posts: 5
I was wondering if there was any information out there on making a digital level that would simply turn on an led light when it was level.· I know that this is probably an extremely easy project, but I have never tried any of these projects and was interested in making this level.
Thanks for the help
Thanks for the help
Comments
Almost any solid state accelerometer can be used as a tilt sensor, which is essentially what you're looking for. They come in 1-axis, 2-axis and 3-axis models, so you can be level in more than one plane if you so choose. As I remember Parallax sells them in the Sensors section of their web site.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I appreciate the help, I was wondering though if anyone had done this before because I don't know where to begin. I had the accelerometer figured out, but I don't know where to go for there. I was trying to find a good source of information on the subject and haven't really found one. Any additional help would be appreciated.
Thanks,
Dietrich
I can only presume you didn't check the Parallax web site for such information. Below is a link to the Memsic Two Axis Accelerometer which Parallax sells. Along with the data sheet and other pertinent documents, you will also find sample programs. That should at least get you started.
Here is the Parallax web site link:
http://www.parallax.com/Store/Sensors/AccelerationTilt/tabid/172/CategoryID/47/List/0/Level/a/ProductID/93/Default.aspx?SortField=ProductName,ProductName
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/List/1/ProductID/418/Default.aspx?txtSearch=Smart+Sensors+and+Applications&SortField=ProductName%2cProductName
You can probably modify the first example program in Chapter 3 (SimpleTilt.bs2) with an IF...THEN statement to get your project to work on one axis. For example, if you have an LED circuit connected to i/o pin P14 on the BASIC Stamp 2, you could simply add this IF...THEN statement:
IF x > 2475 and x < 2525 THEN HIGH 14 ELSE LOW 14
This will give you a level indicator light for the accelerometer's x-axis. You can add another LED circuit and a similar IF...THEN statement for the y-axis too.
BTW, chapters 5 and 6 have lots more entertaining and useful Memsic 2125 accelerometer applications.
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
If I were to want to design this level and light system without the BASIC stamp module (for size purposes) how should I approach that. Is there some sort of processor that I would need to get, or simply some sort of relay that would read the output from the accelerometer. Again, I have never done any of this and am trying to gain a better understanding of how the system works.
Thanks for all of the help.
http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/ProductID/364/List/1/Default.aspx?SortField=ProductName,ProductName
For gaining an initial understanding of automating an invention with a processor and electronics, a good starting point for BASIC Stamps is the BASIC Stamp Activity Kit:
http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/List/1/ProductID/313/Default.aspx?txtSearch=BASIC+Stamp+Activity+Kit&SortField=ProductName%2cProductName
The BASIC Stamp Activity Kit has lots of examples on how to combine circuits with the BASIC Stamp Microcontroller and some programming to prototype products.· Hands-on examples that you get to try include: controlling LEDs indicator lights, monitoring pushbuttons, controlling servos, monitoring dials, making tones with speakers, simple LED digit displays, monitoring light sensors, controlling integrated circuits... It's also really nice to·get started, and it makes the SX Tech Toolkit more familiar territory.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 12/28/2007 1:00:51 AM GMT
' {$STAMP BS2}
' {$PBASIC 2.0}
'simpletilt2.bs2
'measure tilt
x VAR Word
MAIN:
DO
PULSIN 8, 1, X
DEBUG CLS, ? X
PAUSE 100
IF (X > 2475) AND (X < 2525)THEN
HIGH 14
ELSE
LOW 14
LOOP
-Phil