Maker Pro
Maker Pro

Replacement for a microcontroller

MrOmnos

Jun 4, 2014
11
Joined
Jun 4, 2014
Messages
11
So...I am working on this ir heart rate monitor project...found it on the internet!! Its a really simple circuit...an ir emitter and a detector pair is used as a sensor...which is touched to your skin...it shines light up your skin and then reflected light is dected by the detector..this signal is then fed into an lm386 which amplifies the signal which is fed into an analog pin of an arduino or any micro controller...There's a code running on this microcontroller which sends this data via serial communication to the pc..there's a processing app on pc which reads this data and visualises it (well it actually draws a straight line on the screen :p if you know what I mean) so..is there any way to communicate with pc without a microcontroller. .is there any way to send that signal to pc without a microcontroller....I think that can reduce the cost drastically.
 

OLIVE2222

Oct 2, 2011
690
Joined
Oct 2, 2011
Messages
690
Communicating to serial port without microcontroller can be done but it's certainly will not be cheaper.
Decent µC are available for 2 euros + a basic RS232 translator, this can't be beat.
 

MrOmnos

Jun 4, 2014
11
Joined
Jun 4, 2014
Messages
11
Communicating to serial port without microcontroller can be done but it's certainly will not be cheaper.
Decent µC are available for 2 euros + a basic RS232 translator, this can't be beat.
hi! Thanks for the reply! I was thinking if I could send that signal though my microphone port on my pc...then write a app that would visualize it!! I mean..what my lm386 generates is just a signal right?? Similar to what my mic generates...if it is possible..it would fun :D ...i mean i could plug that into my android devices and write and app for it!! :D I know that it could be harmful for my sound card and phone but there must be safe way to do that...I mean this is 21st century!! :S
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Your sound card will not respond to frequencies that low. But there are USB ADCs that can probably be DC coupled, then read like an external sound card.

BTW why is there an LM386 involved? The LM386 is an audio amplifier that's designed to drive a loudspeaker. It will add distortion to the signal. An op-amp would be better.

I'm looking for references to USB ADCs and will post again when I find some.
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
You may be able to use a voltage to frequency converter to shift the frequency to a higher value. Then use the computer audio input and a program (audacity?) to regenerate the basic value and display the data.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
I don't think that would preserve the waveshape, but you could use your low-frequency signal to modulate the frequency or amplitude of an audio-frequency oscillator, feed the oscillator output into the sound card input, and use software to convert it back to its original form.
 

MrOmnos

Jun 4, 2014
11
Joined
Jun 4, 2014
Messages
11
You may be able to use a voltage to frequency converter to shift the frequency to a higher value. Then use the computer audio input and a program (audacity?) to regenerate the basic value and display the data.
Your sound card will not respond to frequencies that low. But there are USB ADCs that can probably be DC coupled, then read like an external sound card.

BTW why is there an LM386 involved? The LM386 is an audio amplifier that's designed to drive a loudspeaker. It will add distortion to the signal. An op-amp would be better.

I'm looking for references to USB ADCs and will post again when I find some.
I had Lm386 laying around so i used it..the signal was really noisy but then i blasted that amp with caps..now its presentable..i will replace it!!
i googled audio oscillator...and i found a video on youtube...will this circuit work??
will the signal maintain its form..this way??
 

MrOmnos

Jun 4, 2014
11
Joined
Jun 4, 2014
Messages
11
it would be really helpful if you could explain a little bit more about ADCs...and how it can be implemented!!
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
An ADC is an "analog to digital converter". It takes a voltage and converts it to a number which represents the magnitude of the voltage.

For example, an ADC having 8 bit resolution and a maximum voltage of 5 volts would produce the number 128 if the voltage it was presented with was 2.5v.

If you get the ADC to do its trick 100 times a second and send these 8 bit values as characters via RS232 to your computer, you can reconstruct the waveform.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Oh, and your microcontroller will more than likely have an ADC.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
If you're interested in building a circuit that generates a signal that can be received by a sound card, there are a number of VCOs available. Here's a link to the Digikey selection guide; many of these devices are probably suitable:

