Jump to content
Electronics-Lab.com Community

Help needed for storage device


vinash

Recommended Posts

I am trying to build the LED digital voltmeter that is given in the electronics lab webpage.I would than attach it to my sensor which gives a voltage output. After i have built the digital voltmeter, i would like to concurrently display the voltage output and also simultaneously record the readings that is displayed on the LED digital voltmeter. Could someone be able to help me in this? How do i go about doing that. Any help is greatly appreciated........

Link to comment
Share on other sites


I assume you want to record the voltage as well as display it right? Anyway, to do this you will require several things.

1. A low pass filter (LPF) and amplification
2. An analog-to-digital converter (ADC)
3. A microcontroller (and some sort of flash memory) or a connection to a PC.

The low pass filter is to prevent aliasing in the signal when it is sampled by the ADC. The amplification is to size the input voltage to the voltage range of the ADC. The ADC is used to convert the voltage to digital format.

Some microcontrollers have onboard ADCs which makes that part a little easier. Plus microcontrollers typically have a method of communicating with a PC which would make the data storage much simpler.

How fast is your voltage signal changing? How fast do you want to sample the signal (ie how many measurements per second)? The limit on how fast you want to sample the signal is limited by how fast your link to the PC is as well as the maximum sampling rate of the ADC on the microcontroller.

Assuming that your data transfer to the PC is 9600 bits/second and an 8-bit ADC, your absolute maximum sampling rate can be (9600 bits/sec)/(8 bits/sample) = 1200 samples/sec. You then need to verify that the ADC can in fact measure this quickly (usually it will). So the maximum sampling rate is 1200 Hz (it will usually be lower due to processor overhead). This means that you need a low pass filter cutoff at a maximum of 600 Hz to prevent aliasing. Aliasing is roughly high frequency signals "folding over" into your sampling range and appearing as a different lower frequency signal. You typically want to go 10X lower than that for good resolution. So the LPF cutoff is now at 60 Hz.

Now to determine the amplification required between the LPF and the ADC. Assuming the ADC takes voltages from -5 to 5 V and your input voltage signal ranges from -2.5 to 2.5, you would require a maximum bipolar amplification stage of 2. Typically you set it slightly lower than that to ensure no clipping of the signal. This amplification is important to reduce quantization noise. For example, say your signal ranged from 0 to 1 V and you have a 2 bit ADC (unrealistic but this is an example) so 00b = 0 V, 01b = 1 V, 10b = 2V and 11=3V. Most of your measurements would be either 00b or 10b and you would miss all detail. Whereas if you amplified the input signal to 0 to 3 V. You would get the whole range of the ADC.

Let me know if you need any help. I can give you more specifics on the components if you tell me more specifics on what you want to do.

Link to comment
Share on other sites

HI Thanks for your kindly and prompt reply. I appreciate your help. I am actually trying to build a sensor that is able to measure muscular forces around the elbow, whenever there is any muscular action (e.g bending of the arm and etc...) the sensor is able to give out voltage signals and based on the voltage signals, we are able to deduce the intensity of the force exertion. The output voltage direct from the signal without any amplification is between 0 to 50 mV. The sampling rate is about 1000KHZ. I am planning to have a display unit ( similar to the one mentioned in this website) and also a memory storage device ( e.g thumbdrive, MP3 player or PDA) that is constantly recording the signals that are obtained. The idea is for the person to use it anywhere and not restrict himself to places where there are computer and if this is not possible than of course computer would be the next best option for storage.

I am from a mechanical engineering background and not very familiar with the electronics chips and microcontrollers. If you could help me with more specifics of the components and the typs of components to use and also provide me some information ( e.g goodwebsites) on programming the microcontroller for this application, i would be very grateful to you.

Thank you.

Link to comment
Share on other sites

So are you actually measuring the electromyogram signal (the electrical signal sent to the muscle)? If so, this is similar to my MASc. So I'll be more than glad to help out. What university do you go to?

I need some more answers to help you.

Are you sure the signal isn't bipolar? EMG signals are bipolar unless you rectify them.

How much detail do you want in the signal? Do you just want to general amplitude or do you want all the detail of the signal? I can give suggestions on reducing the sampling rate and filter cutoffs if I know this.

You may have memory problems with 1000 kHz. At 1000 kHz, you will fill your memory in a very short time and have extreme difficulty processing and storing the data and will likely require a DSP and a hard drive. At 1000 kHz, you would fill 512 MB of memory in about 9 minutes (without compression, assuming 8-bit). Are you sure you don't mean 1000 Hz?

Link to comment
Share on other sites

I am very glad to hear from you.I am from the university in Singapore. How about you? Well with regards to polarity. i am not using an EMG, but using a piezoresistive sensor, hence the output is always positive.

As for the information, i just only need to know the voltage output whenever there is any muscular force exertion, do you need any other information?

