68hc12 for processing a sensor input

In summary: It seems like you're just trying to find a way to turn a 20V DC signal into a 5V DC signal, so the word "filter"...A low-pass (RC) filter would be appropriate for this application.
  • #1
EvLer
458
0
Hello,
this is something I am not sure about, so want to make sure before burning my friends electronics :biggrin: .
we are trying to use 68hc12 for processing a sensor input, but the signal from the sensor comes out to be more than 5 volts (around 15 or 20 v), so what we need is to scale the voltage from 15 to 5 volts. Would I use just a low-pass (RC) filter for that, or what would I need to do?
Thanks in advance.
 
Engineering news on Phys.org
  • #2
What is the output impedance of the sensor? What is the input impedance specification for the analog input pin that you are using in the 68HC12? (I assume it's an A/D input?) What is the bandwidth of the sensor signal that you want to be sure to preserve? Is the sample/hold part of the ADC external or internal to the 68HC12?
 
  • #3
Berkeman's questions are all good, but, I'd bet that one of two solutions would be adequate for virtually any such situation:

1) a simple high-valued resistor divider
2) an op-amp with a gain of 1/4

- Warren
 
  • #4
chroot said:
Berkeman's questions are all good, but, I'd bet that one of two solutions would be adequate for virtually any such situation:

1) a simple high-valued resistor divider
2) an op-amp with a gain of 1/4

- Warren
Awww, you're taking the fun out of this, chroot! :biggrin:

BTW, did you get my PM about the ICL7106 question thread?

https://www.physicsforums.com/showthread.php?t=127935
 
  • #5
Yeah, I got the PM, but I don't know anything about the part, and didn't have the time to go reading up on it.

- Warren
 
  • #6
:biggrin:
chroot said:
Yeah, I got the PM, but I don't know anything about the part, and didn't have the time to go reading up on it.

- Warren
Fair enough -- me neither. I'm in the middle of another first-silicon verification and preparing to present at a conference in September. Pesky chips! :biggrin:
 
  • #7
I am digging the manuals, berkemann, I can answer all your questions except for the sensor, since I don't have the specs of it...my friend does.

-I/O pins on 68hc12 all have 5v nominal voltage, could not find anything on impedance though;
-sampling is done internally, actually all we need right now is to detect the pulses, which I can use pulse accumulator for that purpose (the TIM module).

op-apm went thorugh my mind...

thanks a lot!
 
Last edited:
  • #8
EvLer said:
but when would I use a filter, is it one of the alternatives to op-amp or am I totally off?
I am digging the manuals, berkemann, I can answer all your questions except for the sensor, since I don't have the specs of it...my friend does.

-I/O pins on 68hc12 all have 5v nominal voltage, could not find anything on impedance though;
-sampling is done internally, actually all we need right now is to detect the pulses, which I can use pulse accumulator for that purpose (the TIM module).

op-apm went thorugh my mind...

thanks a lot!
Oops, sorry about hijacking the thread there, EvLer. I asked about the impedances to see if you can just use a voltage divider without getting too much gain error. Plus, if you use too high values for the resistors and have moderate input capacitance in your uC pin, that will cause an RC rolloff of the input signal, which is bad for higher-frequency signals.

When you say filter, is that what you mean? A resistor divider with added capacitance? That is actually desirable for an ADC input -- it's called an anti-alias filter, and you set the breakpoint based on the ADC sample frequency.
 
  • #9
The front-end of the A/D is likely to have an impedance of several megohms, so it's effectively an infinite input impedance.

The sensor is likely not buffered, and probably has an output impedance of several hundred ohms (you should look that up). If you use a high-valed resistor divider, it will not draw much current from the sensor, thus avoiding any loading problems.

If the sensor happens to have a very high output impedance, somewhere north of 1kohm or so, you'd be better off buffering it with an op-amp. An op-amp can "convert" a high-impedance output signal into a low-impedance output signal. You could then follow the op-amp with a resistor divider, or, accomplishing the same thing, integrate the resistor divider in the op-amp's feedback network.

Note: I'm assuming that the signals here are low-bandwidth. Most sensors measure variables that change very slowly, like temperature, and the bandwidth of their signals is effectively zero, so it doesn't matter what kind of frequency response your network produces.

- Warren
 
Last edited:
  • #10
BTW, EvLer, most electrical engineers use the word "filter" to describe circuits that have carefully designed magnitude vs. frequency behavior. They're used to get rid of unwanted components of signals.

It seems like you're just trying to find a way to turn a 20V DC signal into a 5V DC signal, so the word "filter" is not really appropriate. "Level shifting" is probably the term most EEs would use for the purpose.

Just an FYI. :biggrin:

- Warren
 
  • #11
thanks for all the help and terminology.
Here is the sensor attached. Also, if I use an op-amp, what am I looking for? I checked out Digi-key, and they classify them very thoroughly as low-voltage, CMOS, etc. and I am not quite sure what we need besides gain of 1/4. All we need to detect is the signal off the sensor, which is an impulse actually, just a spike. The sensor is laid on the floor and a heavy weight is rolled quickly over it, so we are detecting the "event" of something passing by on the floor.
Sensor specs are attached.
 

Attachments

  • piezo_polymer_coaxial_cable.pdf
    99.8 KB · Views: 362
  • #12
"...if I use an op-amp, what am I looking for?"

Looks like a simple application for a 741 op-amp.
 
  • #13
Oh, jeez, that's all this is? A brief 20V spike, containing no specific information other than the fact that it occured?

You really should have told us that information from the beginning EvLer.

Since this is an entirely different kind of "sensor" than the ones we originally imagined you were talking about, my recommendation has changed entirely. You don't need a filter, or even an op-amp. All you need is a resistor divider to limit the maximum voltage.

The most difficulty you're likely to have is that a very brief spike is going to be hard to detect with a microcontroller. An ADC will miss a spike that occurs so quickly that it falls completely within a single sample period. If the "spike" lasts more than a few tens of milliseconds, however, it might be okay.

If your microcontroller has a timer/counter module (most do), you can probably configure it to count rising edges of your input signal. Alternatively, you could use a 555 or other timer IC, configured as a one-shot, to extend your sensor's "spike" into a longer, more easily captured pulse. If the pulse is long enough, your microcontroller could detect it simply by polling.

- Warren
 
  • #14
One possible improvement on the resistor voltage divider idea would be to use a resistor divider that provides about 5V peak from the lightest vehicle that will cross the cable, and put a diode clamp from that sensing midpoint of the divider to the 5V rail of the uC. That way, much heavier vehicles can be sensed, and the voltage at the uC input will not be a problem.

BTW, if you did end up needing to use an opamp, you should look for a fairly new CMOS opamp that runs well off of a single supply (like your 5V rail). The old 741 series opamps need fairly wide split rails -- their inputs and outputs are nowhere near the rails.
 
  • #15
not sure if I should start another thread, but...
in timer module of 68hc12 there is a free running 16-bit counter TCNT, and i cannot see in the documentation whether reading from it resets the counter or not, I need to reset it after 2 pulses in pulse accumulator. I know that channel 7 Output compare resets the counter. But not sure how else, maybe besides clearing it directly?
here is the link for documentation: http://www.freescale.com/files/microcontrollers/doc/ref_manual/S12TIM16B8CV1.pdf?srch=1" [Broken]
Was wondering if someone knows or can help me with that.
Thanks.
 
Last edited by a moderator:

1. What is the 68HC12 microcontroller and how does it process sensor inputs?

The 68HC12 is a microcontroller developed by Motorola. It is a 16-bit processor that can handle multiple input and output devices, making it suitable for a wide range of applications. When processing a sensor input, the 68HC12 reads the signal from the sensor and converts it into a digital value that can be used for further processing.

2. How does the 68HC12 handle analog sensor inputs?

The 68HC12 has an onboard analog-to-digital converter (ADC) that allows it to read analog sensor inputs. The ADC converts the analog signal into a digital value that can be processed by the microcontroller. The resolution of the ADC can be adjusted to suit the specific needs of the sensor being used.

3. Can the 68HC12 handle multiple sensor inputs simultaneously?

Yes, the 68HC12 has multiple input/output (I/O) ports that can be configured to handle different types of sensors. This allows for multiple sensor inputs to be processed simultaneously, making it a versatile option for applications that require multiple sensors.

4. How does the 68HC12 communicate with external devices?

The 68HC12 has various communication interfaces, such as serial ports, SPI, and I2C, which allow it to communicate with external devices. This allows for data to be exchanged between the microcontroller and other devices, making it suitable for applications that require connectivity.

5. What programming language is used to program the 68HC12 microcontroller?

The 68HC12 can be programmed using assembly language or high-level programming languages such as C or C++. There are also specific development environments, such as CodeWarrior and HiWave, that can be used to program the microcontroller. The choice of programming language depends on the specific needs and preferences of the programmer.

Similar threads

  • Electrical Engineering
Replies
0
Views
122
Replies
6
Views
703
Replies
7
Views
806
  • Electrical Engineering
Replies
14
Views
741
  • Electrical Engineering
Replies
10
Views
2K
  • Electrical Engineering
Replies
12
Views
1K
  • Electrical Engineering
Replies
18
Views
1K
  • Electrical Engineering
Replies
3
Views
778
  • Electrical Engineering
Replies
8
Views
1K
  • Electrical Engineering
Replies
9
Views
1K
Back
Top