element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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
DIY Test Equipment
  • Challenges & Projects
  • Project14
  • DIY Test Equipment
  • More
  • Cancel
DIY Test Equipment
Blog DIY Test Equipment: Ears and Tears 2020 (A Logic Probe)
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join DIY Test Equipment to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: koudelad
  • Date Created: 6 Aug 2017 8:17 PM Date Created
  • Views 2841 views
  • Likes 9 likes
  • Comments 8 comments
  • diytestequipch
  • logic probe
  • psoc 5lp
Related
Recommended

DIY Test Equipment: Ears and Tears 2020 (A Logic Probe)

koudelad
koudelad
6 Aug 2017

Introduction

When I saw Jon's The ByEar 2000, I remembered a Cypress' video showing a construction of an analog alarm and posted that as an comment under his blog post.

PSoCs usually have many integrated analog and digital peripherals, so I thought I could make a compilation of both mentioned projects. I am an amateur, so don't expect scientific explanations or ground-breaking discoveries image I only built this device using a CY8CKIT-050 PSoCRegistered 5LP Development Kit, which is obviously an overkill, but the same can be performed using a much small USB stick kit, featuring PSoC 5LP: CY8CKIT-059 PSoCRegistered 5LP Prototyping Kit With Onboard Programmer and Debugger. Please do not consider this as a finished product, but just as a set of ideas for PSoC beginners.

How does it work

 

Hardware / schematics

Below is the schematics of the whole circuit. I decided to power the circuit by a 3,3 V, meaning it can serve as a programmable logic probe for voltage levels of 3,3 V or lower.

I downloaded a 74LVT125 datasheet to get the LVT families logic levels:

High-level input voltage Vih is supposed to be minimally 2 V.

Low-level input voltage Vil is supposed to be maximally 0,8 V.

 

image

 

