element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Experts, Learning and Guidance
  • Technologies
  • More
Experts, Learning and Guidance
Ask an Expert Forum Trying to understand NFC ASK Modulation
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Experts, Learning and Guidance to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 19 replies
  • Subscribers 287 subscribers
  • Views 2935 views
  • Users 0 members are here
  • raspberry pico
  • nfc
  • nfc-a
Related
See a helpful answer?

Be sure to click 'more' and select 'suggest as answer'!

If you're the thread creator, be sure to click 'more' then 'Verify as Answer'!

Trying to understand NFC ASK Modulation

BigG
BigG over 2 years ago

According to my Google search, NFC uses ASK modulation to transmit data:

https://www.rfwireless-world.com/Tutorials/NFC-Near-Field-Communication-tutorial.html

https://www.rfwireless-world.com/Tutorials/NFC-Modulation-and-NFC-Coding.html

Which I have interpreted as the following where the "Mixing Circuit" includes the NFC tuned antenna and two picoFarad capacitors... but what else is needed.

image

As a non electronics engineer I am trying to work out a minimum circuit required.

Then my lofty intentions is to use a Raspberry Pi Pico to generate my clock signal using PIO and as there is also a Manchester Encoding PIO example, I will attempt to use that too.

So could this work, I wonder?

  • Sign in to reply
  • Cancel

Top Replies

  • jc2048
    jc2048 over 2 years ago +3
    I'm far from being an expert, but this is my understanding of the basic principles in case it helps (this is 20 years out of date, but the basic stuff won't have changed too much). I think I'm duplicating…
  • michaelkellett
    michaelkellett over 2 years ago +2
    This will be harder than you think ! A long time ago (2006) I did work designing antennae for MIFARE (same thing, more or less) and it's quite tricky. NXP still are fairly active in this field and…
  • scottiebabe
    scottiebabe over 2 years ago +2
    It is possible for sure, but its not really a project I would recommend taking on without an oscilloscope. So if your looking for an excuse to purchase an MXO4 scope, id say go for it ;) I am Rx/Tx…
