Welcome to Laser Pointer Forums - discuss green laser pointers, blue laser pointers, and all types of lasers

Buy Site Supporter Role (remove some ads) | LPF Donations

Links below open in new window

FrozenGate by Avery

OpenLPM - The free, open-source LPM project!

Trevor

0
Joined
Jul 17, 2009
Messages
4,386
Points
113
gdqYc.png
Mk. I

I've put in a lot of work over the last couple weeks to get OpenLPM Mk. I into a releasable, beta format. The goal of this project is to provide - free of charge - laser power meter firmware and circuit designs licensed under the GNU GPL v3. I hope that this will allow more people to create better laser power meters for less money (both in development costs and final cost to the consumer). I hope that at least a few people base a project on OpenLPM and enter the market with it.

Features
  • OpenLPM is free and open-source.
  • It is a developer's platform. Anything that the user of OpenLPM wants to modify can be modified - be it in the configuration files or in the source itself.
  • Right out of the box, it offers a high level of configurability and adaptability for diverse applications.
  • Compatible with all currently available LPM datalogging software!
  • Designed to run on open-source hardware, but can be adapted to run on a standalone microcontroller.

The Benefits

OpenLPM gives you the flexibility to add highly configurable datalogging to any laser power meter. So, you can take your Radiant Alpha, LaserBee A, LaserBee 5W, original Kenometer, whatever – and allow USB connectivity to the PC for ONLY the cost of an Arduino (or a stripped-down ATMega328 circuit!). Then you can use a datalogging program like Luminosity, EagleEye, StampPlot Pro, or one of the many other available programs.

All you’d have to do is hook up power and ground to the Arduino then run your signal voltage into your configured pin. Then you just need to put a small hole in your enclosure and mount the Arduino so that the USB port is accessible.

Moreover, OpenLPM could be integrated into a brand new LPM that you’ve developed – adding high-value datalogging capability without the cost of developing it.

That’s $35… or less!

Even more importantly, OpenLPM is free and open-source. You can download the source code for no cost for modification to suit your needs. The fact that it is open-source allows OpenLPM to both be highly customizable and be used as a learning tool – with the added benefit of more than one developer contributing to the progress of the project.

What You Need

Getting Started

Download OpenLPM and extract the files to whatever location you see fit. Also download and extract the Arduino development environment. Install the drivers as instructed on their respective download pages.

Now you’re ready to dive into the project!

Configuration


Start the Arduino IDE and open up the file titled “OpenLPM_Mk_I.ino.” This will bring up the entire project. You will see three tabs:
  • OpenLPM_Mk_I – This contains all of the configuration options for OpenLPM.
  • VALIDATION – Don’t modify this. This file contains checks on the configuration options. This file protects your solution from known issues when deployed – such as variable overflow.
  • main – This tab contains all the source code.
For now, we’ll focus on the first tab. There are a number of options available to you:
  • OVERSAMPLE – The number of samples to take per reading output. The Arduino has an effective limit of 10,000 samples per second. The more you oversample, the better resolution you’ll generally get. 1024 is a pretty good value in terms of balance between resolution and sample rate.
  • BAUD – The baud rate for RS232 communication. Default is 9600, but settings up to 115200 are supported.
  • REFERENCE_OVERRIDE – This is for overriding the Arduino’s standard voltage reference (and OpenLPM’s autoranging) with an external voltage reference. Making a mistake with external voltage reference can damage your board. Required reading: Arduino - AnalogReference
  • Vref – If you’re using an external voltage reference, set its value here in millivolts. If you are using the internal reference, then just leaving this at 1100 is fine.
  • VoltsPerWatt – The output of your sensor, in volts per watt. The surplus Ophir heads output 1V/W. However, particularly high or low power systems could vary.
  • SENSOR – The analog pin to which your signal will be fed. Default is 1, but any analog pin on the Arduino will work.
  • BUFFER_SIZE – This is the defined buffer size for all the buffers that are used in OpenLPM. This value is conservatively set at 64 and should never need to change, but it’s here for standardization purposes and to ease the modification of OpenLPM.
  • STREAM_MODE – The method used for formatting the output of OpenLPM. If this is set to 0, the standard output format will be used (1234.56\n). If this is set to 1, the custom format will be used.
  • DATASTREAM_FORMAT – User-defined custom datastream formatting. The whole number component of the readings is “$w” and the fractional value is “$f.” For example, the format that is used by default would be defined as “$w.$f\n” for compatibility with most programs. By using this setting, you can make your solution compatible with any datalogger available as long as it does not use a handshake. So, if you have purchased any other laser power meter, you would be able to used its bundled logging software with your custom LPM.
  • PRECISION – The number of decimal places to display. Up to 6 are supported (8 if you really want to, but you’ll have to change the config validation), but any more than 1 or 2 will just make your datastream look messy and not give you any meaningful data.
  • EU – If this setting is set to 1, then a “,” will be used instead of a “.” In the default datastream format.