Jon has described his circuit very well, so I am just going to list the differences / PSoC 5LP specifics:

  • LogicInput pin is connected to the voltage tested and TonOuput to a buzzer or a speaker.
  • There are two VDAC components and their purpose is to generate a reference voltage for the comparator. These components are programmable in a PSoC 5LP and I have chosen a range of 0 - 4,080 V (16 mV / bit), however, as I am powering the circuit by Vdd = 3,3 V, the maximum reference voltage generated would be Vdd. (The good thing is that PSoC Creator makes you aware of this fact, so it's not a surprise for starting engineers / makers.) One VDAC is set for logic low level 0,8 V and the other for logic high level 2,0 V.

image

  • VDAC outputs are fed into the inverting inputs of the comparators. Input of the logic probe is fed into both of the comparators, but to the non-inverting inputs. The comparators have to decide then, whether the logic input is lower than Vil (and obviously Vih), between Vil and Vih, or above Vih (and Vil, of course). There is one hypothetical fault condition, that the high voltage level comparator will output a logic high, while the low voltage level comparator will ouput a logic low. I hope this won't happen, but the situation will be taken care of by the sound signaling part of the circuit. By the way, the comparators' synchronization is bypassed, so they don't expect to be clocked.

image

 

The rest of the circuit is used to produce a sound output so the user has an idea of the voltage level measured.

 

  • Two PWM modules are used to create two sounds with a different frequency, one for logic high and one for logic low.

image

image

 

  • As you probably noticed, there is an OR gate mixing both of the PWM outputs together. This was just found by an experiment to create a sound that would differentiate from logic low and logic high sound. This could definitely be done many other ways, using more internal PSoC resources.
  • All the outputs are fed into the multiplexer and the meaning is to provide separate channels with all the possible sound outputs, so only one sound buzzer is needed. (This probably isn't the smartest description of a multiplexer usage, right?) The multiplexer has four inputs, the last is not needed, so I connected it to a logic 0, but this input is never used.
  • The fun part is the control function of the multiplexer. We have two comparator outputs and their output combination tells us in which boundaries is the input voltage. This is where a lookup table (LUT) comes in. It is basically a definition of a discrete function. We have two inputs (4 possible states) and need two outputs for controlling which frequency output will be connected to a buzzer. Here is the definition:

image

As I mention before, state 0x02 should never happen, but it's output is the same as if the voltage is between the voltage levels of logic low an logic high. This means that the weird sound produced is "not defined voltage level" or "logic probe is broken" image

 

Software

Now comes the easier part, the PSoC code (main.c):

 

#include "project.h"

int main(void)
{
    CyGlobalIntEnable; /* Enable global interrupts. */


    // Starts both VDACs
    VDAC8_LogicLow_Start();
    VDAC8_LogicHigh_Start();
  
    // Starts both comparators
    Comp_LogicLow_Start();
    Comp_LogicHigh_Start();
    
    // Starts both PWMs
    PWM_LogicLow_Start();
    PWM_LogicHigh_Start();
    
    for(;;)
    { 
      /* Place your application code here. */
    }
}

 

Pretty short, right? I think the device could be put into a sleep mode, but I will leave this as reader's homework.

 

Resources

Here is a screenshot of PSoC 5LP resources used. Please note that the majority of RAM is usually allocated for a stack and heap and can be reduced if not needed.

 

image

 

Conclusion

Using a different PSoC power voltage and different VDAC voltages can be used to adjust the circuit to other voltage levels or needs.

PSoC is very versatile and the circuit can be modified in a countless ways (adding a button to start measurement, one or more LEDs, display, provide some output for testing other circuits ...)

 

Here is a proof of the working prototype. I used the onboard potentiometer to simulate the input voltage level.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

I also attached the project bundle for anyone interested in exploring the design.

 

For readers willing to experiment more with PSoCs 4 (lower series):

100 Projects in 100 Days

PSoCRegistered 101 Video Tutorial Series: How To Use the ARMRegistered CortexRegistered-M0 Based PSoC 4 | Cypress Semiconductor

 

David

Attachments:
LogicProbe.cyprj.Archive01.zip
  • Sign in to reply

Top Comments

  • DAB
    DAB over 7 years ago +3
    I am a big fan of the PSOC. The programmable digital and analog components offers anyone tremendous flexibility for building projects. DAB
  • koudelad
    koudelad over 7 years ago +2
    Thank you tariq.ahmad for the recovery of my post and fixing the video upload.
  • balearicdynamics
    balearicdynamics over 7 years ago +2
    I love PSoC and this project is really great ! Congrat Enrico
  • koudelad
    koudelad over 7 years ago in reply to jc2048

    You are right, Jon.

     

    I ended with these frequencies after some experiments. I wanted to use just two PWMs and easily create 3 possible sounds. Logic low sound using some low frequency sound, logic high signaled with a higher frequency sound and something more like an alarm sound for the forbidden zone voltage.

     

    The third sound could be also added by an additional PWM (there are still plenty resources left), and/or there could be one more very low frequency (for example 2 Hz or similar) PWM just for turning one of the sounds on and off. This would sound more like an alarm.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jc2048
    jc2048 over 7 years ago in reply to koudelad

    I've just noticed that your low tone is extremely low (at least in the screenshots). A period of 50.5mS is a frequency of 19.8Hz. It's right at the limit of what you can hear as a continuous tone rather than a series of clicking noises.

     

    Your high tone is 396Hz which is more reasonable (it's approx G4, so just above middle C).

     

    Your sounder, depending what it actually is, would probably be much more efficient (ie make more noise) if you increased both. A 2:1 ratio in frequency is a whole musical octave - so you can afford to have the tones much closer together.

     

    If you like it the way you've got it, then fine. Thought I'd point it out just in case anyone wanted to use what you've done - they might want to experiment with the tones a bit.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 7 years ago

    I am a big fan of the PSOC.

     

    The programmable digital and analog components offers anyone tremendous flexibility for building projects.

     

    DAB

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • koudelad
    koudelad over 7 years ago in reply to jc2048

    Thank you for the comments.

     

    By the way, there is an API for the VDAC, (specifically function VDAC8_SetValue() ) meaning the output value can be adjusted during the firmware execution. Equipped with a small display and a few buttons, everything could be controlled on the fly. This logic probe is just a simple example, but PSoC 5LP has definitely more power to be a low speed scope for hobbyist purposes etc.

     

    As I mentioned earlier, the only barrier is my knowledge of analog and digital circuit design. If you know, what you want to achieve, then using a PSoC is a matter of a few clicks and programming a "classic" microcontroller.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jw0752
    jw0752 over 7 years ago

    Very nice project and well done. I am really enjoying the DIY test project posts.

    John

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • 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