Wirelessly viewing an oscilloscope waveform??  HELP!!! - Page 1
Forum section: electronics / general

author: Gearbreaker
author_rank: Contributor
timestamp: October 01, 2010, 07:57:06 pm
content: Hi all... I have a situation where I need to occasionally record four data channels (PIC logic digital waveforms) on a motorcycle as it is ridden, much like the way Formula 1 cars are monitored with telemetry while on the track. I can have a chase car available to record the data if necessary. It seems to me that one way to achieve this is to wirelessly run a four channel Ethernet capable "virtual" scope such as the scopein@box and pick up the signals with a laptop in the chase car. However, it seems that there has to be a better and less expensive way. I have a laptop with wireless ethernet in the chase car already but the difficult part is to beam the scope patterns from the motorbike. I don't mind buying an LCD scope to achieve the result because it can be used on the bench later (whereas the scopein@box would be nearly useless 364 & 1/2 days per year). The preferred alternative is to monitor the waveforms on the bike and record them onboard while the bike is in operation. I only need to record the four data channels for about 20 or 30 seconds. A small scope and some kind of recording device may better fit the bill but I am at a loss as to what kinds of hardware I could use to record the waveforms for this length of time. The Rigol 1052D is not too big to be fitted to the bike and it is relatively inexpensive but can it send data out to somehow be recorded? Any and all help is more than appreciated. Chris.

author: scrat
author_rank: Frequent Contributor
timestamp: October 01, 2010, 08:13:04 pm
content: The issue needs to be explained a little more in detail...Please correct me if I am wrong:- you need to only RECORD 4 bit data for 20-30 seconds, but not to see the data in real-time.Can you wait for stopping the motorbike, connect a PC to a board on it, and then download the data, or do you need the data while the bike is still running?- at which rate do you have to sample that 4 bits? OR, alternative question: Which is the fastest rate they're changing?I think these are the basic data required to start to consider any solutions. If the need is for storing data at a low rate, there could be some simple solutions.Quote from: Gearbreaker on October 01, 2010, 07:57:06 pmEven if it physically fits on it, the Rigol scope has to be connected to a mains plug, which is usually hard to find on a motorbike

author: JohnS_AZ
author_rank: Frequent Contributor
timestamp: October 01, 2010, 08:16:24 pm
content: I think he might be talking 4 PWM channels, but you're right. Need some more information.

author: Gearbreaker
author_rank: Contributor
timestamp: October 01, 2010, 08:37:33 pm
content: Yes, John S has hit it. There are actually three PWM channels coming from the PIC that regulate various functions on the motorbike. The fourth is a master input clock that also needs to be monitored. All four data channels need to be observed to see what their relative timing is at different speeds. Onto the further clarification.....The minimum frequency to be monitored is around 10Hz and the maximum is around 30Khz. The signals are all 5 volt square waves. What I need to see is the relative timing of all during various input frequencies so that I can adjust the code in the PIC to taylor the code to the application.It is not necessary to monitor (see) the data while the motorbike is in operation. It is only necessary to record it while various tests are run at different speeds. It would be preferred to only record and not monitor while on the bike for obvious reasons.However, the data needs to be viewed in real time after the "run" is recorded. Yes, the data can be read or downloaded after the bike has been test run and pulled into the shop.If necessary, I can set up an inverter to obtain mains voltage on the bike unless the scope uses the accuracy of the line frequency for it's own timing. However, I think this is unlikely.Put your thinkin' caps on..... I think I burned mine out. Thank you again. Chris.Quote from: scrat on October 01, 2010, 08:13:04 pm

author: djsb
author_rank: Super Contributor
timestamp: October 01, 2010, 08:41:09 pm
content: I have some questions.1/ Are the signals purely digital and if so what voltage level,frequency and period are they?2/ What is the sampling frequency of each channel and how often are the channels sampled?3/ Does the waveform have to be recorded in real time or can it be sampled at set intervals?Maybe the data could be stored onto an SD card as ASCII text. It could then be replayed on a PC and the data points interpolated in some way. You'd obviously have to write an application for this or use a spreadsheet.

