Tutorial : Adding ADC capability to S5D9 IOT board

I have a S5D9 IOT board.  It is very compact.   I want to share my tutorial with the community on how to add ADC capability to the board.   I think that it is very useful if the sensor only has an analog output.

 

In this tutorial, I show 4 examples that covers both r_iic and r_sci_i2c drivers with and without framework.     Here is my blog link with source code available.

https://www.miketechuniverse.com/single-post/2018/03/02/Add-ADC-to-S5D9-IOT-board

 

There are other blogs from me such as adding a distance sensor, a temperature sensor, and a small OLED display that may be useful for your next small project.  Feel free to explore them.

 

Enjoy,

Michael

  • Michael, thanks for the great tutorial. When you were working with ADC and DAC, did you have access to an oscilloscope?

    I'm looking at buying a super cheap hobbyist DIY kit to at least check the signal.  Have you seen the DSO138 kits?

     

    You can get these official kits on Amazon.com for  $24.99.

     

     

    Searching on eBay results in even cheaper clones for $14.98

     

    Here's one example, shipping from the US for $20, free shipping, with the SMD components soldered on.

     

     

    Here's the specs on it.

     

    Maximum real-time sampling rate : 1Msps
    Accuracy : 12Bit
    Sampling buffer depth : 1024 bytes
    Analog bandwidth : 0 - 200KHz
    Vertical Sensitivity : 10mV / Div - 5V / Div ( 1-2-5 progressive manner )
    Adjustable vertical displacement , and with instructions
    Input impedance : 1MΩ
    Maximum input voltage : 50Vpp (1: 1 probe ), 400Vpp (10: 1 probe )
    Coupling modes include DC / AC / GND
    The horizontal time base range : 10μs / Div - 50s / Div ( 1-2-5 progressive manner )
    With automatic, regular and one-shot mode , easy to capture the moment waveform
    Available rising or falling edge trigger
    Adjustable trigger level position , and with instructions
    Observable trigger waveform before ( negative delay )
    Can freeze at any time waveform display (HOLD function )
    Comes 1Hz /3.3V square wave test signal source

     

    Any opinion on this?

  • Look like a great find. An inexpensive kit like this one is great if it works. It is handheld. You can take it anywhere. It seems to be a good one to start. TFT is nice. I like it too!!! It is also available on Amazon.

    I have Digilent Analog Discovery for a few reason for a few years. When your needs grow, this one may be your next scope.

    Digilent Analog Discovery 2 ($279)
    store.digilentinc.com/.../

    1. I can use my large PC monitor (24") to see the details of the and all the digital signals (up to 16 I/O's at a time.)
    2. I can copy the scope waveform into my documentation or emails to others.
    3. Triggers are more advanced than just a signal. It can be protocol and command tiggered.
    4. It has I2C/UART/SPI protocol recognition capability. You can save energy and time from decoding the command/data.
    5. You can create any bus from the 16 digital inputs and display the value in dec/hex/binary format.
    6. It is portable and small. But, it requires that you have a laptop with you.

    I want to mention this one because you can compare it to the inexpensive DSO unit.

    Best regards,
    Michael
  • We can also build a custom DSO with any Synergy MCU. S5 has 6+ ADC inputs and many digital inputs. Put these signals on a larger 8" TFT display. We got interrupts to select the target signals.

    I think that such DIY project with synergy MCU (TB S5D5) is possible. Probably not as fast as the FPGA based design used in Digilent Analog Discovery 2. Yet, the functionality will be very good.
  • Michael, thanks for this great information. I noticed that Eric's blog had a screenshot of the Digilent WaveForms software for their o-scopes. He included it in his article on DAC. I went on the Digilent site and saw that the WaveForms software worked with the Digilent Electronics Explorer and the Analog Discovery. I think Eric may have the same Analog Discovery unit that you have.  It looks like an excellent piece of equipment. I may get that after I progress. The Analog Discovery looks more portable than the Electronics Explorer and should take up less desk space.

     

     

  • That's a cool idea and I was just thinking about that. Do you already have a signal generator? maybe you built one? I think we'll need a signal generator to test the custom DSO with the Synergy MCU. You could use one S5D9 to build the signal generator and then confirm it with the commercial Digilent Analog Discovery unit that you have, then use the signal generator to test the custom S5D9-based DSO that you build.
  • Michael,

    Slightly different topic, though related. Do you ever have any issues with noise and USB cables? I am always sort of surprised when USB cables end up having different quality levels. Have you ever used Ferrite Beads? I am just now investigating snap-on/clamp-on ferrite beads which might be quite cost-effective.

    Jesse
  • Here is a better deal with accessories. $299.

    store.digilentinc.com/.../

    Yes, I believe that Eric is using Analog Discovery. The device is the size of a tea cup plate. It is small and compact enough.
  • It can be done since S5 MCU has both DAC (signal generator) and ADC (analog capture input). The current S5D9 IOT board does not give you access to any of the DAC and ADC pins. So, I would need the S5D5_TB board which I have at home. It is an interesting idea for a future project.
  • I don't know if that helps on USB cable noise. I have used small Ferrite Beads on the output of the voltage regulator and audio amplifier primarily for the inductor (?) noise. I had a mixed result. If a less quality cable had other issues with cross talk, then the problem would surpass what Ferrite Beads can do. Without knowing the nature of the noise is, it is hard to know if it helps.

    Regards,
    Michael
  • We just need access to the Analog pins, right?