http://www.digikey.com/product-search/en?pv158=0&pv158=41&pv158=783&pv158=614&pv158=590&pv158=477&pv158=408&pv158=322&pv158=44&pv158=634&pv158=49&pv158=588&pv158=552&pv158=364&pv158=243&pv158=628&pv158=365&pv158=1&pv158=612&pv158=310&pv158=643&pv158=2&pv158=209&pv158=595&pv158=622&pv158=276&pv158=471&pv158=740&pv158=174&pv158=9&pv158=639&pv158=82&pv158=446&pv158=240&pv158=290&pv158=83&pv158=610&pv158=291&pv158=19&pv158=78&pv158=568&pv158=455&pv158=35&pv158=295&pv158=296&pv158=80&pv158=570&pv158=300&pv158=37&pv158=572&pv158=573&pv158=571&pv158=304&pv158=465&pv158=230&pv158=466&pv158=36&pv158=390&pv158=30&pv158=199&pv158=28&pv1291=0&pv1291=319&pv1291=56&pv1291=1077&pv1291=896&pv1291=4604&pv1291=46&pv1291=185&pv1291=375&pv1291=3392&pv1291=159&pv1291=9&pv1291=189&pv1291=920&pv1291=233&pv1291=635&pv1291=1924&pv1291=155&pv1291=945&pv1291=193&pv1291=36&pv1291=3285&pv1291=892&pv1291=200&pv1291=948&pv1291=455&pv1291=2178&pv1291=14&pv1291=469&pv1291=2183&pv1291=24&pv1291=951&pv1291=796&pv1291=1957&pv1291=819&pv1291=825&pv1291=590&pv1291=956&pv1291=1961&pv1291=22&pv1291=858&pv1291=4598&FV=fff40027,fff80205&stock=1&quantity=1

The CD74HC4046 is a very common device that includes a VCO. This would probably be suitable for your application; the only question is whether it is linear enough, and stable enough. You would need to use a good quality, highly stable capacitor for frequency setting.

The VCO has an input voltage range of 0V~5V. You would need to bias the signal around 2.5V. The VCO can be set up so that the input voltage range corresponds to a frequency range of, for example, 5~10 kHz.

Here's a link to the 74HC4046 on Digikey, and the Texas Instruments data sheet.
http://www.digikey.com/product-detail/en/CD74HC4046AE/296-9208-5-ND/376781
http://www.ti.com/lit/ds/symlink/cd74hc4046a.pdf

Please have a look at the data sheet. If you want to go that way, let us know, and I can make some specific suggestions.

Edit: The 4046 is actually a phase-locked loop (PLL) and it includes several other sections. Only the VCO is relevant for this application; ignore the other stuff.
 

MrOmnos

Jun 4, 2014
11
Joined
Jun 4, 2014
Messages
11
If you're interested in building a circuit that generates a signal that can be received by a sound card, there are a number of VCOs available. Here's a link to the Digikey selection guide; many of these devices are probably suitable:

http://www.digikey.com/product-search/en?pv158=0&pv158=41&pv158=783&pv158=614&pv158=590&pv158=477&pv158=408&pv158=322&pv158=44&pv158=634&pv158=49&pv158=588&pv158=552&pv158=364&pv158=243&pv158=628&pv158=365&pv158=1&pv158=612&pv158=310&pv158=643&pv158=2&pv158=209&pv158=595&pv158=622&pv158=276&pv158=471&pv158=740&pv158=174&pv158=9&pv158=639&pv158=82&pv158=446&pv158=240&pv158=290&pv158=83&pv158=610&pv158=291&pv158=19&pv158=78&pv158=568&pv158=455&pv158=35&pv158=295&pv158=296&pv158=80&pv158=570&pv158=300&pv158=37&pv158=572&pv158=573&pv158=571&pv158=304&pv158=465&pv158=230&pv158=466&pv158=36&pv158=390&pv158=30&pv158=199&pv158=28&pv1291=0&pv1291=319&pv1291=56&pv1291=1077&pv1291=896&pv1291=4604&pv1291=46&pv1291=185&pv1291=375&pv1291=3392&pv1291=159&pv1291=9&pv1291=189&pv1291=920&pv1291=233&pv1291=635&pv1291=1924&pv1291=155&pv1291=945&pv1291=193&pv1291=36&pv1291=3285&pv1291=892&pv1291=200&pv1291=948&pv1291=455&pv1291=2178&pv1291=14&pv1291=469&pv1291=2183&pv1291=24&pv1291=951&pv1291=796&pv1291=1957&pv1291=819&pv1291=825&pv1291=590&pv1291=956&pv1291=1961&pv1291=22&pv1291=858&pv1291=4598&FV=fff40027,fff80205&stock=1&quantity=1

The CD74HC4046 is a very common device that includes a VCO. This would probably be suitable for your application; the only question is whether it is linear enough, and stable enough. You would need to use a good quality, highly stable capacitor for frequency setting.

The VCO has an input voltage range of 0V~5V. You would need to bias the signal around 2.5V. The VCO can be set up so that the input voltage range corresponds to a frequency range of, for example, 5~10 kHz.