author: Gearbreaker
author_rank: Contributor
timestamp: October 01, 2010, 08:49:45 pm
content: Yes, the signals are pure digital 5 volt square waves.The low frequency is about 10Hz and high is about 30Khz. It is a constant wave on all four channels.There is something flakey happening in the motorbikes electronics as the frequency increases. In reality it is happening above 80Hz but it would be nice to record what is happening with the frequencies that are running correctly between 10 and 79Hz as the frequency as well.I hope this relieves some of the confusion about my twisted question and doesn't add to it! Thanks again. Chris.Quote from: djsb on October 01, 2010, 08:41:09 pm

author: JohnS_AZ
author_rank: Frequent Contributor
timestamp: October 01, 2010, 08:51:52 pm
content: Just for giggles, here's how the "big boys" do it. (I was a Teac sales rep briefly)http://www.teac.com/instrumentation_data_recorders/instrumentation_data_recorders/gx-1/But I don't imagine that you're ready to drop +$30K on your project.Are you willing to build something, or are you looking to buy something off the shelf?

author: Gearbreaker
author_rank: Contributor
timestamp: October 01, 2010, 08:52:12 pm
content: oops...Left one thing out.... Sampling isn't really an option because of the hit or miss problem that the bike is experiencing. thx. Chris.Quote from: djsb on October 01, 2010, 08:41:09 pm

author: Gearbreaker
author_rank: Contributor
timestamp: October 01, 2010, 08:56:59 pm
content: Thanks for the link... I'll check it out and see what I would buy if I won the lottery.I am willing to build anything I need to but I am just learning to write code so it may be difficult for me if that is part of what would need to be built.Soldering irons up..... now get ready for correction. Thanks again. Chris.Quote from: JohnS_AZ on October 01, 2010, 08:51:52 pm

author: djsb
author_rank: Super Contributor
timestamp: October 01, 2010, 09:03:23 pm
content: Are you monitoring the input to fuel injectors by any chance. I'm interested as I own motorcycles myself I'm curious.

author: Gearbreaker
author_rank: Contributor
timestamp: October 01, 2010, 09:09:11 pm
content: David,Actually in this case it is the braking system that I am working on but the injector project will be coming up after the braking bugs are shaken out. Chris.Quote from: djsb on October 01, 2010, 09:03:23 pm

author: JohnS_AZ
author_rank: Frequent Contributor
timestamp: October 01, 2010, 09:14:47 pm
content: Well, off the top of my head ....Forget about doing anything wireless. That would over complicate the hell out of everything.One approach would be to build a circuit to convert the PWM to an analog voltage (an integrator) You could then measure the analog voltage with a PIC or Arduino or whatever, and write the data out to a flash (http://futurlec.com/Mini_FLASH.shtml). The BIG problem with this is that if your problem is glitch related, or due to some leading/trailing edge problems between the PWM streams, you'll never see it this way.Actually, (as much as Dave hates them) this might be a good job for a USB scope pod and a netbook.

author: TheDirty
author_rank: Frequent Contributor
timestamp: October 01, 2010, 09:19:04 pm
content: I still don't understand. This seems like a trivial job for a basic datalogger with any microcontroller and some flash memory. Logging 4 PWM signals and timing at these frequencies would take nothing out of it.

author: Gearbreaker
author_rank: Contributor
timestamp: October 01, 2010, 09:28:04 pm
content: John,That flash board looks like a step in the right direction but would it be simpler to capture data directly a laptop or would the I/O be too slow on the laptop? The fact that the flash board is non volatile is a big plus in its favor.Unfortunately, the problem is glitch related. It seems that when certain frequencies are being emulated by the pic something is going astray. If I didn't know any better I would say that certain frequencies are beating with one another and causing a resonance. Perhaps it is some kind of crosstalk. I first thought it was a voltage regulation problem but after much filtering tests and power supply modification the system still exhibits the same problem. It just may be a leading edge hitting exactly on a trailing edge of vice-versa but without a recorder it is impossible to tell.When you say "Scope pod" do you mean something like a USB to laptop scope? Looked kinda' scary when I saw the Chinese are selling them for fifty bucks.Keep smilin' it makes everyone think you're nuts. Chris.Quote from: JohnS_AZ on October 01, 2010, 09:14:47 pm

author: Gearbreaker
author_rank: Contributor
timestamp: October 01, 2010, 09:35:54 pm
content: Mark,I appreciate your input. I should qualify that I am rather new at this kind of thing but I do have a lot of enthusiasm to learn. If you can suggest a particular setup I can do some research and see if I can figure out how to cobble it up. My biggest issue is writing code. I am still pretty new at it but by throwing myself into the fire I can learn in a hurry.Please keep in mind that I first got on the track of using a laptop based "scope" to record because of its simplicity and I was hoping that it would be a plug and play sort of thing.I may be dumb but I'm not stupid! Chris.Quote from: TheDirty on October 01, 2010, 09:19:04 pm

author: JohnS_AZ
author_rank: Frequent Contributor
timestamp: October 01, 2010, 09:39:35 pm
content: Honestly, if *I* were going to tackle this problem, I get the best 4 channel DSO I could lay my hands on, and rent a few hours on a dyno someplace. A lot of speed shops have them these days. The you could see what's happening in actual real-time, as well as record the data for later analysis.Well, if you build something that will take the 4 streams and pipe them right into the netbook or laptop, you are in essence BUILDING a 4 channel USB scope. :-)

author: Zad
author_rank: Super Contributor
timestamp: October 01, 2010, 09:59:09 pm
content: Old laptop with a parallel port capable of I/O, hack together some software. Sorted. As it is only a few hundred data items then you could always use a standard microcontroller and store it to battery backed ram and squirt it down a serial link later on. If you want to go really basic, you could put a tone generator on each input, and record the audio on tape/mp3/whatever.

author: Gearbreaker
author_rank: Contributor
timestamp: October 01, 2010, 10:03:40 pm
content: John,Good thought regarding the dyno, I'll have to check into it.Rigol does have a four channel which may be a contender but they also have a two channel with a 16 channel data "D" option (DS1102D). I have no idea if the 16 channel data version splits the memory between all 16 channels and burns it up quicker or if I'd be better off with the dedicated four channel version (DS1104B). Either way, I am not sure how long these scopes record. Do you or does anyone have any idea how to convert the memory rating into real time?Thank you again to all that have been helping. I am learning more than I had ever imagined. Chris.Quote from: JohnS_AZ on October 01, 2010, 09:39:35 pm

author: scrat
author_rank: Frequent Contributor
timestamp: October 01, 2010, 10:08:41 pm
content: I interrupted my replying when there were 2 answers, just one hour ago and now... 11 replies!So, sorry if my post is out of place, or some things were already said...You said the max frequency is around 30kHz (don't know if it is the fastest "bitrate" or the highest analog bandwidth required).To go whole hog, the minimum sampling should be at least 60kHz, let's assume 100kHz. To monitor 4 bits/sample it means 50kB/s, resulting in 1MB for 20 seconds and 1.5MB for 30 seconds. For such a sampling frequency, I think that also a PIC will do the job. At each cycle it has to read, store the nibble to the upper/lower nibble of the register, write to memory and increment the address. If a fast PIC is choosen, running at 48MHz it will do 12MIPS, so there could be 12M/100k = 120 instructions/sampling period.Memory becomes the issue, since MCUs are usually not equipped with that amount of memory. Even if a non-volatile memory would be better (SD card, for example), one easy way could be to use an external (parallel) RAM, and to maintain the board under a backup battery supply.Then, an USB or RS-232 interface to PC will do the rest.

author: Gearbreaker
author_rank: Contributor
timestamp: October 01, 2010, 10:22:30 pm
content: Wow, I'm trying to absorb all of this but on the surface it does make sense to me. The timing and memory usage info is helpful and certainly what I am having the most difficulty with. But if you look above at my post above regarding storage scopes, can I assume a scope with 1 meg of storage will do the trick? (If I were to spend the $1200 for the scope)However, I really would love to put your idea into form and learn a few things in the process. It certainly would be more inexpensive.The more I am learning, the more confused I am becoming! Chris.Quote from: scrat on October 01, 2010, 10:08:41 pm

author: AvrFan65
author_rank: Newbie
timestamp: October 01, 2010, 10:34:02 pm
content: HiIf you are trying to capture a glitch or are looking at edge to egde timing problems, you need a much higer sample rate than just 2 or 3 times the pulse frequency.Jan

author: scrat
author_rank: Frequent Contributor
timestamp: October 01, 2010, 10:43:36 pm
content: Quote from: AvrFan65 on October 01, 2010, 10:34:02 pmYou're right, I was making a wrong supposition, based on no knowledge about the issue to find.Another way to do the job (but I think, less reliable) could be a real-time "analysis" made by the MCU on-board. Timing or other kind of errors could be detected and recorded. If the problem in the system under test is simple, this could be a solution to find it, otherwise it is only a strange idea

author: TheDirty
author_rank: Frequent Contributor
timestamp: October 02, 2010, 12:45:04 am
content: You certainly don't need a scope for this. If you are able to run on a dyno or if you need specific load, a load cell dyno, that parallel port hack would work. If you could get a laptop with a hardware parallel port, that would work.Thinking in terms of 'sampling rate' with a microcontroller solution isn't the right approach. I simple 16 bit timer and some input triggers would capture everything without using up even 1% of its processing cycles and technically the same sample rate as the clock rate. The hardest part would be just write out to any EEPROM or Flash. I've never used one, but I imagine you could do it pretty easily with an Arduino and some type of SD Card shield.It sounds like a plug and play solution is what is being looked for here. This is simple on/off data, so a logic analyzer would work here. Something like the Saleae, or there's that open source one, the Open Logic Sniffer.Unfortunately almost all automotive specific data loggers measure duty cycle or frequency, but I think you are looking for a higher resolution datalog. Something that will show precise on and off times relative to the other channels.If not, the Innovate DL-32 is a good on-board datalogger.http://www.innovatemotorsports.com/products/dl_32.php

author: Gearbreaker
author_rank: Contributor
timestamp: October 02, 2010, 03:16:20 am
content: Mark,Thank you for the input. I had to walk away from the computer for a few hours and just came back. After checking into everyones suggestions, I think I am going to pursue the Saleae. I have been leading myself and everyone on this forum down the scope road and never even thought about a dedicated logic analyzer. My bad.I am actually not measuring any engine parameters, it is a propritary braking system that I am developing.This project is one of many to come and if I need to invest $150 for the Saleae I don't mind. It is pretty universal and the idea that it is plug and play for my application is perfect. Also, a logic analyzer isn't a bad thing to own. Sure I could cobble something up but the time and aggravation should make the pre-built Saleae worth buying. I have been hesitant to commit to a dyno because there will be many code variations with this project as well as the next five projects. There is also something to be said for real world "on the road" testing too. I believe you are correct on many counts.If anyone feels that I am not deciding in the right direction, please let me know. I am always open to suggestions. Also, if anyone knows of any better "Plug and play" logic analyzer than the Saleae or knows of any bugs with the Saleae I'd love to hear from you.Thank you to all. I could not have figured out what I needed without everyones input. I owe you all a pizza (Pepperoni) Chris.Quote from: TheDirty on October 02, 2010, 12:45:04 am

author: sonicj
author_rank: Frequent Contributor
timestamp: October 02, 2010, 03:39:04 am
content: im not sure if it meets your requirements, but the Open Bench is 1/3 the price of the saleae and is open source.http://dangerousprototypes.com/2010/02/25/prototype-open-logic-sniffer-logic-analyzer-2/http://www.gadgetfactory.net/index.php?main_page=index&cPath=10

author: Gearbreaker
author_rank: Contributor
timestamp: October 02, 2010, 04:00:31 am
content: Thank you for the input..... I'm checking into it..... 32 channels and 1/3 the price may make it worth making my own case. Chris.Quote from: sonicj on October 02, 2010, 03:39:04 am

author: Zero999
author_rank: Super Contributor
timestamp: October 02, 2010, 06:44:45 am
content: Quote from: Gearbreaker on October 01, 2010, 08:37:33 pmWill the PWM be working at 30kHz?If so what's the shortest pulse width of minimum/maximum duty cycle?The data needs to be sampled at double the highest frequency signal of interest but a 30kHz PWM signal will have much higher frequency components than 30kHz. The minimum/maximum duty cycle will increase the highest frequency component and if you want to see glitches between different waveforms, the frequency might even be higher.

author: Unknown
author_rank: Unknown
timestamp: October 02, 2010, 07:12:14 am
content: Quote from: sonicj on October 02, 2010, 03:39:04 amThe cons are less mature software and only 24kpoints or so, as opposed to millions for the Saleae Logic. The latter might be a significant advantage here, since it would allow you to sample at a reasonable sample rate for a long time. I don't think any affordable scope has the necessary amount of sample memory (say 300kS/s * 30s = 9Msamples).Note that a logic analyzer will only distinguish between < logic threshold or > logic threshold, not sure if that's enough for this application. The input voltage is also usually about 5V max.A DIY solution would probably be doable, but is likely to cost a lot more time if you don't have much experience, and costs may even exceed the $150 or so for a USB based logic analyzer.

author: Gearbreaker
author_rank: Contributor
timestamp: October 02, 2010, 02:50:44 pm
content: Thank you for the input. All things considered I am back in favor of the Saleae. I've done some research and if I needed a project of something to experiment with the open source would be interesting. I really need to concentrate on the project at hand so there is much to be said for the plug and play capability of the Saleae. The Saleaes number of "points" or I'm not sure if it's right to call it the "Bit Rate" certainly would be an advantage too.I have certainly abandoned the idea of a scope for this project. I was barking up the wrong tree when I started thinking scope. Because I had been using a non storage scope to develop the circuit, I led myself down the path of thinking I needed a storage scope to monitor the system in operation. Also, when it comes to monitoring circuitry while on a motorbike I think simplicity is a good thing.$150 really isn't much to spend on a tool that is necessary to develop a new product too.I"m still open to thoughts or suggestions. Thanks to all again. Chris.Quote from: alm on October 02, 2010, 07:12:14 am

author: TheDirty
author_rank: Frequent Contributor
timestamp: October 02, 2010, 07:06:02 pm
content: Quote from: Gearbreaker on October 02, 2010, 03:16:20 amStandard automotive dataloggers aren't limited to engine parameters. Like the DL-32 linked, it has some specific engine logging parameters, but otherwise everything is just generic datalogging. It's meant for any and all sensors that can be used for sensor logging for whatever you are doing. It's quite nice for doing a full log of all parameters on test runs with suspension travel sensors, traction control, torque or frame angle, accelerometer/gyro. Match it up with a time synced camera's on the motorcycle and you can really watch what is happening.

author: Gearbreaker
author_rank: Contributor
timestamp: October 03, 2010, 04:23:39 am
content: Mark, I'll look more closely at DL-32 and let you know if it is the avenue I go with. I am always open to suggestions. Thanks again. Chris.Quote from: TheDirty on October 02, 2010, 07:06:02 pm

author: qno
author_rank: Frequent Contributor
timestamp: October 03, 2010, 07:45:41 am
content: Have you checked the USBEE products?http://www.usbee.com/They have small devices you can connect to a laptop.Most important, it comes with software.

author: Gearbreaker
author_rank: Contributor
timestamp: October 06, 2010, 09:36:56 pm
content: Mark (and all),Thank you all very much for your input. I ordered the Saleae today and after putting it to the test I'll post what happens. I couldn't have made an educated decision without everyones thoughts. I'm actually learning to like learning again. Chris.Quote from: TheDirty on October 02, 2010, 12:45:04 am

author: TheDirty
author_rank: Frequent Contributor
timestamp: October 07, 2010, 02:01:59 am
content: Watch out you don't connect it directly to a 12v signal by accident. You'll need some kind of level converter if you want to do that. A simple resistor divider will work, but give it some room. I've found motorcycle power to be very noisy. More so than car systems.

author: Gearbreaker
author_rank: Contributor
timestamp: October 07, 2010, 03:50:35 am
content: Mark,Yes, I will build a small interface board to clamp the inputs even though the pic is running @ 5 volts. There still can be transients running around the bike, good point. Now that you mention it, the transients could be the root of the problem. If the logic probe sees them I'll have to watch for them with a triggered sampling scope to better understand what is needed to correct the problem.Thanks again. Chris.Quote from: TheDirty on October 07, 2010, 02:01:59 am