Uploading

Once you’ve configured it to your liking, now you can compile and upload. First, drop down the “Tools” menu and click the “Board” option. Choose the board you are using from the menu. You will most likely be using an Uno or a Nano with an ATMega828 – these are the first two options. After doing that, select “Serial Port” from the “Tools” menu and choose the proper serial port that your Arduino is residing on. Once you do that, drop down the “File” menu and select “Upload to I/O Board” (or click the upload button at the top of the IDE).

After you upload, go to the “Tools” menu and choose the “Serial Monitor” option. Ensure that the proper baud rate is chosen, and confirm that your Arduino is streaming data as you expected.

Application

Once you’ve got your Arduino with OpenLPM flashed onto it, then you can drop it into your circuit. Just make sure you’re running the signal voltage from your sensor circuit into the right Arduino pin and that you’re powering it according to the pages found on arduino.cc.

Recommended Hardware

I recommend getting first-party hardware for OpenLPM. There are knockoff Arduinos on eBay from Chinese sources for ~$10, but the quality is questionable and I personally stay away from them.

  • Arduino Nano - Excellent form factor, though there is a potential power issue that I'm waiting to hear back from Gravitech about.
  • Arduino Uno - The standard form factor Arduino.

To Do
  • Modify a version of Luminosity to serve as a default datalogger for OpenLPM.
  • Add an option for setting voltage reference in case of USB-only power.
  • Photograph, diagram, and upload information on my sample OpenLPM circuit.

Known Issues
  • When powering from USB, the voltage reference will sag, skewing readings high. When possible, be sure to power through the Vin pin with 6-12V or with a 5V regulated supply via the 5V pin.
  • When using external power, if the device is then connected to USB, Windows will sometimes will flag the USB device as malfunctioning. This is a known issue with the Arduino Nano, and I am currently waiting to hear back from Gravitech regarding a fix.

Licensing

OpenLPM is under the GNU GPLv3. The simple English version of Wikipedia gives a rather nice, concise explanation of what this license means.
There are two main terms to the license. Both apply to giving the program away or selling it.
  • A copy of the source code or written instructions about how to get a copy must be included with the software. If the software is able to be downloaded from the internet, the source code must also be available for downloading.
  • The license of the software cannot be changed or removed. It must always use the GPL.
If the user does not agree to follow the GPL, they can still use the software under copyright laws. They can use it and make copies or changes to it for themselves, but they cannot give it away or sell it. They also cannot change the license.
So, even if you’re giving it away a modified copy of OpenLPM, the recipient must be given the source code or instructions on where to download it – and it also must carry the GPL license.

If you’re selling a product, any recipient of the product must be given the source code, because a compiled binary must always be accompanied by its source code.

Any derivative of OpenLPM must be under GNU GPLv3.

This licensing model is extremely important to the goal of OpenLPM. There are three main goals here:
  • Give hobbyists access to a DIY datalogging LPM for only the cost of hardware.
  • Remove a barrier to entry (programming) to the hobbyist LPM market in an effort to turn it into more of a buyers’ market.
  • Give interested parties a laser-related embedded source so that they can go on to develop a brand new, advanced hobbyist LPM.

OpenLPM being under GNU GPLv3 goes a long way toward achieving these goals.

Downloads

Current version: 1.0.2.1
BETA version: 2.1.1.5B

Support

I am currently paying for all of the costs of this project out-of-pocket. If you'd like to support the ongoing development of OpenLPM monetarily, I very much appreciate the support.



Supporters
  • Me!
  • ddewees
  • lazeerer
  • rhd
  • netwave
  • tsteele93
  • ARGLaser

Conclusion

I’m really excited to see where this goes. I know at least a couple people are excited to work with it; I’m hoping we start to see OpenLPM-compatible hardware start to crop up.

I’ll be personally supporting this project and am happy to help anyone who needs help with the code.

Criticism and changes from outside developers are welcome – collaboration is one of the readings this project is open-source.

And there's my 3,000th post. Happy building!

-Trevor
 
Last edited:





Changelog

  • 0.9.3.0
    • Initial Release
  • 1.0.2.1
    • Fixed a bug that caused reading inaccuracy when a reading hovers at the autoranging threshold.
    • Added a 7ms delay after a reference voltage shift to account for rise and fall time.
    • OpenLPM now discards the first reading after a reference voltage change.
    • Updated the autoranging thresholds. When rising, the reference voltage changes at 1V. When falling, it shifts at 950mV. This prevents the 7ms delay from slowing down sampling, and prevents repeated changes when the reading hovers at one of the thresholds.
  • 2.1.1.5
    • Added support for ALL current Arduino boards.
    • Added support for an external ADC.
    • Added support for a customizable curve adjustment.
    • Added a feature that will, in the future, add support for third-party sensors such as the LaserBee sensors.
    • Added automatic error checking at compile time, to help ensure OpenLPM will behave as expected.

