I had thought that you were sitting on those new Picos from raspberry foundation to prepare such video. I thought you would be the first normal user, not the usual sale chain guys. Hope you will get such soon. Meanwhile I watch the older stuff on your channel.
This channel is simply ESP online school. I am working on 3d printable projects enhanced by ESP and here I get 90% of the information. I would like some video on ESP integration connected to Amazon Alexa in future? Thank you for you amazing work :)
Thank you for this video and all the work you put into this channel! That's pure gold for an occasional maker like me. Explained very well and clearly, exciting topics, important information for all conceivable projects and lots of input for own ideas. I've stumbled across the channel when I recently started playing around with an ESP32 cam board and have now watched almost all of the videos. Your voice is very pleasant to hear (at least in the not very old videos, obviously a microphone or audio pipeline update) and the Swiss accent is very helpful for me. Despites I can speak English quite well i do not yet understand all of the technical terms. The other maker channels / videos that I have found so far are much more difficult to understand because these RUclipsrs speak much faster and less clearly. With your videos I learn this electronic technical terms without any effords. In addition, the Swiss accent sounds a lot more pleasant to me than, for example, Saxon, Swabian or even Oxford (maybe because I'm a Bavarian;)). Since I do not "use" any advertising on RUclips by haveing adblock active and because I am so enthusiastic about your videos, I would like to support the channel with a donation. However, I don't feel like opening another account at Patreon. (I'm account parsimonious since I take unattendet online accounts as savety threats and also to lazy to care accordingly for another one) Is therefore a way to send you money via e.g. PayPal or bank transfer? I did not find anything like this on your website or your RUclips profile. Please stay the way you are and don't be intimidated by any trolls or envious people. What you are producing here is really great and certainly a big help for interested people of all age, electronic beginners and also advanced makers! (Useful && interesting) --debug output value contains: "Very true!" --> It's the first channel i've subscribed.
Thank you for your nice words and welcome on the channel! I am glad my videos are helpful. If you want to support the channel on PayPal: AndreasSpiess@paypal.me
Thank you for this video. It’s a keeper. Your video is an excellent round up of using sensors on a Pi with Python code. It is very useful, not just for those starting out but also as a good reference.
Nicely put together tutorial, Andreas! I appreciate the tips to get things working in the boot/config.txt file and the ADC suggestion. I will definitely reference this video again for an upcoming project!
Great to see some Python code on the channel. I love when you show when things don't work - in my case, I got stuck trying to make a MLX90614 work only to find out it too does not with the default 400 kHz ic2 clock frequency.
The default I2C pins GPIO3 and GPIO4 have 1.8K pullup resistors on the Raspberry Pi board. No need for external pullups. It's a good idea to check if the sensor boards you are using also have pullups on them too. If they do, they will be in parallel with the ones on the Pi. Most BME280 modules have 10k pullups on them, which is not low enough to cause loading issues. If you have many I2C modules connected, you may need to be concerned with too much loading and need to remove pullups from your modules.
You are right with the internal pull-ups. I understood that the pull-ups have to be at the end of the (long) line. That is why I mentioned the possibility.
Andreas a wonderful video, the T-coupler was very cool much more tidy than my nest of wires between my pi and the breadboard. Every project I have to take time to check for loose or bad connections. Thank you.
Do check the register alignment byte order and data type (scaling) with the MAX SPI devices. I had to reverse engineer Arduino libraries to make it work reliably in an ATtiny for translating the output to I2C... ATtiny with MAX mounted close to the sensor to minimise potential for interference. Don't recall the gruesome details but it took an all-nighter to resolve. P.S. Another motivation was to makes the uC use only scaled integer arithmetic for fast results and lower power... It was sending temperature on an attached RTD and the self heating had to be negligible.
Comment dire ? Merci pour votre travail qui est excellent. Rapide, clair, direct, sans bla bla et vraiment utile pour nous, les bricoleurs avec déjà une bonne expérience en soft et hard.
Thanks for the pinout command. This is very handy!! A hint from me: This tool is provided by the GPIO Zero Python library, which is installed by default on the Raspberry Pi OS desktop image, but not on Raspberry Pi OS Lite.
@@AndreasSpiess By not running the GUI on devices that don't need it, you not only save space on the disk but ram and CPU cycles as well - the latter being expensive on raspi
@5:12: the libraries from circuit python are not easily usable! Only if you have an esp32-s2 (ironically, less powerful and no bluetooth!) and solder a new usb connection, you can *actually* use circuit python. The native esp32 support has been discontinued and is only supported as an additional 'wifi/heavy lifting' module ('airlift'). I really would like to know if there's an easy 'plug and play' possibility!
Andreas, many thanks for your excellent videos. I have appreciated that you have been numbering your videos. For me, who found you recently, they have been very useful for me whilst catching up on past videos. I notice that you have stopped the numbering. This is fine for me as I am nearly caught up. Perhaps you could continue numbering the videos. Many thanks again. Graham
For the more adventurous programmer, you can also learn Rust on the RPi. And it includes embedded libraries for accessing pheripherals on the 40 pin header. Rust is an excellent candidate language for embedded software, and so your same program can then be ported to also run on cheaper embedded MCU platforms. Such as ESP32, Nordic NRF, etc.
Rust is the language that tries to do all memory safety at compile time. So it gives many detailed compiler errors, to ensure that your code does not have memory leaks or buffer overruns. This also means there is no performance overheads of a garbage collector. And compiled rust is as fast as C/C++. Because in other languages to the runtime memory management cleanup task can randomly interrupt your program to perform cleanup duties. Rust does not have it. Also rust has a good interfaces / modules types system. And otherwise has some very advanced and modern language features. Rust forces the developer to do more work to achieve a given level of program functionality. But the trade is a fair one, that the programs you write are going to be less buggy and of a higher quality. Thanks to having to fix all of the many compiler errors. In Rust, the built in help system is the compiler itself. So not you know what rust really is. It is meant to be a very modern language. With very modern features. And also address the issue of memory management in C and C++. But without also adding the performance burden of a runtime.
In other words: you cannot have your cake and eat it. You have to prioritize at the language level which features of the programming language are more important to you. It is very much a trade off. This is the progress poiint where we are as civilization in the year 2021. Actually there are 2 main solutions to this difficult problem. One solution already exists: which is to use a very well integrated and well optimized development platform such as Apple iOS. In such a system you have to do everything through the official Apple API calls. And then Apple can do a lot of hard work behind the scenes to optimize and have an amazing runtime in those libraries. Which can then work well with apples very specific and well integrated hardware resources. To ensure all programs can access those resources in a most effecient way. Of course also making the developer obey these very proprietary runtime APIs. And they only work well on apple hardware. The other second solution is to hope in future we get new technological advances and breakthroughs in the runtimes of open source projects. That address the issues of existing runtimes in existing languages. However that is very complicated and difficult work. And you cannot really do it in an existing language with an existing runtime. Because then it will very often break backwards compatibility. It is instead easier to start from the point where rust is. Which is to say: without a mandatory runtime. Although rust does have a very limited optional runtime. It is not a full memory management / garbage collector etc.
Thank you for you information. As you indicate, for me the most important fact is the "ecosystem". For microcontrollers and hobby it should contain lots of libraries, examples, and a community which solved and openly documented all problems I will encounter. Then the fun per time factor is highest. These criteria are different if you want to build commercial applications. But with "Agile" I see these two areas coming closer...
Another language with python like syntax and great C interop is Nim which works well with microcontrollers such as esp32 because garbage collection is optional..
@@userou-ig1ze no, they are not "better" as they don't have a wireless interface, touch detection and a few other things. Also they are slower. But they are more energy efficient and may be usefull for projects that don't require the ESP32 horsepower. ESP32 modules are cheaper but if you want a dev board, I don't know if you can get a ESP32 devboard for 4Eur.
@@AndreasSpiess when you review it, can you make sure to compare it to the STM32 Fs and the MCU used in the Teensy 4.1 in terms of raw performance as well as power usage please?
Very useful video. The interested parties can hit the ground running with your sample code. I really need to learn python properly, I can read and understand python code, but writing python code from scratch, is another story! Thanks God for Cut and Paste. It's hard to give up C, specially when I've been programing in C since 1985 :( Suffering from "old dog and new tricks" syndrome.
Great video on a very useful subject, so much nice stuff to play with. That ADS1115 is something very useful, going to get some to play with. Perfect for something needing a fast, high resolution differential input. Thanks for the information. Kind regards, South Africa
I don't expect to use Raspberry, so why do I watch the video to the end ? But I didn't know that parts of Switzerland are so low, the Leman is at 370m, I checked and 8:48 220m is possible. Thank you !
This was awesome video. as a noob, i had no idea of what was going on. can you suggest a dummies guide 101 to this topic please, maybe somwething that discusses only one sensor at a time and a step by step tutorial? cheers and thanks
I like the concept of using Adafruit's CircuitPython and Arduino experience to have so many essential libraries available from one place. PIP3 takes a lot of hunting out of the equation.
The pinout command is great and I didn't know about it. I immediately paused the video to try it on my always on mqtt pi. It seemed to hang for quite a while and I was worried but eventually printed.
i did a Heltec ESP8266 WiFi Kit 8 with micropython after uploading a ssd1306 lib file it took like 10 lines of code to print 3 lines of text on the screen! super easy! pretty different from arduino. i hope you do more videos on micro-python! :)
thanks for the upload, im using the MAX31855 and successfully recording, however i would like to use 3x thermocouples, how would i change the code to read three boards and also would the wiring be the same for the three boards except changing the cs for each one?
You have to connect each CS to another Raspberry pin and create more than one MAX31855 objects, each with a different CS pin. MOSI and SCK are all connected together.
i really enjoy all your tutorial!! If possible one subject covered i would like to see would be a pi (zero or else) with MotioneyOS, a camera AND a DHT11 or DHT22 connected so we can have camera AND temperature and humidity sensor (for outdoor camera). I dont know if that is possible. MotionEye could be on another Pi with 2-3 pi-zero for camera
Old ESP32 modules are not supported by the current version of CircuitPython. As CircuitPython is not compatible with MicroPython you can't use the same libraries on these chips. Only new ESP32-S2 microcontrollers are supported by CircuitPython.
@@AndreasSpiess I had a quick search and there's some info on the RaspberryPi forums that suggests that you communicate with a microcontroller on that address for things like setting the fan speed or killing power. One user has written his own replacement daemon for the case (gitlab.com/DarkElvenAngel/argononed).
This is great, thanks for this overview. At the beginning you shortly show a screenshot of data being graphed over time. How do you create such real time graphs from your sensor readings while also storing the incoming data? Any tips or recommended software for storing and showing incoming sensor data?
You had a video where you mention which type of mosfet you like to use to switch loads on EPS pins. Do you remember which one was that? And which mosfet?
I used MOSFETS in different videos. For 3.3 V, I usually use logic level MOSFETS like the IRLB8721 or the IRLZ44. These are N-channel. For 5 volt a lot more FETS should work.
I thought most I2C devices were 100 KHz, but some could manage faster? Or is my information out of date? Thanks for the video in any case! I didn't even realize the RPi supported 1-wire.
There is one BIG BIG downside to Circuitpython, interrupts are not supported. This obviates the real time support for example, endstop alerts which can be simply handled with the RPi.GPIO library add_event_detect function. This also includes certain i2c multiplexer which provide an interrupts based on the client state change
AFAIK I only used the circuitpython libraries and standard Python. Maybe you can combine the two libraries,I do not know. Anyway, interrupts ans linux is not the preferred combination for me...
@@AndreasSpiess I just tested on a Pi Zero and the Circuitpython libraries do not conflict. There is an improved RPI GPIO library called gpiozero which encapsulates and simplifies the RPi.GPO functionality and provides high level interfaces to Buttons, Led, i2c, spi etc. My complaint really is that the Circuitpython standalone environment in comparison to Micropython does not support interrupts or treads.
I mentioned GPIOZERO. But it does not support many sensors. I am not sure if threads are not supported on the Pi. I do not use interrupts on Linux systems.
@@AndreasSpiess and in addition to supporting many sensors and peripherals, for example, Light, Distance, Servo and etc.. also wraps RPI architecture from a board perspective.
Nice. But one problem of Pi devices work without hardware Interrupt on userland space inside of linux os environment. But for all sensors used pool method for get data. And CPU on this time can't sleep.
I have done some testing of DHT11 and BME280 lately. using Python and C. They will only transmit garbage when connected to 3.3 V. When using 5 Volts they work perfectly since middle of December. The wires used are Dupont female-female and about 10 cm's long. The sensors are breakout boards from Ebay. Just my 2 cents.
Thank you for sharing your experience. I always look at the datasheets of the sensors or boards. Sometimes they include a 3.3 volt regulator, sometimes not.
@@AndreasSpiess At lot of the El Cheapo stuff on Ebay has no datasheet or a schematic. I use my Tektronix 465 scope or Salae Logic analyzer to troubleshoot.The DHT11 sensor has a very high D.O.A rate and should be avoided.They also stop working after 3-4 years. Use the DHT22 or DHT12 (I2C) instead. Then comes BME280 from Bosch. This is a very good sensor but when you buy one on Ebay there is great chance that you get a BMP280. Without humidity sensor. The I2C address is most often 0x76 for BME280 or 0x77 not so often. Use an I2C scanner if in doubt.
Now you have covered this argument, you gotta do also the Raspberry Pi Microcontroller 😄 That one however has ADC converters and some other yummy features, and is way more affordable than the Arduino.
Thank you as usual. Still relatively new so this may be a basic question. Are you using the CircuitPython libraries in the standard python3 interpreter? I assumed you had to be in CircuitPython to use those.
BTW, do you plan to review new Raspberry silicon? I mean their new custom microcontroller. I believe one of the reason they have produced it is actually to serve as a middle tier between realtime-sensors processing and slow-poke RPi mainboards under RPiOS control.
Nicely done Andreas! Have you experimented with using the newest Raspberry Pi and connect it to an Arduino board with sensors already connected to Arduino C++ sensors and edit the data output to be ported to the raspberry via GPIO?
I am making a digital Speedo and wondering how do I connect a speed sensor to the raspberry pi and how to program it as the speed sensor does 6 pulses every 1 revolution
Linux systems are not good for real time applications. So if you need to measure exact times, maybe you use an Arduino or an ESP32 for the measuring and connect it to the Raspberry via Serial or WiFi.
@@AndreasSpiess I will keep that in mind if the way I plan on doing it doesn't work as I have the code working out the speed but for the displaying of the speed it updates every X milliseconds ( I would like to have an Arduino do that and send the data to the raspberry pi but I don't have alot of room as it will be going into a classic mini with a center speedo so it is unfortunately rather cramped
Good evening Andreas! I have been following your wonderful youtube channel for a long time, and I really cant thank you enough... I wanted to ask you a little advice: I am trying to connect a RFID reader to Raspberry (No problem there), but I have also connected a touch display. The touch display wants to use exclusively the following Pins (which, from docs I have, the RFID ariel also needs): PIN 19 (MOSI) PIN 21 (MISO) PIN 23 (SCK) PIN 22 (GPIO 6).. Do you think I can put the RFID on other pins or is it an impossible task (I could use an Arduino and connect via USB but I'd rather not if at all possible) THank you for ANY advice you can give.
Google "SPI interface". You will see: MISO, MOSI, and SCK are in parallel for all sensors. Only CS or CE (Chip select) is a separate pin for each device. You have to tell your code which pin you use.
@@AndreasSpiess Strange. This is a very interesting topic and very usefull. Maybe people are a bit tired of over exposure to their computer and/or RUclips because of lockdowns and staying indoor. I'm sure the video will gain interest especially with the new Rasb. Pico being available. I already ordered 3 of those. I'll promote the video to my contacts and think alikes... ;-)
I am interested in lora satellites and I have seen your videos about two small satellites. please prefer me some links so that I could gain some knowledge.
Unfortunately an OS like Linux makes it much more difficult to get 100% correct timing when needed. Ex. if you want to send or receive high-frequency signals, an Arduino (or Attiny or ESP8266 or ESP32 or STM32 or ...) is just way easier because you can get the timing correct with just delays (or real timer- or pin-interrupts). On a Pi, your process can get pre-empted at the critical moment, messing up the crucial timing. Optimized mechanisms as in the pigpio package can reduce the problem a bit, but are way more difficult to use. I tend to do real-time stuff on a uP (ex. Attiny84) and have it communicate with the Pi using a protocol that the Pi can handle without glitches.
hi very interesting video, thanks for share, maybe possible send the values obtain of sensors from raspberry to one website and make remote estation to get information, thanks.
@Andreas Spiess Hello Andreas, I am trying to read an accelerometer data stream using arduino nano 33 ble, i get the device conntected and subscribe to the characteristic. but still having problems with getting the values, it would be really nice if you can help me getting it work. thanks and by the way nice and very informative videos :)
Unfortunately I cannot do remote debugging :-( But I am sure you find the problem if you check every function alone before you try everything together.
What's meant with "No Docker" in the description. Just that no Docker is used in the video? Or just that you do not take money from Docker for your videos? Or smth else?
Learners, Students start their project, at the first stage, with arduino. So i think you can create a detailed series of videos with arduino and its software.Learners will be highly benefited.Later you can take this learning to another level (i+1)adding 1=unknown to the already known factors =i., Thank you.For example with Raspberry pi.
This channel is for advanced users or users with ambitions. There are many channels with the simple tutorials. I would not like to create such videos :-(
We talk a lot about sensors and buttons and trying to be energy efficient as possible. I'm wondering why we are not using battery less sensors and buttons, Philips Hue Tap has been around for so many years and I still don't see an alternative for the DIY public. It seems that the only option so far is to interface an EnOcean(www.enocean.com/en/products/enocean_modules_24ghz/) module to our ESP32 or Raspberry Pi and use their Motion/Temperature/Humidity/Lux sensors or buttons. Looks like Eltako uses exact the same modules, hard to believe there is only one way and so few doing battery less devices.
Attention: @2:43: The green pins are GPIO, not Ground (Thank you, George!)
Make a video on rasberry pico.
I had thought that you were sitting on those new Picos from raspberry foundation to prepare such video.
I thought you would be the first normal user, not the usual sale chain guys.
Hope you will get such soon. Meanwhile I watch the older stuff on your channel.
After all these years. I still believe that you are the best Instructor.
Thank you!
This channel is simply ESP online school. I am working on 3d printable projects enhanced by ESP and here I get 90% of the information. I would like some video on ESP integration connected to Amazon Alexa in future? Thank you for you amazing work :)
You are welcome! I do not particularly like Alexa because she does not understand Swiss German nor a "Swiss Accent" :-(
@@AndreasSpiess dont worry, if it understands czech accent, it should also understand to you:), and if not, you can hack it? :)
Thank you for this video and all the work you put into this channel!
That's pure gold for an occasional maker like me.
Explained very well and clearly, exciting topics, important information for all
conceivable projects and lots of input for own ideas.
I've stumbled across the channel when I recently started playing around with an ESP32
cam board and have now watched almost all of the videos.
Your voice is very pleasant to hear (at least in the not very old videos, obviously
a microphone or audio pipeline update) and the Swiss accent is very helpful for me.
Despites I can speak English quite well i do not yet understand all of the technical terms.
The other maker channels / videos that I have found so far are much more difficult to understand because these RUclipsrs speak much faster and less clearly.
With your videos I learn this electronic technical terms without any effords.
In addition, the Swiss accent sounds a lot more pleasant to me than, for
example, Saxon, Swabian or even Oxford (maybe because I'm a Bavarian;)).
Since I do not "use" any advertising on RUclips by haveing adblock
active and because I am so enthusiastic about your videos, I would like
to support the channel with a donation.
However, I don't feel like opening another account at Patreon.
(I'm account parsimonious since I take unattendet online accounts as savety
threats and also to lazy to care accordingly for another one)
Is therefore a way to send you money via e.g. PayPal or bank transfer?
I did not find anything like this on your website or your RUclips profile.
Please stay the way you are and don't be intimidated by any trolls or envious people.
What you are producing here is really great and certainly a big help for interested people of all age, electronic beginners and also advanced makers!
(Useful && interesting) --debug output value contains: "Very true!"
--> It's the first channel i've subscribed.
Thank you for your nice words and welcome on the channel! I am glad my videos are helpful. If you want to support the channel on PayPal: AndreasSpiess@paypal.me
@@AndreasSpiess done. Best Regards.
Thank you for supporting the channel!
Thank you for this video. It’s a keeper. Your video is an excellent round up of using sensors on a Pi with Python code. It is very useful, not just for those starting out but also as a good reference.
Glad it was helpful!
Thank you for this valueable raspberry lesson :) I did went a second time through the video step by step and wrote down all the command lines. :)
There is a "commands.txt" file in the repo...
Nicely put together tutorial, Andreas! I appreciate the tips to get things working in the boot/config.txt file and the ADC suggestion. I will definitely reference this video again for an upcoming project!
Thank you. I did not find one video covering all types of sensors. This is why I made it.
This is Life Saver Video for my project, I am a CSE Student and hugely struggling about the lack of knoledge I have.
You are a student, so you should not know everything. Otherwise you would be an expert ;-)
Usefull learning video. I've got some pi's lying around but always wanted to start with it. Maybe this is the right moment.
Thanks
These are great boards with lots of possibilities!
Great to see some Python code on the channel. I love when you show when things don't work - in my case, I got stuck trying to make a MLX90614 work only to find out it too does not with the default 400 kHz ic2 clock frequency.
Thanks for the info about the MLX90614!
The default I2C pins GPIO3 and GPIO4 have 1.8K pullup resistors on the Raspberry Pi board. No need for external pullups. It's a good idea to check if the sensor boards you are using also have pullups on them too. If they do, they will be in parallel with the ones on the Pi. Most BME280 modules have 10k pullups on them, which is not low enough to cause loading issues. If you have many I2C modules connected, you may need to be concerned with too much loading and need to remove pullups from your modules.
You are right with the internal pull-ups. I understood that the pull-ups have to be at the end of the (long) line. That is why I mentioned the possibility.
@@AndreasSpiess yup it helps when you have alot of devices on the bus.. and long lines..
Andreas a wonderful video, the T-coupler was very cool much more tidy than my nest of wires between my pi and the breadboard. Every project I have to take time to check for loose or bad connections. Thank you.
Glad you enjoyed it! Loose connections are a big pain in the a... , I agree.
Do check the register alignment byte order and data type (scaling) with the MAX SPI devices. I had to reverse engineer Arduino libraries to make it work reliably in an ATtiny for translating the output to I2C... ATtiny with MAX mounted close to the sensor to minimise potential for interference. Don't recall the gruesome details but it took an all-nighter to resolve.
P.S. Another motivation was to makes the uC use only scaled integer arithmetic for fast results and lower power... It was sending temperature on an attached RTD and the self heating had to be negligible.
Good to know. This is probably why I like ready-made libraries ;-) It saves me some time and Adafruit did a good job.
Nice video, I would like to see the sensor integration with node red. Regards
I think you can call python scripts of node-red.
There must be a gpio plugin, I'm sure I've seen it either in home assistant or nodered
I think this is the 'tube I didn't know I needed. The mud settles.... Thank you.
You are welcome. Maybe you need it later...
@@AndreasSpiess Now and later!
This is a great topic and I'll keep it in my personal library list!
That is what I was hoping for ;-)
Very good video. Thanks.
Especially to connect sensors with I2C is very interesting
Agreed. Most sensors I use are I2C
Comment dire ? Merci pour votre travail qui est excellent. Rapide, clair, direct, sans bla bla et vraiment utile pour nous, les bricoleurs avec déjà une bonne expérience en soft et hard.
Merci beaucoup! My amateur call sign is HB9BLA. So I thought, that is enough BLA,BLA ;-)
Very helpful video with useful informations and documentation. Thank you !
You are welcome!
Thanks for the pinout command. This is very handy!! A hint from me: This tool is provided by the GPIO Zero Python library, which is installed by default on the Raspberry Pi OS desktop image, but not on Raspberry Pi OS Lite.
Thanks for the info! I did not know. With the cheap SD cards, I did not use the lite version lately...
@@AndreasSpiess By not running the GUI on devices that don't need it, you not only save space on the disk but ram and CPU cycles as well - the latter being expensive on raspi
Great video and very useful information
!
Glad it was helpful!
@5:12: the libraries from circuit python are not easily usable! Only if you have an esp32-s2 (ironically, less powerful and no bluetooth!) and solder a new usb connection, you can *actually* use circuit python. The native esp32 support has been discontinued and is only supported as an additional 'wifi/heavy lifting' module ('airlift'). I really would like to know if there's an easy 'plug and play' possibility!
You are right. I was not specific enough. The S2 will get some followers. S3, S4 .... Also the new Pi Pico will be supported by Circuitpython.
Great video as always! Straight to the point with 'dumb-down' explanation for beginner like me. Hopefully you can review the Raspberry Pi Pico next.
I have a few Picos on order...
@@AndreasSpiess yay will you check out the Arduino port for the Pico!
Andreas, many thanks for your excellent videos.
I have appreciated that you have been numbering your videos. For me, who found you recently, they have been very useful for me whilst catching up on past videos.
I notice that you have stopped the numbering. This is fine for me as I am nearly caught up.
Perhaps you could continue numbering the videos.
Many thanks again.
Graham
The 10 last videos never had numbers. But they will get one later...
@@AndreasSpiess thank you.
Looking forward to your take on the Raspberry Pi Pico.
They are on order...
Thank you for the useful information!
Glad it was helpful!
For the more adventurous programmer, you can also learn Rust on the RPi. And it includes embedded libraries for accessing pheripherals on the 40 pin header. Rust is an excellent candidate language for embedded software, and so your same program can then be ported to also run on cheaper embedded MCU platforms. Such as ESP32, Nordic NRF, etc.
I do not know Rust. But for the moment everything is pointing in the direction of Python in this field :-(
Rust is the language that tries to do all memory safety at compile time. So it gives many detailed compiler errors, to ensure that your code does not have memory leaks or buffer overruns. This also means there is no performance overheads of a garbage collector. And compiled rust is as fast as C/C++. Because in other languages to the runtime memory management cleanup task can randomly interrupt your program to perform cleanup duties. Rust does not have it. Also rust has a good interfaces / modules types system. And otherwise has some very advanced and modern language features. Rust forces the developer to do more work to achieve a given level of program functionality. But the trade is a fair one, that the programs you write are going to be less buggy and of a higher quality. Thanks to having to fix all of the many compiler errors. In Rust, the built in help system is the compiler itself. So not you know what rust really is. It is meant to be a very modern language. With very modern features. And also address the issue of memory management in C and C++. But without also adding the performance burden of a runtime.
In other words: you cannot have your cake and eat it. You have to prioritize at the language level which features of the programming language are more important to you. It is very much a trade off. This is the progress poiint where we are as civilization in the year 2021.
Actually there are 2 main solutions to this difficult problem. One solution already exists: which is to use a very well integrated and well optimized development platform such as Apple iOS. In such a system you have to do everything through the official Apple API calls. And then Apple can do a lot of hard work behind the scenes to optimize and have an amazing runtime in those libraries. Which can then work well with apples very specific and well integrated hardware resources. To ensure all programs can access those resources in a most effecient way. Of course also making the developer obey these very proprietary runtime APIs. And they only work well on apple hardware.
The other second solution is to hope in future we get new technological advances and breakthroughs in the runtimes of open source projects. That address the issues of existing runtimes in existing languages. However that is very complicated and difficult work. And you cannot really do it in an existing language with an existing runtime. Because then it will very often break backwards compatibility. It is instead easier to start from the point where rust is. Which is to say: without a mandatory runtime. Although rust does have a very limited optional runtime. It is not a full memory management / garbage collector etc.
Thank you for you information. As you indicate, for me the most important fact is the "ecosystem". For microcontrollers and hobby it should contain lots of libraries, examples, and a community which solved and openly documented all problems I will encounter. Then the fun per time factor is highest. These criteria are different if you want to build commercial applications. But with "Agile" I see these two areas coming closer...
Another language with python like syntax and great C interop is Nim which works well with microcontrollers such as esp32 because garbage collection is optional..
Hope you are going to cover the new PI microcontroller boards, the PI Pico soon. I have a pair on order. They are only €4 each.
Me too have a few on order...
is better than the esp32 chips, and new esp32-s3 chips, I wonder?
Interested to see the processing power for speech and video in action
@@userou-ig1ze no, they are not "better" as they don't have a wireless interface, touch detection and a few other things. Also they are slower. But they are more energy efficient and may be usefull for projects that don't require the ESP32 horsepower. ESP32 modules are cheaper but if you want a dev board, I don't know if you can get a ESP32 devboard for 4Eur.
@@AndreasSpiess when you review it, can you make sure to compare it to the STM32 Fs and the MCU used in the Teensy 4.1 in terms of raw performance as well as power usage please?
Thank you for this guide!
You are welcome!
Thank you for this. Keep up the great work!
You are welcome!
Very informative content. Thanks.
You are welcome!
Excellent vidéo as always. Thank you Andreas 👍
Glad you liked it!
Great tutorial, thanks
You're welcome!
Very useful video. The interested parties can hit the ground running with your sample code.
I really need to learn python properly, I can read and understand python code, but writing python code from scratch, is another story!
Thanks God for Cut and Paste.
It's hard to give up C, specially when I've been programing in C since 1985 :(
Suffering from "old dog and new tricks" syndrome.
I also mainly use copy-paste. But this is ok for the moment ;-)
Thank you. Have you experimented with hardware interrupts on Rpi?
I do not plan to use interrupts on a Linux system. Its real-time capabilities seem not great...
Great video on a very useful subject, so much nice stuff to play with.
That ADS1115 is something very useful, going to get some to play with.
Perfect for something needing a fast, high resolution differential input.
Thanks for the information.
Kind regards,
South Africa
Thank you. I used the ADS1115 also with ESP32 which does not have a good ADC.
Sehr gut, Herr Speiss, wie immer, danke.
Bitte, gern geschehen.
Thank you for great video!
My pleasure!
New episode! Hands on knees, back straight and sitting in front row!
Hands on pen and paper, you're supposed to take notes!
@
InfiniteWonderz : Thank you!
@grmasdfil: RUclips has a replay function ;-)
I've got wobble juice in one hand. Temporarily.
I don't expect to use Raspberry, so why do I watch the video to the end ?
But I didn't know that parts of Switzerland are so low, the Leman is at 370m, I checked and 8:48 220m is possible. Thank you !
We are on 350m. And it is always good to know the competition ;-)
Thanks for great video. I have been considering to start learning python for long time. I guess the time is here.
I also see more and more signs which point in this direction.
This was awesome video. as a noob, i had no idea of what was going on. can you suggest a dummies guide 101 to this topic please, maybe somwething that discusses only one sensor at a time and a step by step tutorial? cheers and thanks
Just enter the name of the sensor and Raspberry Pi into Google
Tx Andreas, I was planning to connect a DS812 temp sensor to my pi ... and now I now how!
I hope it will work!
I like the concept of using Adafruit's CircuitPython and Arduino experience to have so many essential libraries available from one place. PIP3 takes a lot of hunting out of the equation.
I liked it too :-)
The pinout command is great and I didn't know about it. I immediately paused the video to try it on my always on mqtt pi. It seemed to hang for quite a while and I was worried but eventually printed.
It does not work on the standard lite version.
i did a Heltec ESP8266 WiFi Kit 8 with micropython after uploading a ssd1306 lib file it took like 10 lines of code to print 3 lines of text on the screen! super easy! pretty different from arduino. i hope you do more videos on micro-python! :)
We will see ;-)
Thank you for the information I found it useful.
Glad to hear it!
thanks for the upload, im using the MAX31855 and successfully recording, however i would like to use 3x thermocouples, how would i change the code to read three boards and also would the wiring be the same for the three boards except changing the cs for each one?
You have to connect each CS to another Raspberry pin and create more than one MAX31855 objects, each with a different CS pin. MOSI and SCK are all connected together.
i really enjoy all your tutorial!! If possible one subject covered i would like to see would be a pi (zero or else) with MotioneyOS, a camera AND a DHT11 or DHT22 connected so we can have camera AND temperature and humidity sensor (for outdoor camera). I dont know if that is possible. MotionEye could be on another Pi with 2-3 pi-zero for camera
The word "and" always reduces the number of interested viewers (intersection of two interests). So that is not a good word for a RUclipsr ;-)
Old ESP32 modules are not supported by the current version of CircuitPython. As CircuitPython is not compatible with MicroPython you can't use the same libraries on these chips. Only new ESP32-S2 microcontrollers are supported by CircuitPython.
Thanks for the info!
A useful overview, thanks Andreas. i2cdetect is showing a second device at 0x1a. Did you also have an MCP9808 temperature sensor connected?
I used the Argon case and I assume it uses this address. But I did not investigate.
@@AndreasSpiess I had a quick search and there's some info on the RaspberryPi forums that suggests that you communicate with a microcontroller on that address for things like setting the fan speed or killing power. One user has written his own replacement daemon for the case (gitlab.com/DarkElvenAngel/argononed).
Excelente y muy ilustrativo como siembre, un abrazo !!
Gracias!
This is great, thanks for this overview. At the beginning you shortly show a screenshot of data being graphed over time. How do you create such real time graphs from your sensor readings while also storing the incoming data? Any tips or recommended software for storing and showing incoming sensor data?
I made some videos about that. Maybe you look into my Raspberry playlist.
great job..as always Andreas :)
is there not a software serial library for rpi? save you disabling the shell..
I do not know. But you do not disable the shell. You still can use ssh.
Another awesome video
Thank you!
Hi
Great useful video as usual.
I have a question: how to use a Lidar sensor as a mouse or for making touch screen sensor for any lcd or led display.
I do not know how this should work :-(
You had a video where you mention which type of mosfet you like to use to switch loads on EPS pins. Do you remember which one was that? And which mosfet?
I used MOSFETS in different videos. For 3.3 V, I usually use logic level MOSFETS like the IRLB8721 or the IRLZ44. These are N-channel. For 5 volt a lot more FETS should work.
I thought most I2C devices were 100 KHz, but some could manage faster? Or is my information out of date? Thanks for the video in any case! I didn't even realize the RPi supported 1-wire.
100 and 400 seem to be quite common.
There is one BIG BIG downside to Circuitpython, interrupts are not supported. This obviates the real time support for example, endstop alerts which can be simply handled with the RPi.GPIO library add_event_detect function. This also includes certain i2c multiplexer which provide an interrupts based on the client state change
AFAIK I only used the circuitpython libraries and standard Python. Maybe you can combine the two libraries,I do not know. Anyway, interrupts ans linux is not the preferred combination for me...
@@AndreasSpiess I just tested on a Pi Zero and the Circuitpython libraries do not conflict. There is an improved RPI GPIO library called gpiozero which encapsulates and simplifies the RPi.GPO functionality and provides high level interfaces to Buttons, Led, i2c, spi etc. My complaint really is that the Circuitpython standalone environment in comparison to Micropython does not support interrupts or treads.
I mentioned GPIOZERO. But it does not support many sensors. I am not sure if threads are not supported on the Pi. I do not use interrupts on Linux systems.
@@AndreasSpiess The gpiozero, all lower case, is a high level wrapper of RPi.GPIO
@@AndreasSpiess and in addition to supporting many sensors and peripherals, for example, Light, Distance, Servo and etc.. also wraps RPI architecture from a board perspective.
What do you suggest for reading shaft speed (RPM) ? There are a couple of different types of sensors (optical, Hall Effect, magnetic, etc.)
You can use optical and magnetic as you like. Depending on your situation. I have no preference.
@@AndreasSpiess How do you connect them to a RPi and what library is need to read them ?
I made a video on how to connect sensors to a Raspberry
Nice. But one problem of Pi devices work without hardware Interrupt on userland space inside of linux os environment.
But for all sensors used pool method for get data. And CPU on this time can't sleep.
Not a lot of my projects use interrupts. Then I still have my MCUs...
I have done some testing of DHT11 and BME280 lately. using Python and C. They will only transmit garbage when connected to 3.3 V. When using 5 Volts they work perfectly since middle of December. The wires used are Dupont female-female and about 10 cm's long. The sensors are breakout boards from Ebay. Just my 2 cents.
Thank you for sharing your experience. I always look at the datasheets of the sensors or boards. Sometimes they include a 3.3 volt regulator, sometimes not.
@@AndreasSpiess At lot of the El Cheapo stuff on Ebay has no datasheet or a schematic. I use my Tektronix 465 scope or Salae Logic analyzer to troubleshoot.The DHT11 sensor has a very high D.O.A rate and should be avoided.They also stop working after 3-4 years. Use the DHT22 or DHT12 (I2C) instead. Then comes BME280 from Bosch. This is a very good sensor but when you buy one on Ebay there is great chance that you get a BMP280. Without humidity sensor. The I2C address is most often 0x76 for BME280 or 0x77 not so often. Use an I2C scanner if in doubt.
Now you have covered this argument, you gotta do also the Raspberry Pi Microcontroller 😄
That one however has ADC converters and some other yummy features, and is way more affordable than the Arduino.
Challenge accepted
Thank you for this.
My pleasure!
Nice video thanks. Have you looked at coding on Raspberry Pi remotely with Visual Studio Code using the Remote Development extension?
No. I mostly use the Pi as a server, and not for realtime stuff. There I use microcontrollers
Thank you as usual. Still relatively new so this may be a basic question. Are you using the CircuitPython libraries in the standard python3 interpreter? I assumed you had to be in CircuitPython to use those.
Micropython is not the same as "real" python. So I would not trust that a mix will work. But you can try...
BTW, do you plan to review new Raspberry silicon? I mean their new custom microcontroller. I believe one of the reason they have produced it is actually to serve as a middle tier between realtime-sensors processing and slow-poke RPi mainboards under RPiOS control.
I plan a video, yes.
Should I buy the Pi4 B with the 8gb ram? Since I heard it had some problems with overheating and software bugs, I'm confused a bit
So far I never needed 8GB. I use 2 or 4GB versions
@@AndreasSpiess should I buy that pi4B 2/4gb or buy the old 3B+?
For sure a Pi4. It is much better.
@@AndreasSpiess thanks a lot sir
Greetings from Bodensee:) Kurze Frage , ist es möglich mehrere abstandsensoren zu installieren ? Wenn ja wie?
Weiss ich nicht. Kommt auf vieles an: Sensortyp, Interfaces (Pins) und Software. Ich würde nach ähnlichen Projekten googlen.
Nicely done Andreas!
Have you experimented with using the newest Raspberry Pi and connect it to an Arduino board with sensors already connected to Arduino C++ sensors and edit the data output to be ported to the raspberry via GPIO?
No. Most of my sensors are on ESP32 and I use wireless/MQTT
Great video! What are the advantages of connecting a sensor to the raspberry pi instead of through an arduino?
If the project works fine with arduino. Then arduino is the right choice. Most of the projects won't require a computer like Raspberry Pi.
I use the Raspberry for data storage and user interface. If the Raspberry is close to the action it makes no sense to use an additional Arduino.
I am making a digital Speedo and wondering how do I connect a speed sensor to the raspberry pi and how to program it as the speed sensor does 6 pulses every 1 revolution
Linux systems are not good for real time applications. So if you need to measure exact times, maybe you use an Arduino or an ESP32 for the measuring and connect it to the Raspberry via Serial or WiFi.
@@AndreasSpiess I will keep that in mind if the way I plan on doing it doesn't work as I have the code working out the speed but for the displaying of the speed it updates every X milliseconds ( I would like to have an Arduino do that and send the data to the raspberry pi but I don't have alot of room as it will be going into a classic mini with a center speedo so it is unfortunately rather cramped
Good evening Andreas!
I have been following your wonderful youtube channel for a long time, and I really cant thank you enough...
I wanted to ask you a little advice:
I am trying to connect a RFID reader to Raspberry (No problem there), but I have also connected a touch display. The touch display wants to use exclusively the following Pins (which, from docs I have, the RFID ariel also needs):
PIN 19 (MOSI)
PIN 21 (MISO)
PIN 23 (SCK)
PIN 22 (GPIO 6)..
Do you think I can put the RFID on other pins or is it an impossible task (I could use an Arduino and connect via USB but I'd rather not if at all possible)
THank you for ANY advice you can give.
Google "SPI interface". You will see: MISO, MOSI, and SCK are in parallel for all sensors. Only CS or CE (Chip select) is a separate pin for each device. You have to tell your code which pin you use.
@@AndreasSpiess Thank you very much you wonder swiss-person!!
can you please do a video on grove ultrasonic sensor with raspberrypi setup and software
Just google and you will find it.
Thanks for that!
I wanted to try the new micro raspberry and this video will be useful!
Edit: pico i mean
I am not sure if Circuitpython runs on the Pico. They decided for Micropython.
@@AndreasSpiess but... :(
Don't destroy my dreams just when i discover something new 🙀😹
A beta should run...
@@AndreasSpiess thanks, will try
I have a tinkerboard.. can i use raspbian so it can become 100 % raspi ?
I do not know. I only use Raspberries
We need a review of the Raspberry Pi Pico!
You should get one ;-)
@@AndreasSpiess I absolutely will 😁
I meant a review. I would wait with the Pico...
@@AndreasSpiess Something using the PIO (Programmable IO) would be useful.
@@AndreasSpiess Will these lib will work on Raspberry Pico also? it also can be programmed by circuit python.
Indeed interesting ! As usual. You probably didn't expect any other comment....
Thank you. The video currently performs bad. Rank 10 of 10. This is not what I have expected :-(
@@AndreasSpiess Strange. This is a very interesting topic and very usefull. Maybe people are a bit tired of over exposure to their computer and/or RUclips because of lockdowns and staying indoor. I'm sure the video will gain interest especially with the new Rasb. Pico being available. I already ordered 3 of those. I'll promote the video to my contacts and think alikes... ;-)
I am interested in lora satellites and I have seen your videos about two small satellites. please prefer me some links so that I could gain some knowledge.
www.google.com ;-)
Unfortunately an OS like Linux makes it much more difficult to get 100% correct timing when needed. Ex. if you want to send or receive high-frequency signals, an Arduino (or Attiny or ESP8266 or ESP32 or STM32 or ...) is just way easier because you can get the timing correct with just delays (or real timer- or pin-interrupts). On a Pi, your process can get pre-empted at the critical moment, messing up the crucial timing. Optimized mechanisms as in the pigpio package can reduce the problem a bit, but are way more difficult to use. I tend to do real-time stuff on a uP (ex. Attiny84) and have it communicate with the Pi using a protocol that the Pi can handle without glitches.
You are right: Real-time applications are in the domain of microcontrollers.
hi very interesting video, thanks for share, maybe possible send the values obtain of sensors from raspberry to one website and make remote estation to get information, thanks.
Maybe in the future...
@Andreas Spiess
Hello Andreas,
I am trying to read an accelerometer data stream using arduino nano 33 ble, i get the device conntected and subscribe to the characteristic. but still having problems with getting the values, it would be really nice if you can help me getting it work. thanks and by the way nice and very informative videos :)
Unfortunately I cannot do remote debugging :-( But I am sure you find the problem if you check every function alone before you try everything together.
Will it works if i install Ubuntu on my raspberry pi, i mean - can i plug in sensors to raspberry?(i suppose -yes, but in not sure)
I never used Ubuntu, so I do not know.
@@AndreasSpiess thanks a lot). I'm going to check it)
Thank you very much
You are welcome!
Why the resistor for the button?
It is a pull-up resistor.
As Andreas said, it pulls up the input into a known state (High). Without it, stray voltages may show a high or low on the input at random.
@@7alfatech860 thanks!
Thanks this is grate.
You're welcome!
I have an arduino. But raspberry pi sensors. Can I use them on my arduino?
You have to check if they support the 5 volt of the Arduino. Then you can use them.
Hi Andreas, I love your videos and I would like you to make a video of Raspberry Pi Pico :)
You have to sleep one night (or become a Patreon) ;-)
@@AndreasSpiess You are the best Andreas :) I respect you a lot. Thank you for the reply.
Hey, I just found out today about Raspberry Pi Pico. Maybe you should take a look at it!
Already ordered...
looking forward that the Raspberry Pi 5 to have faster I/O for even more sensors lol.
You saw that we had to throttle the speed to read one of the sensors. It is fast enough for that purpose...
Zooming in on some of the text displays would would help.
Unfortunately I do not have this possibility :-(
@@AndreasSpiess Thanks for the content, I have a project with my brother replacing an arduino with RPI so this is quite timely.
Even in Siberia the temperature does not get below 0 Kelvin ( -1725 C) :)
:-))
Btw, do you know Ruuvitag's?
I tried to buy one. Unfortunately it does not work with Paypal :-(
What's meant with "No Docker" in the description. Just that no Docker is used in the video? Or just that you do not take money from Docker for your videos? Or smth else?
Something else...
Polarity of your thermocouple incorrect?
I do not know...
what about ccs811 sensor ????
It has an I2C interface. So you just need a library. BTW: I hope you do not want to measure CO2 with this sensor (see my CO2 videos)
@@AndreasSpiess actually, yeah I want to measure co2 with that sensor, it's won't work or what??
Learners, Students start their project, at the first stage, with arduino. So i think you can create a detailed series of videos with arduino and its software.Learners will be highly benefited.Later you can take this learning to another level (i+1)adding 1=unknown to the already known factors =i., Thank you.For example with Raspberry pi.
This channel is for advanced users or users with ambitions. There are many channels with the simple tutorials. I would not like to create such videos :-(
We talk a lot about sensors and buttons and trying to be energy efficient as possible. I'm wondering why we are not using battery less sensors and buttons, Philips Hue Tap has been around for so many years and I still don't see an alternative for the DIY public. It seems that the only option so far is to interface an EnOcean(www.enocean.com/en/products/enocean_modules_24ghz/) module to our ESP32 or Raspberry Pi and use their Motion/Temperature/Humidity/Lux sensors or buttons. Looks like Eltako uses exact the same modules, hard to believe there is only one way and so few doing battery less devices.
Enocean have great products. But you need a different technology (no Wi-Fi) to use them because they produce extremely low energies.
Github link not complete :-/.
Thanks. It should work now.
Currently I used a arduino as an I2C-ADC, simply because I didn’t had the necessary board.
Also a good possibility...