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

LPF Donation via Stripe | LPF Donation - Other Methods

Links below open in new window

ArcticMyst Security by Avery

Convert Voltage to Computer Input

Joined
Jan 14, 2011
Messages
3,816
Points
63
Hey everyone.

So I am thinking of improving my home-built LPM into a data-recording LPM. The problem, right now, however, is that I have no idea how to go about getting the voltage output from my TEC (that currently goes to a panel display) to a computer, via USB port. I have never been good at creating computer interfaces (read: I have attempted to learn briefly, and epicly failed).

So here is where I am asking all of you hardware/software geniuses out there to point me in the right direction so I can figure this out, or just spoon feed me, either way :p

And just so everyone is aware - I would have done a lot of googling and probably never end up even asking here, but I don't even know what to search, for starters!

So does anyone know of a nice tutorial online where I can learn about basic analog-to-digital conversion and then USB integration and what not? I know Java, so handling the input data, once it's in a file on the computer, wouldn't be a problem. Except maybe... how would I go about telling the LPM to start recording via the computer?

The idea is to make a program that, with a computer key, will start recording data and then, with another, stop recording data, plot it, do analyses, etc.

I am good on the software side, it's just getting the message to and from the LPM that I am so confused about.

Anyway, thanks everyone for your help! Appreciate it.
 





Trevor

0
Joined
Jul 17, 2009
Messages
4,386
Points
113
If you get an Arduino, I'll give you the source code (and a copy of Luminosity) to do it. :p

-Trevor
 
Last edited:
Joined
Jun 12, 2011
Messages
292
Points
0
Like trev said an arduino will work, but really any 8-bit microcontroller with a ADC (Analog to Digital Converter) and a UART (Universal Asynchronous Receive and Transmit) and a UART to USb chip, or possibly a ADC chip that outputs uart and a Uart to USB chip, the easier method is a micro with ADC and UART.
 
Joined
Jan 14, 2011
Messages
3,816
Points
63
I appreciate that, but that's no fun! I mean, I may end up doing that, but the idea is to build the circuit myself. The circuit doesn't have to do all the work, it just needs to create a datafile that I can dig through with a piece of java software.

Anyway, I am not that familiar with Arduinos. Only ever heard of them - never really explored them or anything. I may consider it though... how much $$$ are we talking here?

EDIT: I will start exploring microcontrollers, ADCs, and UARTs! Thanks, Kmor!

EDIT 2: So, just from starting out, it looks like I am going to need at least 12-bit ADC, I think, because I am going to want >2000 levels, meaning 2^12. Right?
 
Last edited:
Joined
Jun 12, 2011
Messages
292
Points
0
No problem, You can get an arduino uno for $30 I think, and its programmed in C, and they have an ENORMOUS user base with knowledge, community, and easy to use commands something like:

Setup{
Serial.Baud(9600);
}

Main{
Serial.println(AnalogRead(A0), DEC);
}

Thats all the code.....actually theres a demo code with the software that does just that reads the ADC and serial prints it to a hyperterminal window included with the arduino IDE.
 
Joined
Jan 14, 2011
Messages
3,816
Points
63
Well then, that's not that bad. I suppose I will continue to do research on ADCs and UARTs, even if I do end up getting an arduino, because it would be useful to have that knowledge. And actually... I may end up getting an arduino.

But how does it work exactly? You write a program on your computer, hook it up to your arduino, and then the arduino works the code? So would I be able to integrate buttons on my computer to change inputs, etc.?
 
Joined
Jun 12, 2011
Messages
292
Points
0
Correct you write up some code on pc in the IDE, connect the arduino to the pc and click program. Yep the program is just there to tell the chip how you would like it to function. Yes, if you wanted to make some sort of app for the pc that sends out a serial command like "measure" and have it measure something you can, or you can do some of that functionality with physical parts, press a button to start measuring, or switch modes, theres a lot you can do with micro-controllers.
 
Joined
Jan 14, 2011
Messages
3,816
Points
63
Well, you've convinced me. I'mma get an arduino. Once I get my paycheck. And a yellow laser.
 

chefla

0
Joined
Mar 24, 2011
Messages
169
Points
18
A cheap alternative to the Arduinos is TIs Launch Pad. It is only $4.30, has a USB interface and comes with two MSP430 microcontrollers, software, cables.. basically all that is needed to get you started.
One of the included units has a 10 bit ADC. It should be easy to find a programm for dowload that is sampling the ADC and pushing the data on the USB bus. Go to the Texas Instruments website and look for MSP Lauch Pad. The launch pad came out last year IIRC, so the community is not as big as for the arduino but you should already find enough information online to get your project done.
 
Joined
Jan 14, 2011
Messages
3,816
Points
63
Hey, thanks for that! I will take a look into it - looks like exactly what I need.
 

chefla

0
Joined
Mar 24, 2011
Messages
169
Points
18
If you want it tiny check the MSP430 USB Stick Development Tool out. It is $10 and has a tiny F2013 chip on a detachable board. This baby has a 16 bit ADC onboard and is a nice alternative to the Lauch Pad. Good luck with your project!
 
Joined
Sep 20, 2008
Messages
17,622
Points
113
So, just from starting out, it looks like I am going to need at least 12-bit ADC, I think, because I am going to want >2000 levels, meaning 2^12. Right?

10 Bit = 1024
11 Bit = 2048
12 bit = 4096

;)

Jerry
 

chefla

0
Joined
Mar 24, 2011
Messages
169
Points
18
Hey Jerry, just because I am curious, which ADC resolution are you using in your laserbees? Or is that piece of information top secret like your secret coating? :rolleyes:
 
Joined
Sep 20, 2008
Messages
17,622
Points
113
It depends on which model of LaserBee you are
referring to...

Jerry
 
Joined
Jan 14, 2011
Messages
3,816
Points
63
The reason I said 12-bit is because I assumed 11-bit isn't made, right?
 




Top