How to read the temperature sensor on the Raspberry Pi Pico

  Рет қаралды 31,130

learnelectronics

learnelectronics

Күн бұрын

Пікірлер: 123
@TrapShooter68
@TrapShooter68 4 жыл бұрын
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.
@avivarma6564
@avivarma6564 4 жыл бұрын
It’s shows that there is truly a human behind the camera, I prefer it this way too!
@adamarzo559
@adamarzo559 4 жыл бұрын
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!!
@Keeping_IT_Simple
@Keeping_IT_Simple 4 жыл бұрын
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 ....
@MattSimmonsSysAdmin
@MattSimmonsSysAdmin 4 жыл бұрын
Your python has gotten much better in the last couple of days!
@fillempie1501
@fillempie1501 4 жыл бұрын
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 жыл бұрын
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.
@deadly_dave
@deadly_dave 3 жыл бұрын
I came here to say something similar.
@dripcode2600
@dripcode2600 3 жыл бұрын
Oops! I just said the same thing above, before reading this. Great video!
@tav9755
@tav9755 4 жыл бұрын
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.
@opalprestonshirley1700
@opalprestonshirley1700 4 жыл бұрын
Pretty nice. Now all I need is a Pico. Thanks, Paul.
@philipatkinson1532
@philipatkinson1532 4 жыл бұрын
I too was wondering if you were working in fridge. Cool video! And, absolutely right, everything is better with cheese :)
@paulb36utube
@paulb36utube 4 жыл бұрын
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.
@gartmorn
@gartmorn 4 жыл бұрын
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.
@mateus72483
@mateus72483 3 жыл бұрын
I buied the pico on this weekend and the video help me understand how the internal sensor works! thank very much!
@LightningHelix101
@LightningHelix101 4 жыл бұрын
Wholesome content and a little muddling through it, so it looks like even I can do it. Mines coming in a few days:)
@learnelectronics
@learnelectronics 4 жыл бұрын
Good luck!
@anupamvipul233
@anupamvipul233 4 жыл бұрын
If can have a look at RTC part of it too
@gadjetsvideo
@gadjetsvideo 4 жыл бұрын
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.
@Popsimath
@Popsimath 3 жыл бұрын
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.
@mikeoliver3254
@mikeoliver3254 4 жыл бұрын
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
@learnelectronics 4 жыл бұрын
Thanks Mike. How are you these days?
@mikeoliver3254
@mikeoliver3254 3 жыл бұрын
@@learnelectronics oh man I’ve been spending less time on KZbin 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.
@mattantonelli4273
@mattantonelli4273 2 жыл бұрын
you are a genius i have learned so much to day
@stevetobias4890
@stevetobias4890 4 жыл бұрын
Very cool, I have been thinking about investing in one of these boards. Thanks mate.
@jeanyluisa8483
@jeanyluisa8483 4 жыл бұрын
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.
@thetedcor
@thetedcor 4 жыл бұрын
i like your vids, i got my pico's last week but havent had time to play yet.
@carl7221
@carl7221 3 жыл бұрын
Great video, just what I was looking for, thank you.
@michaelpadovani9566
@michaelpadovani9566 4 жыл бұрын
Great demonstration Paul. Anyone know if utime.sleep is blocking (like Arduino delay)?
@robholbert8188
@robholbert8188 4 жыл бұрын
Thanks Paul, appreciate the videos. Keep up the good work/content!!
@paulcabrelli1863
@paulcabrelli1863 4 жыл бұрын
Great videos/.tutorials. I am enjoying these plus also learning a lot as well :)
@DIYwithBatteries
@DIYwithBatteries 4 жыл бұрын
Your videos are always knowledgeable I like it Sir 👍
@MegaNursen
@MegaNursen 3 жыл бұрын
Awesome vídeo! I was wondering if is possible to Connect an external thermistor. For measure an external temperature Thank you so much!
@learnelectronics
@learnelectronics 3 жыл бұрын
Yes, absolutely
@MegaNursen
@MegaNursen 3 жыл бұрын
@@learnelectronics could you upload a tutorial ? You would help me a lot! Thank you
@garymetheringham4990
@garymetheringham4990 4 жыл бұрын
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.
@petersnyder1642
@petersnyder1642 4 жыл бұрын
Thanks Paul.... any suggestions on where to find a ras pico. Amazon and Banggood seem sparse. Thanks
@AWriterWandering
@AWriterWandering 4 жыл бұрын
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.
@garyhardman8369
@garyhardman8369 4 жыл бұрын
Not sure where you are in the world. However, multiple sellers have them on EBAY UK.
@Biser10562
@Biser10562 3 жыл бұрын
I picked up a few yesterday at Micro Center in Yonkers, NY. They were available for $2.00 US each - so I bought three.
@conradh7659
@conradh7659 4 жыл бұрын
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?
@gl0sek
@gl0sek 4 жыл бұрын
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.
@ExpectMichael
@ExpectMichael 4 жыл бұрын
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.
@gl0sek
@gl0sek 4 жыл бұрын
@@ExpectMichael Oh ok I understand. Thank you for reply!
@alistairgill5538
@alistairgill5538 4 жыл бұрын
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.
@sssxxxttt
@sssxxxttt 4 жыл бұрын
I was so happy when usb keyboards were introduced. One can have an us for programming and an european keyboard for documenting/mail.
@alistairgill5538
@alistairgill5538 4 жыл бұрын
@@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.
@sssxxxttt
@sssxxxttt 4 жыл бұрын
@@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.
@dripcode2600
@dripcode2600 3 жыл бұрын
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).
@UncleEngineer
@UncleEngineer 4 жыл бұрын
Thank you, Paul. waiting next video
@nbj77095
@nbj77095 2 жыл бұрын
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?
@devvrattoshniwal8971
@devvrattoshniwal8971 2 жыл бұрын
How many readings per second is it capturing? And can that number be increased
@TheRealTombi
@TheRealTombi 4 жыл бұрын
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.
@kencohagen4967
@kencohagen4967 4 жыл бұрын
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?
@deeptimaanbanerjee6330
@deeptimaanbanerjee6330 2 жыл бұрын
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.
@mattantonelli4273
@mattantonelli4273 2 жыл бұрын
great stuff man
@thebeststooge
@thebeststooge 4 жыл бұрын
Tile: How to read the temperature sensor on the Raspberry Pi Pico Me: From left to right.
@stevefox3763
@stevefox3763 4 жыл бұрын
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 :)
@ivegotpetercriss
@ivegotpetercriss 4 жыл бұрын
Did you and Ben Heck coordinate this??
@learnelectronics
@learnelectronics 4 жыл бұрын
Never talked to him, I would love to work with though.
@oswaldjh
@oswaldjh 4 жыл бұрын
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?
@learnelectronics
@learnelectronics 4 жыл бұрын
Open window
@jeanyluisa8483
@jeanyluisa8483 4 жыл бұрын
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 ;-)
@furrane
@furrane 4 жыл бұрын
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 =)
@learnelectronics
@learnelectronics 4 жыл бұрын
Yep
@brucehanson4147
@brucehanson4147 2 жыл бұрын
@@learnelectronics Also left 'sleep" out after utime Well presented and explained, easy to follow
@niklasnorrthon3125
@niklasnorrthon3125 4 жыл бұрын
14 deg Celcius = 57 deg F. Doing this outdoor? :)
@bassblom
@bassblom 4 жыл бұрын
he is a polar bear ;+)
@MS-ho9wq
@MS-ho9wq 4 жыл бұрын
ikr, must've been freezing 'is bollocks off; my biggest takeaway from this video: this guy is a mad lad lol
@jeanyluisa8483
@jeanyluisa8483 4 жыл бұрын
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.
@drescherjm
@drescherjm 4 жыл бұрын
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.
@niklasnorrthon3125
@niklasnorrthon3125 4 жыл бұрын
@@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...
@BeetleBeetleY
@BeetleBeetleY 4 жыл бұрын
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
@alistairgill5538
@alistairgill5538 4 жыл бұрын
You mixed bits and bytes. The AD converter has a maximum value of 4096 - 1 because it has 12 bits.
@alistairgill5538
@alistairgill5538 4 жыл бұрын
Sorry. I confused you pronunciation of "but" for byte.
@alistairgill5538
@alistairgill5538 4 жыл бұрын
Sorry I confused your pronunciation of "but" for "byte"
@robwebster7406
@robwebster7406 4 жыл бұрын
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 👍
@NewAgeDIY
@NewAgeDIY 4 жыл бұрын
Get Prime. No ads.
@learnelectronics
@learnelectronics 4 жыл бұрын
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.
@bblod4896
@bblod4896 4 жыл бұрын
I think it's very cool. How about putting an Ice cube on the sensor to check its calibration? Thanks Paul. Peace.
@aranyaakashmandal6548
@aranyaakashmandal6548 2 жыл бұрын
Is this onboard temperature sensor good for measuring room temperature?
@learnelectronics
@learnelectronics 2 жыл бұрын
Not particularly unless you take into account the heat of the chip
@TheRealFrankWizza
@TheRealFrankWizza 4 жыл бұрын
is it possible to read a camera from the usb?
@alheeley
@alheeley 3 жыл бұрын
How to calibrate it? Mine reads 15.5 C in my study and I know the temperature is about 19 - 20
@Spentelectrons
@Spentelectrons 4 жыл бұрын
Can you flip the board and solder the header to the other side?
@willsgrandad
@willsgrandad 4 жыл бұрын
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.
@Spentelectrons
@Spentelectrons 4 жыл бұрын
@@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?
@salan3
@salan3 4 жыл бұрын
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)
@twistedsoul
@twistedsoul 4 жыл бұрын
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
@joshualittlefield1541
@joshualittlefield1541 3 жыл бұрын
how do i do it in f?
@dr.shoveler7794
@dr.shoveler7794 Жыл бұрын
you had the print outside of the while true statement, so it never got to that portion of the code.
@michaelrobert4094
@michaelrobert4094 3 жыл бұрын
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))
@aprilliac
@aprilliac 4 жыл бұрын
python whitespace will getcha
@electroniquepassion
@electroniquepassion 4 жыл бұрын
Merci 😉
@amirb715
@amirb715 4 жыл бұрын
yes please continue on :-)
@paulmacgiollacaoine8619
@paulmacgiollacaoine8619 4 жыл бұрын
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 :)
@learnelectronics
@learnelectronics 4 жыл бұрын
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
@Biser10562
@Biser10562 3 жыл бұрын
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)
@paulmacgiollacaoine8619
@paulmacgiollacaoine8619 3 жыл бұрын
@@Biser10562 nice, is there a relay expansion board for the pico?
@wallaceshackleton1889
@wallaceshackleton1889 4 жыл бұрын
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.
@learnelectronics
@learnelectronics 4 жыл бұрын
The window was open. I burnt up a rectifier and was venting the fumes.
@TOMTOM-nh3nl
@TOMTOM-nh3nl 4 жыл бұрын
Thank You
@NewAgeDIY
@NewAgeDIY 4 жыл бұрын
Paul, yes that’s cool. Now let’s work on a graph or dial. Lookout Nest!
@davidkerr8030
@davidkerr8030 4 жыл бұрын
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.
@boi_doingthings
@boi_doingthings 4 жыл бұрын
I thought the pico had a onboard temperature sensor.
@electronic7979
@electronic7979 4 жыл бұрын
👏👏👏
@Jimwill01
@Jimwill01 4 жыл бұрын
Adafruit seems to be out of them. Big github page of examples - github.com/raspberrypi/pico-examples
@TheBinarydeity
@TheBinarydeity 4 жыл бұрын
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.
@learnelectronics
@learnelectronics 4 жыл бұрын
You can program over USB serial if you want
@juliocosta5818
@juliocosta5818 3 жыл бұрын
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?!
@dusankreslin2898
@dusankreslin2898 4 жыл бұрын
fahrenheit = (celsius * 1.8) + 32
@weerobot
@weerobot 4 жыл бұрын
Makes Arduino look easy...lol
@normcaissie5598
@normcaissie5598 4 жыл бұрын
you live in a fridge?
@learnelectronics
@learnelectronics 4 жыл бұрын
Window was open
@mannhansen9337
@mannhansen9337 4 жыл бұрын
@@learnelectronics -12 Celsius in Oslo now. Outside.
@OnlyKnowsGod
@OnlyKnowsGod 4 жыл бұрын
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.
@garymetheringham4990
@garymetheringham4990 4 жыл бұрын
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
@alistairgill5538
@alistairgill5538 4 жыл бұрын
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.
@garymetheringham4990
@garymetheringham4990 4 жыл бұрын
@@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
@alistairgill5538
@alistairgill5538 4 жыл бұрын
@@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.
Getting Started with Multicore Programming on the Raspberry Pi Pico
11:14
Learn Embedded Systems
Рет қаралды 47 М.
PicoDRO, DIY digital readout with the Raspberry Pi Pico. Ep.2
12:01
Mr. Green's Workshop
Рет қаралды 10 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
Raspberry Pi Pico
16:16
ExplainingComputers
Рет қаралды 321 М.
Raspberry Pi Pico - Review and Getting Started
18:32
Gary Explains
Рет қаралды 78 М.
controlling lots of servos with a Raspberry Pi Pico
13:38
pileofstuff
Рет қаралды 14 М.
#370 Raspberry Pi Pico vs ESP32 (-S2) and STM32 Blackpill
15:53
Andreas Spiess
Рет қаралды 393 М.
Hacking my garage door with the Raspberry Pi Pico W
11:50
Jeff Geerling
Рет қаралды 346 М.
Beginners Guide to I2C on the Raspberry Pi Pico (BNO055 IMU Example)
16:57
Learn Embedded Systems
Рет қаралды 79 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН