i-n-g-o / intrabody-PAN

a near-field intra-body Communication Device
GNU General Public License v3.0
1 stars 0 forks source link

Fine-tuning of the PAN circuit #1

Open dominicklee opened 5 years ago

dominicklee commented 5 years ago

Hi Ingo,

Could you share more about how two potentiometers of the PAN receiver circuit? What does each potentiometer do? What should I look for in the the oscilloscope?

Also, can I send any modulated signal using this circuit, or does it have to be at a specific frequency?

Thanks.

i-n-g-o commented 5 years ago

Hi Dominick

The first potentiometer sets the amplification of the second amplification-stage. The second potentiometer sets the threshold-value: everything above the threshold-value is about V+, a value below the threshold about 0V.

Oscilloscope should look something like the one in the article (section: Receiver)

The receiver circuit is just an analog amplifier with some filters and threshold. The filters are set to the carrier frequency of the project of ~333kHz. The maximum amplification the Op-amps provide is limited by the frequency. So theoretically, yes the the circuit can be used with different frequencies, but only if you adjust the filters and check that the op-amps for the desired frequency.

If you want different data-rates, be aware: Current version of the project does not use manchester-encoding (as stated in the article) so the timings are hard-coded in the receiver code to bit-bang the incoming bytes...

dominicklee commented 5 years ago

Hi Ingo,

Thank you for your helpful reply! I have built the receiver circuit mentioned in your article. I would like to use an ESP8266 or ESP32 microcontroller for this project. Based on the 80 MHz clock on those microcontrollers, hypothetically getting your project to work shouldn't be a problem. As I see it, you are using a fast PWM signal in your Attiny transmitter to create that 333.333kHz carrier signal. Am I correct?

However, I noticed you wrote the code for the Attiny and used some functions that are specific to the ATMEGA chips. Would you mind sharing some insights or possibly Arduino code that can be used with something like the ESP8266 core or ESP32 core? Please provide some insights on how this can be ported over to other Arduino devices.

Would you plan to write some Arduino library with examples? If needed, we can collaborate on that to make this a bit more compatible and easy to use.

Thanks again!

i-n-g-o commented 5 years ago

Hi.

Yes, a PWM is generating the carrier wave. To make the transmitter work on Arduino or other devices, the only thing to be done is to use the correct way to setup a PWM and to turn this on and off according to the bits beeing transmitted. For an Arduino this means to use the correct registers for a ESP8266/32 there should be a documented way how to generate a PWM.

In PAN-writer-attiny the PWM is configured in setup() the functions pwmOn() and pwmOff() are used to turn the PWM on and off.

The reason why i never considered wrapping this into a library is, that i think it is not in a state to do so. Also i did not wanted to "obscure" the code. For a library it would make sense use manchester encoding as this would contain the clock within the signal.