Parents
  • scottiebabe
    0 scottiebabe over 2 years ago

    It is possible for sure, but its not really a project I would recommend taking on without an oscilloscope.

    So if your looking for an excuse to purchase an MXO4 scope, id say go for it ;) 

    I am Rx/Tx USB-PD with the pio on a PI pico right now which is differential Manchester, so that could provide some inspiration  

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • scottiebabe
    0 scottiebabe over 2 years ago

    It is possible for sure, but its not really a project I would recommend taking on without an oscilloscope.

    So if your looking for an excuse to purchase an MXO4 scope, id say go for it ;) 

    I am Rx/Tx USB-PD with the pio on a PI pico right now which is differential Manchester, so that could provide some inspiration  

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • shabaz
    0 shabaz over 2 years ago in reply to scottiebabe

    Agree, unfortunately this is a project that's very unlikely to work, because there's several hurdles here; not just the hardware design and building of the receiver, but also the decoding complexity, it won't be a nice friendly stream of usable data all the time either, there will be noise to deal with so it needs some signal processing as well (can be partially in hardware and partially in software). It's all a major project, not a weekend thing. 

    If the Pico can be replaced with a PC and sound card, then that could make life easier to better understand the challenge and implement on the PC first perhaps, rather than coding for the Pico initially. But the signal would need to be mixed down to see it (e.g. with any SDR project hardware).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • BigG
    0 BigG over 2 years ago in reply to scottiebabe

    Yes that was in the back of my mind as I don't have a suitable scope... more like hoping those who have already purchased an MX04 scope, or equivalent, may be looking for another excuse (i.e. project) to get some more play time with their expensive toy. Grinning

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 2 years ago in reply to BigG

    A slightly similar (but different) project was a heartbeat monitor strap, they transmit ASK-like pulses at a much lower frequency (5 kHz) which in theory sounds as if it should make the project easier, but with low frequencies come other issues, especially dealing with noise. I built the front end to it last year, but didn't get around to blogging it. For that, I used op-amp buffers basically, but because the signal is weak (compared to NFC, the heartbeat straps need to be monitorable from a slightly larger distance, and they run from a coin cell so not a lot of power), it needed heavy filtering to extract the signal from the noise. I didn't use SDR, but just used sharp filters. I did manage to get the signal (receivable to almost a couple of metres!, which was more than enough for its use-case) in a decent form, but other stuff got in the way and I never got to complete it. Also my pickup coil was massive : ) About the size of a coke-can.

    I don't have the schematic (I didn't create one, because I was just experimenting, and thought I was going to write the circuit down soon, but didn't) but could dig up the stripboard I created it on, would need some reverse-engineering by someone!

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • scottiebabe
    0 scottiebabe over 2 years ago in reply to scottiebabe

    Well this project doesn't require anything fancy, right now I am using a 555 timer as a level translator and $10 logic analyzer! 

    I am transmitting the same source advertisement packet from a Pico

    image

    image

    Pico sending a good crc packet,

    image

    A source request

    image

    Transmitting usb-pd with the pico is quite simple, for example here is my python code for sending a goodcrc message

    def goodCRC():
        # If preamble can be 65 BMC bits then it could be done here
        # Right now, PIOSM takes care of 64 BMC bits preamble
        preamble = []#[0b1010101010]*7
        sop = [symtable['S1']]*3 + [symtable['S2']]
        header = b'\x01\x01'
        data = array.array('i',[])
        payload = header+bytes(data)
        
        crc = binascii.crc32(payload)
        payload += crc.to_bytes(4,'little')
        
        txsyms = preamble + sop
        txsyms += usbpd4b5bencode(payload)
        txsyms += [symtable['EOP'],0]
    
        pdtx(txsyms)
    

    The receive side is a bit more complicated... 

    I think it will be a helpful project for someone just wanting to experiment and learn about usb-pd signaling 

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 2 years ago in reply to scottiebabe

    This looks great!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • scottiebabe
    0 scottiebabe over 2 years ago in reply to shabaz

    Thanks! Its been quite enjoyable experimenting with the pico, its like I'm building an my first power supply again many years later its fun try to new things!

    To send the same message as my power supply, the code was also quite simple too

    def usbpdbroadcast():
        # If preamble can be 65 BMC bits then it could be done here
        # Right now, PIOSM takes care of 64 BMC bits preamble
        preamble = []#[0b1010101010]*7
        sop = [symtable['S1']]*3 + [symtable['S2']]
        header = b'\xa1\x69'
        data = array.array('i',[0x0a01912c,0x0002d12c,0x0003c12c,0x0004b12c,0x0005a0fa,0x000640e1])
        payload = header+bytes(data)
        
        crc = binascii.crc32(payload)
        payload += crc.to_bytes(4,'little')
        
        txsyms = preamble + sop
        txsyms += usbpd4b5bencode(payload)
        txsyms += [symtable['EOP'],0]
    
        pdtx(txsyms)
        
        
    symtable = {
        0: 0b11110,
        1: 0b01001,
        2: 0b10100,
        3: 0b10101,
        4: 0b01010,
        5: 0b01011,
        6: 0b01110,
        7: 0b01111,
        8: 0b10010,
        9: 0b10011,
        10: 0b10110,
        11: 0b10111,
        12: 0b11010,
        13: 0b11011,
        14: 0b11100,
        15: 0b11101,
        'S1': 0b11000,
        'S2': 0b10001,
        'S3': 0b00110,
        'RST1': 0b00111,
        'RST2': 0b11001,
        'EOP': 0b01101}

    Hopefully soon I will have the 2 talking to each other, I think I have most of the pieces... 

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 2 years ago in reply to scottiebabe

    It's great that MicroPython is being used, it's ideal for experimentation like this.

    MicroPython is not bad at all for data manipulation for protocols! I was stuck on a CRC issue a while back (I cant recall the specifics), and it was possible to find a normal Python library, and edit it slightly to function with MicroPython, so there's actually a wealth of potentially useful code that can be used with it, with a bit of tweaking occasionally.

    I hope MicroPython gets closer to real Python so that microcontroller projects benefit more from a lot of regular Python libraries.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • BigG
    0 BigG over 2 years ago in reply to shabaz

    I discovered this interesting project online... which uses lower frequencies etc. Schematics etc included.

    github.com/.../pico-dco

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube