Getting a DC voltage from the USB connection

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi.

I am a new user of the PSoC family and i'm trying my luck at a small hardware node for temperature and motion monitoring. I was wondering if it is possible to drive the sensor (a DS18B) from the psoc itself onto the breadboard and if so how to do it or where I can read about it.

Thank you.

0 Likes
14 Replies
KyTr_1955226
Level 6
Level 6
250 sign-ins 10 likes given 50 solutions authored

You could use the 5V from the USB line to power the sensor and the PSoC (assuming you're running the PSoC at 5V).  Depends on your current draw of your system though, I think the limit for USB 2.0 is 500mA?

0 Likes

pgrlopes,

You can find a demo project and explanation here:

Component to read DS18B20 digital temperature sensors

The current draw by DS18 is low, so you can source it directly from PSoC pin set to HIGH.

/odissey1

0 Likes
Anonymous
Not applicable

Hello. Yes that's exactly what I am using but because this is my first time ever using this platform I guess I don't understand some basic things. When you say you can source it directly from the PSoC does that mean that I just have to wire the vdda from the psoc to the sensor? Or do I have to drag a VDAC to the schematic, pin it and wire it from there?

Thank you for your answer. Would you mind if I pm you to clarify some other doubts related to that sensor interface?

0 Likes
Anonymous
Not applicable

Yeah my question is a actually even more simple as I don't know how to use that usb line. What pin do I have to wire?

0 Likes

pgrlopes,

I advise you to first read the DS18 component datasheet in the link above, it describes connection of the DS18B20 to the PSoC. The current drawn by DS18 is very small (<4ma peak), you can draw power either from Vddd on the prototyping KIT-059, or even from any pin, which is set to digital output HIGH. The DS18 is a digital sensor - no need for any ADC/DAC, and the custom component (above) does all reading/processing for you.

/odissey1

0 Likes
Anonymous
Not applicable

I understand that. I chose it specifically for being digital and not needing an ADC. I just don't understand how exactly to draw that tension. Do I just wire the vddd pin to the sensor? no need to create a voltage source in the diagram? If so how is it regulated?

Thank you once again.

0 Likes

If using KIT-059 you can draw the power for DS18 from e.g. the Vdd (red arrow). The DS18B20 can accept 3.0-5.5V, all "regulation" is done inside the sensor.

KIT-059.png

look at the schematic, read the datasheet and run the example project. To learn how to swim you have to eh ...start swimming.

OneWire_01.PNG

Anonymous
Not applicable

Well yeah hence the stupid questions i'm asking, just trying to understand the PSoC and how it works.

0 Likes
lock attach
Attachments are accessible only for community members.

Attached is a demo project recompiled for KIT-059.

DS18x1_02.png

DS18x1_01.png

Anonymous
Not applicable

Thanks for the updated example but im still having trouble getting it to work because the data ready flag is always at 1 and I'm not quite sure why. It messes up the logic from the main loop and it just gets stuck in the if clauses because the timer flag never gets changed.

0 Likes

I will check it on weekends.

0 Likes
Anonymous
Not applicable

Thank you. It's definitely nothing on the layout im using with the breadboard as it works fine with an arduino, maybe something related to the psoc 5 lp as this was done in a different version?

Once again thanks for putting in your time to help me out.

0 Likes
lock attach
Attachments are accessible only for community members.

Please find updated working project code below (no changes to the DS18x8 component). Tested using CYKIT-059. I cleaned up clocks in Design Resources, which were expecting USB-UART is being present (a leftover from the old design). This project uses simple UART, thus clocks has to be changed also.

DS18x1_Terminal_01.png

Anonymous
Not applicable

Thank you once again, but it is still not working here. All I get is the counter, there is nothing on the temperature value.

pastedImage_0.png

I'm still not getting a bus presence, when I call the function to send a temperature request it returns 0. Do I need to change anything in the clock value?

EDIT: nevermind any of this. If you happen to be an idiot like me you don't actually need to connect both tx's from the kitprog and the psoc itself, they are already connected. I was shorting my connection to the sensor hence not being able to read anything. It is working fine now, thank you so much for your time.

0 Likes