As for the sampling rate, i think i have made a mistake, it is supposed to be just 1000Hz.

Thank you, do appreciate your help...

Link to comment
Share on other sites

I went to the University of British Columbia in Canada.

Does the piezoresistive sensor actually measure force or are you trying to correlate the angle of the piezoresistive sensor to the force? As I recall, piezoresistive sensors change their resistance with angle of bending which doesn't necessarily mean there will be a force generated by the muscles (ie the elbow can be bent at an angle without using any muscle force). How are you orienting the sensors around the elbow to detect force generation (a picture would help me if possible)? Are you trying to determine force at the hand or at the actual joint? Do you have more than one sensor (one for flexors and one for extensor muscles)?

I think your sampling rate may be too high if you are simply looking for gross human motion. The sampling rate you should choose is dependent on the maximum velocity of the joint in question. This will save you on memory storage if that is important to you.

From a quick experiment on myself, I can swing my elbow at full velocity through its full range (0 degrees to around ~120 degrees and back to 0 degrees) at a rate of 2.1 times per second or ~252 degrees/sec. Therefore a sampling rate of 1000 Hz will give a resolution of 0.252 degrees. This works out to around 476 data points for the motion of the arm from bent to straight at near maximum velocity. Most motions will be much slower than that.

As for circuits, you will need an instrumentation amplifier with a gain range of around 100 to 200 to bring you 0-50 mV signal to 0-5 V or 0-10 V (depending on your ADC range). This circuit should be placed as close as possible to the piezoresistive sensor to minimize amplification of transmission noise. You can get a whole instrumentation amplifier in one IC through samples from TI or Analog (or some others). Following that, you will need a low pass filter at a cutoff frequency of approximately 5 to 10 times lower than your sampling frequency (for 1000 Hz it will be around 200 to 100 Hz). This ensures you will absolutly not have aliasing when you sample the signal. I typically use UAF42 ICs from TI for my motion applications in a Butterworth configuration. There is a DOS program to help you design your filter and select resistor values).

I suggest you breadboard these circuits and look at the output from an oscilloscope. You can then see how much detail the system is giving you and adjust your filter cutoff frequency. If the signal is "noisier" than you would like, lower the cutoff frequency to make the signal more smooth. If it is is too smooth, increase the cutoff frequency. There is a tradeoff because the lower you can make the cutoff frequency, the lower you can make the sampling rate and thus save memory but the tradeoff is less detail in the measured signal.

Let me know if you have any more questions.

Link to comment
Share on other sites

Thank you so much do appreciate your help.
I do have another question. As for the amplification you had mentioned the UAF42 ICs. I would go through the chip. I would like to find out for the memory download, It would be great if you could suggest how i could go about storing the datas which i had obtained in a flashdrive or something. What type of microcontrollers would be suitable for these kind of applications. Thank you....

Link to comment
Share on other sites

You will also need an instrumentation amplifier (like an INA338 from TI) before the UAF42 ICs. The signals will go from the sensor to the instrumentation amplifier and then to the UAF42 filter and then to the microcontroller.

I've never interfaced to a flash drive before, I just would output to a PC for my system. But if you want portability, I guess that an industrial flashdrive is what you are looking for. Sandisk has an article on interfacing a 80C51 (or 68HC11 with some modification) microcontroller to a flashdrive. You might want to check the price on these drives.

http://www.sandisk.com/industrial/flash-drive.asp
http://www.sandisk.com/pdf/oem/AppNote80C51FlashATAv1.0.pdf

I'm partial to the HC11 because I've used it before but it is up to you. I think that you can get 80C51's as samples from some sites. Let me know which type you want.

Are you making a PCB or will you just be using sockets and wirewrap or solder? What is your budget?

Link to comment
Share on other sites

Hi, Thanks again, u"ve been helping a lot, i do apprrciate that.
I think i will look into 80C51.
I was thinking of using sockets and solder first and if it is successful, i thought of doing it in PCB.
My budget is about $100.

If i would like to interface it to a P.C. like what you did, could you please tell me how do i go about doing that.( what chips and procedures to follow).

Thank you again.

Link to comment
Share on other sites

Most microcontrollers have a serial interface. You connect this to a MAX232 chip (or equivalent) in addition to some capacitors (check the data sheets). This chip is available through samples from many companies. It basically does the level conversion from the micro to the PC. You then connect this to a DB-9 connector with the right pin configuration (typically only require 3 pins TX, RX, and GND). You should then be able to talk to a PC through a serial port. This is also usually how your will program the internal EEPROM or flash on the microcontroller. I suggest you look at getting a microcontroller with onboard electrically erasable (EEPROM) or flash memory as this makes development easier than UV erasable or external EPROM memory.

On the PC side, you will need a program that will read data from the serial port and then save it to disk.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
  • Create New...