Go to advanced search

by rasp14
Wed Oct 20, 2021 4:05 am
Forum: General
Topic: How to Handle External Noises That Affects Input Reading?
Replies: 15
Views: 878

Re: How to Handle External Noises That Affects Input Reading?

Writing my solution for future reference of other users. In the end, I managed to tackle the noise issue by using a LM393 Op Amp. The input pin on Pico is pulled up and connected to LM393 output, Vcc connected to Pico Vbus (5V), The input I want to monitor are connected to the inverting input of LM3...
by rasp14
Sat Sep 11, 2021 8:29 am
Forum: General
Topic: How to Handle External Noises That Affects Input Reading?
Replies: 15
Views: 878

Re: How to Handle External Noises That Affects Input Reading?

Joke aside... assume I can't change anything on my home. What else I can add on my Pico to reduce the effect of noise coming from the light?
by rasp14
Sat Sep 11, 2021 6:52 am
Forum: General
Topic: How to Handle External Noises That Affects Input Reading?
Replies: 15
Views: 878

Re: How to Handle External Noises That Affects Input Reading?

gordon77 wrote:
Sat Sep 11, 2021 6:26 am
Replace the fluorescent with an led ? ;)
Expensive lol
by rasp14
Sat Sep 11, 2021 5:32 am
Forum: General
Topic: How to Handle External Noises That Affects Input Reading?
Replies: 15
Views: 878

Re: How to Handle External Noises That Affects Input Reading?

I've tried added a 0.1uF ceramic capacitor to my input pin, seems like it is not helping to filter out the noise. I've identified the source of the noise though, it's a old fluorescent light with choke and starter. Other LED lights did not affect my Pico reading when turned on or off. When ever some...
by rasp14
Wed Sep 01, 2021 12:28 pm
Forum: General
Topic: How to Handle External Noises That Affects Input Reading?
Replies: 15
Views: 878

Re: How to Handle External Noises That Affects Input Reading?

It depends on the resistance values in the voltage divider, and the width of the pulses you are trying to filter; you can do a rough calculation as follows: If you are using, say, 10K and 20K resistors in your voltage divider, the effective net resistance = (10 x 20) / (10 + 20) = 6.67 K. If you pu...
by rasp14
Tue Aug 31, 2021 4:49 pm
Forum: General
Topic: How to Handle External Noises That Affects Input Reading?
Replies: 15
Views: 878

How to Handle External Noises That Affects Input Reading?

I'm monitoring a 5V input falling edge event using Pico. Added a voltage divider that output a 3.3V and connect it to the gpio on Pico. Everything works as intended until some one in my house flip a switch and my Pico picked up a lot of falling edge events. So i suspect this is some sort of noise is...
by rasp14
Wed Aug 18, 2021 3:03 pm
Forum: SDK
Topic: Using std::atomic In Pico To Write To Object Safely
Replies: 5
Views: 432

Re: Using std::atomic In Pico To Write To Object Safely

std::mutex and friends from the C++ standard library are not supported (or indeed include by GCC). GCC has no idea how to implement such a thing on a bare metal system. The Pico SDK provides C level APIs for mutexes etc. https://raspberrypi.github.io/pico-sdk-doxygen/group__pico__sync.html that you...
by rasp14
Wed Aug 18, 2021 12:23 pm
Forum: SDK
Topic: Using std::atomic In Pico To Write To Object Safely
Replies: 5
Views: 432

Re: Using std::atomic In Pico To Write To Object Safely

std::atomic here only "protects" your pointer. Only reads and writes of the pointer itself will be synchronized correctly. Function calls involving this pointer (including methods) may still be executed in both cores at a time and perform ops to the std::vector in parallel which is undefi...
by rasp14
Wed Aug 18, 2021 7:47 am
Forum: SDK
Topic: Using std::atomic In Pico To Write To Object Safely
Replies: 5
Views: 432

Using std::atomic In Pico To Write To Object Safely