Here's a link to the 74HC4046 on Digikey, and the Texas Instruments data sheet.
http://www.digikey.com/product-detail/en/CD74HC4046AE/296-9208-5-ND/376781
http://www.ti.com/lit/ds/symlink/cd74hc4046a.pdf

Please have a look at the data sheet. If you want to go that way, let us know, and I can make some specific suggestions.

Edit: The 4046 is actually a phase-locked loop (PLL) and it includes several other sections. Only the VCO is relevant for this application; ignore the other stuff.
Thanks...I looked at the data sheet...I would be really helpful..if you could help me implement it in my circuit!! I have never worked with this chip!!
"
The VCO requires one external capacitor C1 (between C1A
and C1B) and one external resistor R1 (between R1 and
GND) or two external resistors R1 and R2 (between R1 and
GND, and R2 and GND). Resistor R1 and capacitor C1
determine the frequency range of the VCO. Resistor R2
enables the VCO to have a frequency offset if required "
This was in the data sheet!!

So, what R1 and C1 should i choose for my circuit?? Does my circuit require R2??
There are two input pins Signal Input and VCO input...I am guessing I will have to use VCO input???
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
OK, here's a test setup for the CD4046B that you can build up on breadboard or stripboard to get an idea of what it does and whether it will be useful to you.

268899.001.GIF

The VCO in the 4046 is a voltage controlled oscillator. This means that it generates a signal (a tone) at a frequency that is determined by the control voltage on pin 9, in conjunction with the other frequency-setting components: C1, R1+VR1, and R2+VR2 (if JP1 is closed).

For your application, I've chosen a C1 value of 22 nF (nanofarads), which I think will enable you to operate the VCO over an appropriate frequency range: around 8~12 kHz.

This is within the frequency range that's audible to humans, and can be acquired by a standard sound card through the line input. (Don't use the microphone input.)

The reason for using frequency modulation (instead of connecting your heartbeat monitor directly to the sound card input) is the very low frequency of the heartbeat signal. Sound cards aren't normally designed to acquire signals below around 20 Hz but heartbeat signals are around 1 Hz, and to reproduce them properly you really need a frequency response that extends below 1 Hz.

You need some way of converting the heartbeat signal into a signal that can be easily and acurately acquired by the sound card - something comfortably within the frequency range that the sound card is designed to acquire.

You will need to do some experimenting to get a reasonable frequency range for the signal that your "input processing circuitry" generates. That's why I've suggested preset potentiometers (aka "trimpots") for the R1 and R2 components. You may also want to get a selection of capacitors to try for C1 - for example, 4.7 nF, 10 nF, 47 nF and 100 nF as well as the 22 nF value I suggest.

The frequency accuracy of this circuit will depend on a number of factors. I've specified C1 as having an initial tolerance of ±3% and this type also has a typical drift with frequency of only around ±1% from -40°C~+60°C, so it's relatively stable. The 4046 is affected by temperature, but I don't know how much. The resistors and trimpots have a guaranteed temperature coefficient of resistance of ±100 ppm/°C (0.01%/°C) which is fairly stable. The power supply voltage will also affect the 4046 and it must be regulated; the exact value is not critical.

Any variation in the no-signal DC voltage from the input processing circuit will obviously also affect the output frequency as well. If you upload a schematic of this circuit, I may be able to advise you. The no-signal DC voltage from the input processing circuit needs to be comfortably within the supply rails; ideally, around half the supply voltage would be best. In this case you won't need R2+VR2, so you can leave JP1 open. You may need R2+VR2 if you want to reduce the VCO frequency range.

The CD4046 data sheets claim that the VCO is "highly linear" but that's not entirely true, especially with lower values of R1. In other words, the frequency you acquire with the sound card will not necessarily map linearly to the voltage coming from the input processing circuitry.

Other components are not critical at all. CD and CC can be cheap ceramic capacitors. RA and RB form an attenuator to reduce the amplitude of the VCO output (which swings from 0V to the positive rail) down to a level that the sound card should be able to accept on its line input.

If you have a multimeter that measures frequency, this will simplify your testing and setup a lot. Connect it to pin 4 of the CD4046. You can also connect the output (on CN1) to an audio amplifier while you make adjustments; this will give you immediate audible feedback on any adjustments you make.

Use the highest sampling frequency available; at least 44.1 kHz. This will ensure a reasonable number of samples per cycle of the VCO signal.

For testing, you can use an audio recording program such as Audacity. To use it for real-time acquisition and analysis, you will need to write software that talks directly to the audio input driver and analyses the frequency in real time. Assuming you want to be able to do that.

Have a think about this, and if you think it's worth trying, build it up and have a play around with it, to get a feel for what it does and how you might be able to use it.
 
Top