Trevor
 
Last edited:
ill reserve the third for when i finally have time to post the results of me playing with a teensy and a high res adc.
Love this project if i only had the time.
 
I thought you gave up on this project.. glad to see you are back on it.

Just to clarify.... our LaserBee 5W Laser Power Meter already
comes with our Eagle Eye™ Data Logging feature and our
DL2-Module™ is already programed and bundled with the
Eagle Eye™ Data Logging Software.
It can be added to all those other LPMs you quoted above for
persons that don't have the knowledge or ability to roll their own..

I’m hoping we start to see OpenLPM-compatible hardware start to crop up.

-Trevor

I read recently that MarioMaster has discontinued the Alpha...

http://laserpointerforums.com/f44/question-about-lpm-power-graphs-71147.html#post1025424

Maybe contact him for that hardware...


Jerry
(11400-433-38454)

You can contact us at any time on our Website: J.BAUER Electronics
 
Last edited:
Never gave up on the project - but life did get too busy for me to participate on this forum much at all or work too much on OpenLPM.

Well, OpenLPM is actually already fully compatible with your products, should one of your existing users wish it to be. :)

I'm also perfectly willing to flash and ship people Arduinos with OpenLPM configured and installed - and I have - if they don't have the toolchain to use it.

Trevor
 
Last edited:
This is an EXCELLENT project! count me in!
Also a Linux and MacOSX version could also be a good idea as well.
OpenSource is the way to go!
 
So I uploaded the program onto my Arduino Uno R3.
I can monitor the output with the serial monitor,

but when i try running eagle eye it says no signal.

and when i try connecting the meter to luminosity i get
connecting please wait
and then
Device on COM11 is not responding. Please try again in a moment or try a different port

Im using 64bit windows could that be an issue?
or am I just doing somthing wrong
 
Last edited:
Luminosity requires a handshake to work - I've got a handshhakeless updated version on a back burner here somewhere... I'll try to dig that up and get it finished.

Fortunately, you've bought and paid for a LaserBee so you have right to EagleEye. To log to the EagleEye software, you'll need to use custom formatting. In the configuration file, set STREAM_MODE to 1, and DATASTREAM_FORMAT to "\r$w,$w\n" (per the information in this thread).

Since you're doing that, I'd recommend setting PRECISION to 0 and OVERSAMPLE to a lower value, so you get faster readings.

Trevor
 
Awesome, :D
EagleEye seems to be working now,
Currently I’m just using my lab power supply as an input.
(Don’t have an lpm to hook it up to yet)

Is Luminosity free software?
I found an old link to it on the form, but the link was dead, here
But I found it on your new site in the same place.

Thanks, Justin

Edit:
what would you recommend for OVERSAMPLE like half?
 
Last edited:
Luminosity was originally designed for the Kenometer Pro/USB project, and was negotiated as exclusive.

The open-source version is going to be better built and more powerful - I just have to finish it... ><

Regarding an oversample value... I'd give 256 a whirl. Since EagleEye only accepts whole numbers, it's pointless to oversample beyond that point. This is especially important when you're using something like an Ophir sensor that responds extremely quickly.

Trevor
 
Great project!
Now we just need multiple coders to keep updating the project.
Things are looking good!
I am going to try again to mod peregrine,now that I found my software
Solution.
 
Updated to version 1.0.2.1. See changelog for details, and the OP for a download link.

Trevor
 
The UNO that you are linking to in the OP is listed as "retired" at sparkfun. They suggest this as a replacement...

Arduino Uno - R3 - SparkFun Electronics

Is that what you would recommend?

Also, this is a really small version and cheap too... Would it be ok?

Arduino Pro Mini 328 - 5V/16MHz

Yep, that new Uno will work too. :)

I'd honestly recommend a Nano, just because it will fit in such small spaces. The Pro kind of loses something without the USB port on it.

And thanks for your donation. :)

Trevor
 
Did that board the RHD was making in the other thread ever make it to production or are the eagle files / Parts list available? That looked like a great addition.
 
Any updates on a free data logging LPM program?
StampPlot Pro is useable, but not the same as a real LPM program.

To Do

[*] Modify a version of Luminosity to serve as a default datalogger for OpenLPM.

Luminosity requires a handshake to work - I've got a handshhakeless updated version on a back burner here somewhere... I'll try to dig that up and get it finished.

The open-source version is going to be better built and more powerful - I just have to finish it... ><
 


Back
Top