I'm not sure whether I understand the concept of std::atomic correctly, please point out if I did this the wrong way. My PICO is listening to I/O events (rising and falling edge) and sending a response string to USB when an event occurred. At the same time, the computer connected my PICO might send ...
by rasp14
Thu Aug 05, 2021 7:31 am
Forum: General
Topic: Need advice, to detect external power using Pico + Op Amp
Replies: 15
Views: 841

Re: Need advice, to detect external power using Pico + Op Amp

You would probably be better to use an opto-isolator. You might get away with running the LED from 5-24V with a large dropper resistor. It would be quite dim at 5V, but maybe sufficient to turn on the output transistor. Or you could try this circuit (or some variant) which sets up a current source ...
by rasp14
Thu Aug 05, 2021 7:23 am
Forum: General
Topic: Need advice, to detect external power using Pico + Op Amp
Replies: 15
Views: 841

Re: Need advice, to detect external power using Pico + Op Amp

There was already the proposal nick.mccloud to use a voltage divider to scale down the 24V to pico usable 3.3V max. Use an ADC input and calculate voltage level... Here are the answers: - DC or AC ? DC, but it will switch from 5V to 24V depends on the machine. - how much current can you draw from t...
by rasp14
Thu Aug 05, 2021 3:17 am
Forum: General
Topic: Need advice, to detect external power using Pico + Op Amp
Replies: 15
Views: 841

Re: Need advice, to detect external power using Pico + Op Amp

I doubt many op-amps will compare at its supply voltage properly, also overdriving the input of the op-amp to that extent is probably not good. Specifically an LM741 is not a rail-to-rail op-amp and should not have input voltages greater than the supply voltage. Also a LM741 will not work at 3.3V. ...
by rasp14
Thu Aug 05, 2021 2:56 am
Forum: General
Topic: Need advice, to detect external power using Pico + Op Amp
Replies: 15
Views: 841

Re: Need advice, to detect external power using Pico + Op Amp

If the voltage source can deliver a few mA a simple resistor divider will do the job just as well. See https://ohmslawcalculator.com/voltage-divider-calculator - 35k & 5k should do nicely. I mentioned the external power is varying, it could be 5V, it could be 24V, it's not fixed. When the volta...
by rasp14
Wed Aug 04, 2021 3:32 pm
Forum: General
Topic: Need advice, to detect external power using Pico + Op Amp
Replies: 15
Views: 841

Need advice, to detect external power using Pico + Op Amp

I got an external power cable with varying voltage from minimum 5V to maximum 24V. I want Pico to detect the existence of the power regardless of the input voltage. If input voltage is 0V, then Pico input GPIO will return 0. If input voltage is 5V~24V, then Pico input GPIO will return 1. I think I c...
by rasp14
Wed Jul 28, 2021 3:03 pm
Forum: General
Topic: Pi Pico - the most user un-friendly MCU?
Replies: 323
Views: 16442

Re: Pi Pico - the most user un-friendly MCU?

May i suggests a sticky thread to put together a list of available and working build methods for Windows? At least in future people who have problems building on Windows can refer to it and they can decide which build methods they want to use. When i started out on Pico i wish i had that list, that ...
by rasp14
Sat Jul 17, 2021 5:20 am
Forum: General
Topic: Pi Pico - the most user un-friendly MCU?
Replies: 323
Views: 16442

Re: Pi Pico - the most user un-friendly MCU?

Hey OP. I'm a Windows based dev as well. Just wanted to give you an alternative that might improve your experience. I used docker to prepare the build environment required for PICO, it make my experience on development and build process for pico easier on Windows. I wrote an instruction a few days a...
by rasp14
Fri Jul 16, 2021 2:09 am
Forum: SDK
Topic: [Tutorial] Building UF2 Via Docker For Windows User
Replies: 18
Views: 1053

Re: [Tutorial] Building UF2 Via Docker For Windows User

Still errors, now related to cmake. Besides it consumes a lot of disk space - now I see 3 images(?) each of them of 1.8GB. Not to mention pretty high CPU usage. I think it's not good for me. Linux based SDK works fast. Thank you for the assistance. Sorry for bothering you. You can remove the image ...
by rasp14
Thu Jul 15, 2021 11:12 am
Forum: SDK
Topic: [Tutorial] Building UF2 Via Docker For Windows User
Replies: 18
Views: 1053

