Mindsensors was kind of enough to send me one of their prototype sensors, the Power Meter, to play with. It’s a sensor that allows you to measure, among other things, the current and voltage of anything you care to connect to it (within limits, of course).
The first thing that came to mind was building something that would log the incoming data to an Excel sheet using the NXT HID, but then Andy M scooped me on that so I had to come up with something else (damn you, Andy!). Then it hit me! Why not make an oscilloscope? So without further ado I started programming. This is what I came up with.
The result is quite nice, I must say. Right now it takes a sample every couple of milliseconds and refreshes the screen every 20 milliseconds. There are five scales for each unit (amps and volts), to cover the full range of the sensor (up to 13V5 and up to 3A). You can switch between ranges using the arrow keys and between units using the enter key. This program, together with the driver will be available with the next release of the 3rd Party Driver Suite.
Things I’d like to implement at some point is data recording, zooming and manual scrolling of the screen. I had the manual scrolling implemented at one point but ditched it for the cardiogram-look instead.
Another cool project using the Power Meter sensor can be found here: [LINK].
OK, now I’m really confused. Using the version of RobotC you provided me, (via link, you didn’t send me any files,) as I have mentioned, the NXT firmware animates the menus, and allows RobotC programs to search the file system and search for I2C devices. I couldn’t veiw the screen properly using BricxCC’s NXT screen, although I didn’t specify any firmware, which I think I’ll try soon after I post this. Can you please send a screenshot of your NXT’s system information (under options). (I couldn’t figure out how to make “please” appear in italics. Please accept this as the emphisis on “please”.) Once I have your firmware information, I’ll send you mine, and maybe we could send each other the versions we are using. And updates, I’m way behind on updates.
Now if only I could figure out how to make an osciloscope. It would help me figure out how to make “harmonics” on a tone generator. “Harmonics” in quotes because I’m not really using true harmonics, just emulating them.
Just download the official version (2.0.1 as of writing this) from the ROBOTC website: http://www.robotc.net/
[…] This article first appeared here. […]
Hi Xander,
I saw your website link from minsensor’s power meter web page. your
project looks pretty interesting. I just started using power meter for
my school project and if you do not mind I have a technical question
about how you managed to read data from power meter. I have donwloaded
mindsensor sample power meter Lego program and used it. it shows a
voltage value but current value is jumping any values from 6 to 50
very fast, power value is always zero. I was wondering if you can let
me know how you managed to accurately read data from power meter
sensor. I am attaching a picture of my setup, it is very simple just
to read some values from the sensor. Did you have to change any I2C
registers on the power meter sensor?
Thanks, I really appreciate your help.
John
Hi John,
Where’s the image of your setup? I didn’t have to change anything on the meter to make it work. My guess is your configuration might be a bit off 🙂 Did you have a look at the circuit I used? Does your power meter exhibit the same behaviour when configured like that?
– Xander
[…] may try to combine this with their Power Meter Sensor to add a whole new dimension to my previous NXT Oscilloscope. Some other […]