The Pico is about $5 in Australia. Wow! For such a complex board I can't believe how cheap it is. Definitely worth getting some of these for a few projects. Technology advancements like this are amazing. Great examples, thank you!!
Fantastic Pico beginners guides - please keep on teaching us this new platform .... Too many channels would have edited out or skipped over the "mistakes" - the fact you leave them in proves what a great teacher you are as it is the mistakes that can teach you the most ....
It went wrong because the last row rows did not had a tab. It sticks in the loop and does not execute the last 2 lines. Python is tab sensitive.
4 роки тому+4
It was indentation - either spaces or a tab. In Python you can use either spaces or tabs but never mix them. Indentation is a very important part of Python's syntax - it marks blocks of code like {} in C or shell.
I think this board will take off big time! It helps that its big brother is the pi! Another learning curve to negotiate with the python family of languages but it seems to be the way forward! Look forward to seeing what the community comes up with in the way of standalone projects.
Love it. Temperature recording led lighting and button boxes are my thing. Very excited about this cheap board. Especially as I can get non clones from Australia.
Man this pico looks powerful and micro python looks easy to work with I cannot wait to get one of these. I look forward to more videos on this thing even with the new language hiccups. Great video Paul, this is great new fun.
@@learnelectronics oh man I’ve been spending less time on UA-cam and more time at the electronics bench. I’ve been working on a synthesizer using a as3340 and a few cd4000 series logic chips it’s been fun but frustrating, I keep ending up with inconsistent volume levels from different chips. I think I just need to get a bunch of op-amps and buffer all of the outputs from every chip so I can get the basic sounds working and then I have a bunch to learn about the different filters I’m going need down the road. Maybe one day I’ll have it functioning enough to get some boards made up, well that’s the hope.
I'm not trying to stop you from buying one, I bought one myself. But just in case you already own a Esp8266, Esp32, STM32 or so, you can use them with Thonny and Micropython too.
I did this on, in F, and would like to see more beginner Pico videos soon. Possibly with different types of motors? or a Humidity sensor with an LCD readout? in Python.
I doubt you’re going to find it in stock anywhere right now. The demand is just so high that you’ll just have to wait and snatch one up from the next batch.
Thanks for the video, I had already tried this but found that the accuracy using the calculation supplied was terrible, about 4/5 degrees out. Did it feel like 14 Degrees C in your workshop? I would rather use an external DS18B20 but I don't think the onewire library is implemented yet? **Update **. I switched to Circuitpython as it has a onewire library and a Ds18x20 library.
I want something I can build a guitar effects pedal switcher. Something I can program, then when you step,on a switch it will turn on and off a preselected set of pedals. Is that possible with these?
There is a button on the “top” side which you need to press sometimes. That would be underneath if you put the headers on the other way round. Looks like the best way is to print off the pin out reference sheet. Do agree it’s a big mistake printing labels on the “bottom” side.
@@willsgrandad I don't do digital so I have no idea. Is that an issue? Can it be pulled from the board, the button pressed, and it programmed, and reinstalled?
Have you ever tried to create a SPWM signal with the Pi Pico. I have this on an AMTEL328P but having difficulties bring it over to the Pi Pico. I'm not a firmware GURU rather a power electronic person. Need some help... Interested?
Great video! You code was correct at first, it was just missing "tabs" on the last 2 lines. Python requires "tabs" for scope (e.g. python saw the last 2 lines as not being in the while loop).
tip! only main.py (your auto run on powerup sketch) and drivers need to be saved on pico, test sketches like this can be saved locally and still run on pico.
Great video but I have one question. If our ADC is 12 bit why do we divide by 65536 and not 4096? I always thought that 12 bit means 2^12 so max "resolution" should be 4096. It looks more like a max value of a variable but that is just a guess.
Due to the granularity of the readings, notice the repeated values where the Temps report the same each time. I would recommend a round up function to the nearest whole number. Not many applications require anything more than this anyway.
Now if Raspberry Pi could shrink the Zero into that form factor while keeping the CSI connector, the 1Ghz processor and 512mb ram, it would have a load of us super excited, there is a whole community using the Zero for digital HD FPV in our RC Craft :)
I just tried the same program on my pico. Mine shows about 3 deg Celsius too low. It's just a guess, but I can imagine the temperature is in the chip because its purpose usually is to measure the core temperature and protect the chip from overheating. As Pico users might be more interested in the ambient temperature, that weird factor is probably rather an estimation than a real calculation of the temperature outside the chip.
I say not in his neighborhood. It's been at least a month since we have seen that high of a temp outside. I live within 50 miles / 80km of Paul. This morning I went for an inline skate and it was around -5C / 23F.
@@drescherjm I had no idea where Paul lives. I live in Stockholm, Sweden. Here it's about -10C outside. The program in the video that shows the temp is listed in the "Get started with Micropython" book. I run the same program and got approximately the same temperatures. Guess the calibration is a bit off...
@@sssxxxttt hmmm. I get mixed up if I try a different keyboard. Particularly y and z and all the signs/punctuation marks. They're all over the place on a German keyboard. Initially I had an English layout - I guess US actually - but eventually changed to the German one and learnt it.
@@alistairgill5538 Agree, but I get that problem every time my employer issues me a new laptop. The keyboards are never the same. Admitted I don't get to immerse into programming as I once did, but it's obvious the symbols chosen are much more convenient on a us-layout.
Great video Paul! Looks like the temperature is reading low (14C ?); I doubt you were in a room at that temperature, brrr! Is there a way to calibrate the temperature sensor?
Thank for this. Problem though Pico says it's 24C Thermometer says 17.5? Any idea?What I have typed (which hopefully is the same as yours but I am dyslexic!):import machine import utime sensor_temp = machine.ADC(4) conversion_factor = 3.3/(65535) while True: reading = sensor_temp.read_u16()*conversion_factor temperature = 27 - (reading-0.706)/0.001721 print(temperature) utime.sleep(2)
From my understanding it's giving you the internal CPU temperature, not an environmental reading unfortunately. The thermistor diode is inside the die. However his CPU was cold because of his environment, if he ran a tight loop for a while it would soon jump up
temperature = 32.3 - (reading - 0.706) / 0.001721 seems to match the temperature reading of my AstroAI multimeter. temprature can easily been displayed in Celsius and Fahrenheit like this: celsius = 32.3 - (reading - 0.706) / 0.001721 fahrenheit = celsius * 1.8 + 32 print("{} Celsius / {} Fahrenheit.".format(celsius, fahrenheit))
Wow, another video with perfect python code just one day later. That looks like someones ego got a bit hurt he learned micropython all night long after Thonny didnt like C code the other day ;-) I like that "pretty simple" comment after the first two lines ;-) It's true, typing those 4 words is pretty simple, at least after finding out they are needed and what they are good for. The first time I looked at micropython, I entered all the import commands I found in the documetation into my boot.py. I thought this way I never need to remember and type them again ;-)
Nice video. Maybe it's my lack of imagination but without wifi, bluetooth. lora interface what use is the pico as an isolated device? I mean just printing the temperature to a screen doesn't seem exceptionally useful. Thanks :)
My first application is to replace the thermostat in a small under-counter refrigerator. The Pico is $2 and a two relay expansion board was $4 at Micro Center. Six dollars to replace a $16 dollar mechanical unit... (Excludes power supply - of which I have too many)
11:04 It was an indentation mistake : the last two lines ( "print(temperature)" and "utime.sleep(2)" ) were not indented and thus were out of the "While True" loop. And of course, since the "While True" loop is infinite, anything written after that is never going to execute. Also, I higly suggest you to take the habit of using TAB for indent and not a single space like you did. It might be wierd at first but trust me, in the long run it will save you a lot of headaches if you're serious about micropython/python =)
Your working environment it 14C? You must be made of strong stuff indeed, perhaps there's a mistake somewhere with the temperature read out. HOWEVER, I enjoyed the video and learned something in the process, thanks.
why didn't they design the pico pins to be silkscreened? very amateur. Can you use vscode instead of thonny or is thonny required ide? also , you may want to semicolon the end of each line.
Hi Paul, thanks very much for the videos on programming the Pico. When you have used it for a bit longer, maybe you could do a video on how it compares to the Arduino Nano in terms of performance, versatility, interfacing, ease of use etc? Seems that on paper, the Pico is way better.
Whilst it does indeed change with ambient temperature, the actual reading obtained by this method is grossly inaccurate. Either the equation is incorrect, or some reference voltage or current needs to be correctly set. Surely it wasn't 14°C in your lab, and your heat gun would have been hotter than 20°C?!
The whole process of the programming the pico is in nessasary messy. They need a ide that allow for Arduino library use. And eases upload seamlessly. I don't think trying to beat Arduino on price will work without the ease that Arduino brings in seemless upload of programing with its massive library's and ide. Pico will need to bring more to the game then price. As if your programming in micropython for microcontroling then you could pick up an raspberry pi2 cheap and use that then buying a pico. Sorry I'm a microelectronic engineer and the block to using a microcontroller for electronic control shouldn't be blocked by very few library's and programs and a messy upload and programming method. I know I'm gonna get gait for this but it's true. Raspberry have spent too much time on the board and for got the pc side software interface.
there is also a massive micropython library of sensor drivers, and it's a lot easier to add/alter the driver if its not quite how you like it. it can also be programmed in C ! and through arduino ide soon
Have I understood it correctly that single step debugging is possible? That would make me consider a pico instead of the arduino. Of course it is possible to use the atmel IDE with the arduino but that is another level of complexity. For my purposes, the arduino and simplicity of the IDE is fine.
@@alistairgill5538 I'm finding micropython Fairly easy to get to grips with after using arduino, definitely a lot easier to edit code, and of course you got the added advantage of the REPL so you can run commands directly, Think back to 8bit computers like the commodore 64, you use the editor window like typing in a program with line numbers and the REPL (output window) for direct commands (no line numbers) is the easiest way to explain how micropython works
@@garymetheringham4990 I never used the commodore but Basic in DOS. (Thanks to Bill). So the idea of running immediate commands is familiar. That's a while ago! But a good debugger setting breakpoints and checking register and variable values is really important for debugging more complex algorithms.
I love to watch you work your way thru the errors until success. There are so many quotes abt learning more from failure than from success.
It’s shows that there is truly a human behind the camera, I prefer it this way too!
The Pico is about $5 in Australia. Wow! For such a complex board I can't believe how cheap it is. Definitely worth getting some of these for a few projects. Technology advancements like this are amazing. Great examples, thank you!!
Fantastic Pico beginners guides - please keep on teaching us this new platform ....
Too many channels would have edited out or skipped over the "mistakes" - the fact you leave them in proves what a great teacher you are as it is the mistakes that can teach you the most ....
Your python has gotten much better in the last couple of days!
It went wrong because the last row rows did not had a tab. It sticks in the loop and does not execute the last 2 lines.
Python is tab sensitive.
It was indentation - either spaces or a tab. In Python you can use either spaces or tabs but never mix them. Indentation is a very important part of Python's syntax - it marks blocks of code like {} in C or shell.
I came here to say something similar.
Oops! I just said the same thing above, before reading this. Great video!
Pretty nice. Now all I need is a Pico. Thanks, Paul.
You are lucky. You got one! In Germany it is sold out. Great that you jumped right onto this new toy and teach us how to use it.
If can have a look at RTC part of it too
I buied the pico on this weekend and the video help me understand how the internal sensor works! thank very much!
I think this board will take off big time! It helps that its big brother is the pi! Another learning curve to negotiate with the python family of languages but it seems to be the way forward! Look forward to seeing what the community comes up with in the way of standalone projects.
I too was wondering if you were working in fridge. Cool video! And, absolutely right, everything is better with cheese :)
Love it.
Temperature recording led lighting and button boxes are my thing.
Very excited about this cheap board. Especially as I can get non clones from Australia.
Man this pico looks powerful and micro python looks easy to work with I cannot wait to get one of these. I look forward to more videos on this thing even with the new language hiccups. Great video Paul, this is great new fun.
Thanks Mike. How are you these days?
@@learnelectronics oh man I’ve been spending less time on UA-cam and more time at the electronics bench. I’ve been working on a synthesizer using a as3340 and a few cd4000 series logic chips it’s been fun but frustrating, I keep ending up with inconsistent volume levels from different chips. I think I just need to get a bunch of op-amps and buffer all of the outputs from every chip so I can get the basic sounds working and then I have a bunch to learn about the different filters I’m going need down the road. Maybe one day I’ll have it functioning enough to get some boards made up, well that’s the hope.
Wholesome content and a little muddling through it, so it looks like even I can do it. Mines coming in a few days:)
Good luck!
i like your vids, i got my pico's last week but havent had time to play yet.
Very cool, I have been thinking about investing in one of these boards.
Thanks mate.
I'm not trying to stop you from buying one, I bought one myself. But just in case you already own a Esp8266, Esp32, STM32 or so, you can use them with Thonny and Micropython too.
Great video, just what I was looking for, thank you.
How many readings per second is it capturing? And can that number be increased
Your videos are always knowledgeable I like it Sir 👍
Thanks Paul, appreciate the videos. Keep up the good work/content!!
you are a genius i have learned so much to day
I did this on, in F, and would like to see more beginner Pico videos soon. Possibly with different types of motors? or a Humidity sensor with an LCD readout? in Python.
Great videos/.tutorials. I am enjoying these plus also learning a lot as well :)
how do i do it in f?
Great demonstration Paul. Anyone know if utime.sleep is blocking (like Arduino delay)?
Thanks Paul.... any suggestions on where to find a ras pico. Amazon and Banggood seem sparse. Thanks
I doubt you’re going to find it in stock anywhere right now. The demand is just so high that you’ll just have to wait and snatch one up from the next batch.
Not sure where you are in the world.
However, multiple sellers have them on EBAY UK.
I picked up a few yesterday at Micro Center in Yonkers, NY. They were available for $2.00 US each - so I bought three.
is it possible to read a camera from the usb?
Thanks for the video, I had already tried this but found that the accuracy using the calculation supplied was terrible, about 4/5 degrees out. Did it feel like 14 Degrees C in your workshop? I would rather use an external DS18B20 but I don't think the onewire library is implemented yet?
**Update **. I switched to Circuitpython as it has a onewire library and a Ds18x20 library.
I want something I can build a guitar effects pedal switcher. Something I can program, then when you step,on a switch it will turn on and off a preselected set of pedals. Is that possible with these?
Can you flip the board and solder the header to the other side?
There is a button on the “top” side which you need to press sometimes. That would be underneath if you put the headers on the other way round. Looks like the best way is to print off the pin out reference sheet. Do agree it’s a big mistake printing labels on the “bottom” side.
@@willsgrandad I don't do digital so I have no idea. Is that an issue? Can it be pulled from the board, the button pressed, and it programmed, and reinstalled?
How to calibrate it? Mine reads 15.5 C in my study and I know the temperature is about 19 - 20
Is this onboard temperature sensor good for measuring room temperature?
Not particularly unless you take into account the heat of the chip
Hey! Just a question, does this give us the room temperature? Because my room surely is at 30 C and it shows just 22 C.
Have you ever tried to create a SPWM signal with the Pi Pico. I have this on an AMTEL328P but having difficulties bring it over to the Pi Pico. I'm not a firmware GURU rather a power electronic person. Need some help... Interested?
you had the print outside of the while true statement, so it never got to that portion of the code.
Awesome vídeo!
I was wondering if is possible to Connect an external thermistor. For measure an external temperature
Thank you so much!
Yes, absolutely
@@learnelectronics could you upload a tutorial ? You would help me a lot! Thank you
Great video! You code was correct at first, it was just missing "tabs" on the last 2 lines. Python requires "tabs" for scope (e.g. python saw the last 2 lines as not being in the while loop).
tip! only main.py (your auto run on powerup sketch) and drivers need to be saved on pico, test sketches like this can be saved locally and still run on pico.
Great video but I have one question. If our ADC is 12 bit why do we divide by 65536 and not 4096? I always thought that 12 bit means 2^12 so max "resolution" should be 4096. It looks more like a max value of a variable but that is just a guess.
The pico library expands it to a full 16 bit value. This way future boards with higher ADC resolution will still be compatible with older code.
@@ExpectMichael Oh ok I understand. Thank you for reply!
Temperature reading of 14°C is about 57°F. Are you in an unheated space or did you just take the Pico out of the fridge?
Open window
Due to the granularity of the readings, notice the repeated values where the Temps report the same each time. I would recommend a round up function to the nearest whole number. Not many applications require anything more than this anyway.
Thank you, Paul. waiting next video
Now if Raspberry Pi could shrink the Zero into that form factor while keeping the CSI connector, the 1Ghz processor and 512mb ram, it would have a load of us super excited, there is a whole community using the Zero for digital HD FPV in our RC Craft :)
14 deg Celcius = 57 deg F. Doing this outdoor? :)
he is a polar bear ;+)
ikr, must've been freezing 'is bollocks off; my biggest takeaway from this video: this guy is a mad lad lol
I just tried the same program on my pico. Mine shows about 3 deg Celsius too low.
It's just a guess, but I can imagine the temperature is in the chip because its purpose usually is to measure the core temperature and protect the chip from overheating.
As Pico users might be more interested in the ambient temperature, that weird factor is probably rather an estimation than a real calculation of the temperature outside the chip.
I say not in his neighborhood. It's been at least a month since we have seen that high of a temp outside. I live within 50 miles / 80km of Paul. This morning I went for an inline skate and it was around -5C / 23F.
@@drescherjm I had no idea where Paul lives. I live in Stockholm, Sweden. Here it's about -10C outside.
The program in the video that shows the temp is listed in the "Get started with Micropython" book. I run the same program and got approximately the same temperatures.
Guess the calibration is a bit off...
great stuff man
Hello! Why does the temp appear to be off? I'm assuming it was not actually 14°C in your shop - that's 57°F
I can see why Python is popular as a programming language. Particularly, on German keyboard you have to do fancy gymnastics to get to curly brackets.
I was so happy when usb keyboards were introduced. One can have an us for programming and an european keyboard for documenting/mail.
@@sssxxxttt hmmm. I get mixed up if I try a different keyboard. Particularly y and z and all the signs/punctuation marks. They're all over the place on a German keyboard. Initially I had an English layout - I guess US actually - but eventually changed to the German one and learnt it.
@@alistairgill5538 Agree, but I get that problem every time my employer issues me a new laptop. The keyboards are never the same. Admitted I don't get to immerse into programming as I once did, but it's obvious the symbols chosen are much more convenient on a us-layout.
Great video Paul! Looks like the temperature is reading low (14C ?); I doubt you were in a room at that temperature, brrr! Is there a way to calibrate the temperature sensor?
You mixed bits and bytes. The AD converter has a maximum value of 4096 - 1 because it has 12 bits.
Sorry. I confused you pronunciation of "but" for byte.
Sorry I confused your pronunciation of "but" for "byte"
Did you and Ben Heck coordinate this??
Never talked to him, I would love to work with though.
I think it's very cool. How about putting an Ice cube on the sensor to check its calibration?
Thanks Paul. Peace.
Thank for this. Problem though Pico says it's 24C Thermometer says 17.5? Any idea?What I have typed (which hopefully is the same as yours but I am dyslexic!):import machine
import utime
sensor_temp = machine.ADC(4)
conversion_factor = 3.3/(65535)
while True:
reading = sensor_temp.read_u16()*conversion_factor
temperature = 27 - (reading-0.706)/0.001721
print(temperature)
utime.sleep(2)
From my understanding it's giving you the internal CPU temperature, not an environmental reading unfortunately. The thermistor diode is inside the die.
However his CPU was cold because of his environment, if he ran a tight loop for a while it would soon jump up
temperature = 32.3 - (reading - 0.706) / 0.001721
seems to match the temperature reading of my AstroAI multimeter.
temprature can easily been displayed in Celsius and Fahrenheit like this:
celsius = 32.3 - (reading - 0.706) / 0.001721
fahrenheit = celsius * 1.8 + 32
print("{} Celsius / {} Fahrenheit.".format(celsius, fahrenheit))
Wow, another video with perfect python code just one day later. That looks like someones ego got a bit hurt he learned micropython all night long after Thonny didnt like C code the other day ;-)
I like that "pretty simple" comment after the first two lines ;-) It's true, typing those 4 words is pretty simple, at least after finding out they are needed and what they are good for.
The first time I looked at micropython, I entered all the import commands I found in the documetation into my boot.py. I thought this way I never need to remember and type them again ;-)
Thank you for your great vids 👍 one question, when I skip the 5 to 7 seconds ads do you still get paid for them 🤔 keep up the great work 👍
Get Prime. No ads.
I honestly don't know. Don't worry about. Your skipping at most costs me 0.00001 cents. I can take it. Thanks for watching, and thinking of me.
Thank You
python whitespace will getcha
yes please continue on :-)
Nice video.
Maybe it's my lack of imagination but without wifi, bluetooth. lora interface what use is the pico as an isolated device?
I mean just printing the temperature to a screen doesn't seem exceptionally useful.
Thanks :)
You can take the temperature as an input, Have device process it and then activate other pins as an output either activating relays or other displays
My first application is to replace the thermostat in a small under-counter refrigerator. The Pico is $2 and a two relay expansion board was $4 at Micro Center. Six dollars to replace a $16 dollar mechanical unit... (Excludes power supply - of which I have too many)
@@Biser10562 nice, is there a relay expansion board for the pico?
11:04 It was an indentation mistake : the last two lines ( "print(temperature)" and "utime.sleep(2)" ) were not indented and thus were out of the "While True" loop. And of course, since the "While True" loop is infinite, anything written after that is never going to execute.
Also, I higly suggest you to take the habit of using TAB for indent and not a single space like you did. It might be wierd at first but trust me, in the long run it will save you a lot of headaches if you're serious about micropython/python =)
Yep
@@learnelectronics Also left 'sleep" out after utime
Well presented and explained, easy to follow
Tile: How to read the temperature sensor on the Raspberry Pi Pico
Me: From left to right.
Your working environment it 14C?
You must be made of strong stuff indeed, perhaps there's a mistake somewhere with the temperature read out.
HOWEVER, I enjoyed the video and learned something in the process, thanks.
The window was open. I burnt up a rectifier and was venting the fumes.
Merci 😉
I thought the pico had a onboard temperature sensor.
Paul, yes that’s cool. Now let’s work on a graph or dial.
Lookout Nest!
Adafruit seems to be out of them.
Big github page of examples - github.com/raspberrypi/pico-examples
why didn't they design the pico pins to be silkscreened? very amateur. Can you use vscode instead of thonny or is thonny required ide? also , you may want to semicolon the end of each line.
You can program over USB serial if you want
Hi Paul, thanks very much for the videos on programming the Pico. When you have used it for a bit longer, maybe you could do a video on how it compares to the Arduino Nano in terms of performance, versatility, interfacing, ease of use etc? Seems that on paper, the Pico is way better.
👏👏👏
Whilst it does indeed change with ambient temperature, the actual reading obtained by this method is grossly inaccurate. Either the equation is incorrect, or some reference voltage or current needs to be correctly set. Surely it wasn't 14°C in your lab, and your heat gun would have been hotter than 20°C?!
fahrenheit = (celsius * 1.8) + 32
you live in a fridge?
Window was open
@@learnelectronics -12 Celsius in Oslo now. Outside.
Makes Arduino look easy...lol
The whole process of the programming the pico is in nessasary messy. They need a ide that allow for Arduino library use. And eases upload seamlessly. I don't think trying to beat Arduino on price will work without the ease that Arduino brings in seemless upload of programing with its massive library's and ide. Pico will need to bring more to the game then price. As if your programming in micropython for microcontroling then you could pick up an raspberry pi2 cheap and use that then buying a pico. Sorry I'm a microelectronic engineer and the block to using a microcontroller for electronic control shouldn't be blocked by very few library's and programs and a messy upload and programming method. I know I'm gonna get gait for this but it's true. Raspberry have spent too much time on the board and for got the pc side software interface.
there is also a massive micropython library of sensor drivers, and it's a lot easier to add/alter the driver if its not quite how you like it. it can also be programmed in C ! and through arduino ide soon
Have I understood it correctly that single step debugging is possible? That would make me consider a pico instead of the arduino. Of course it is possible to use the atmel IDE with the arduino but that is another level of complexity. For my purposes, the arduino and simplicity of the IDE is fine.
@@alistairgill5538 I'm finding micropython Fairly easy to get to grips with after using arduino, definitely a lot easier to edit code, and of course you got the added advantage of the REPL so you can run commands directly,
Think back to 8bit computers like the commodore 64, you use the editor window like typing in a program with line numbers and the REPL (output window) for direct commands (no line numbers) is the easiest way to explain how micropython works
@@garymetheringham4990 I never used the commodore but Basic in DOS. (Thanks to Bill). So the idea of running immediate commands is familiar. That's a while ago! But a good debugger setting breakpoints and checking register and variable values is really important for debugging more complex algorithms.