Re: [Tutorial] Building UF2 Via Docker For Windows User

Step 5/5 : RUN cmake .. && make picosource1 && make picosource2 ---> [Warning] The requested image's platform (linux/arm) does not match the detected host platform (linux/amd64) and no specific platform was requested ---> Running in 3bc068180797 CMake Error: The source directory &qu...
by rasp14
Wed Jul 14, 2021 1:28 pm
Forum: SDK
Topic: [Tutorial] Building UF2 Via Docker For Windows User
Replies: 18
Views: 1053

Re: [Tutorial] Building UF2 Via Docker For Windows User

I am networking guy and use docker for network simulation, e.g. gns3 + arista containers under Linux/docker and it works fine-low cpu usage. Hey I just want to let you know disabling the buildkit in daemon.json file works for me. Assuming you are using Docker Windows desktop version v20.10.7. You c...
by rasp14
Wed Jul 14, 2021 12:53 pm
Forum: SDK
Topic: [Tutorial] Building UF2 Via Docker For Windows User
Replies: 18
Views: 1053

Re: [Tutorial] Building UF2 Via Docker For Windows User

Thank you. Will try. What about the cpu usage in your case? My I7 with 32GB slows down a little bit. Same for me, I'm on i5 16GB. It did increase while running the build. I guess it is normal because when I run other kind of container in my machine the CPU usage will increase anyway. This is someth...
by rasp14
Wed Jul 14, 2021 12:40 pm
Forum: SDK
Topic: [Tutorial] Building UF2 Via Docker For Windows User
Replies: 18
Views: 1053

Re: [Tutorial] Building UF2 Via Docker For Windows User

If could use real blinky example I'd be grateful. I managed to replicate the issue in my machine, seems like when it build it will pull image meta data regardless whether the specified image in Dockerfile is available locally or not. The fact that this escape me is because I'm using a private regis...
by rasp14
Wed Jul 14, 2021 11:43 am
Forum: SDK
Topic: [Tutorial] Building UF2 Via Docker For Windows User
Replies: 18
Views: 1053

Re: [Tutorial] Building UF2 Via Docker For Windows User

Tried but failed. Wanted to build blink example from the PICO examples directory. The original example folder contains the CMakeLists.txt in the blink folder. From your description the file is located in the parent folder. PS C:\Users\abg015\Desktop\PICO-docker\ExampleProject> docker-compose up --b...
by rasp14
Sat Jul 10, 2021 1:16 am
Forum: General
Topic: Help! Need Advice On Circuit I Attached On PICO.
Replies: 9
Views: 452

Re: Help! Need Advice On Circuit I Attached On PICO.

What exactly are you trying to accomplish by connecting it in this way ? If you are just trying to detect the state of the relay, and modify the LED's state based on that, GPIO 14 and 15 don't need to have any connection whatsoever. GPIO15 can sense the relay just fine, and a couple of lines of cod...
by rasp14
Fri Jul 09, 2021 3:57 pm
Forum: SDK
Topic: [Tutorial] Building UF2 Via Docker For Windows User
Replies: 18
Views: 1053

[Tutorial] Building UF2 Via Docker For Windows User

Hello guys, here is a little contribution back to this awesome community, albeit a very small contribution. :) If you are a Windows user like me that lazy to install all these extra IDEs and tools for PICO in you Windows machine, but you still want to be able to build UF2 file anyway? This is a post...
by rasp14
Fri Jul 09, 2021 2:17 pm
Forum: General
Topic: Help! Need Advice On Circuit I Attached On PICO.
Replies: 9
Views: 452

Re: Help! Need Advice On Circuit I Attached On PICO.

drgeoff wrote:
Fri Jul 09, 2021 1:24 pm
NO!!

You are shorting GPIO14 out when the relay contact closes. That could lead to failure of that GPIO and even the whole chip eventually.

Yes. And somehow i didn't notice that. I need to sleep...

Go to advanced search