Sending Data from an Arduino to Python | Pyserial | DHT11

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 มิ.ย. 2024
  • Sending Data from an Arduino to Python Tutorial | Pyserial | DHT11
    This video will look at how sensor data can be transmitted from an Arduino to Python via the serial port. The Pyserial and Schedule python libraries will be used, along with a DHT11 sensor.
    --------------------------------------------------------------------------------------------------------------------
    Arduino and Python scripts
    Arduino code:
    github.com/Chams123456/Arduin...
    Python code:
    github.com/Chams123456/Arduin...
    Circuit diagram:
    github.com/Chams123456/Arduin...
    ---------------------------------------------------------------------------------------------------------------------
    DHT11 Sensor:
    www.amazon.com/Temperature-Re...
    ---------------------------------------------------------------------------------------------------------------------
    Intro music:
    Happy Rock
    Attribution license: www.bensound.com
    ----------------------------------------------------------------------------------------------------------------------
    Thumbs up and Subscribe Icons are made by
    Pixel perfect from www.flaticon.com
    -----------------------------------------------------------------------------------------------------------------------
    Hope this video helps.
    If you have any questions, please leave a comment, and don't forget to like and subscribe.
    Cheers!

ความคิดเห็น • 40

  • @alecabuan6674
    @alecabuan6674 2 ปีที่แล้ว +3

    Solved all my problems in such a short video. Amazing!

  • @coreydufeal2778
    @coreydufeal2778 2 ปีที่แล้ว

    Very clear and precise video. I appreciate it. In all the videos I have watch on how to send data from Arduino to Python this one actually clearly defined the steps and why we do what we do.

  • @brunosm0
    @brunosm0 4 ปีที่แล้ว +2

    you are genious explaining this things to others, thank you

  • @cometmace
    @cometmace 3 ปีที่แล้ว

    Up and running reading data from the Arduino in less than 10 minutes. Thanks.

  • @bijonmathew1001
    @bijonmathew1001 2 ปีที่แล้ว

    Thanks, I was just looking for this .

  • @kacper925
    @kacper925 3 ปีที่แล้ว

    very helpful, thanks!

  • @mauliadianti
    @mauliadianti 4 ปีที่แล้ว +1

    thankyou for the tutorial

  • @saianishmalla2646
    @saianishmalla2646 3 ปีที่แล้ว

    good video mate :)

  • @NitrojamREC
    @NitrojamREC ปีที่แล้ว

    Thank you!

  • @electricalcoder3025
    @electricalcoder3025 4 ปีที่แล้ว

    Superb..work dude....👍👌👏👌👍👌👏👌👍👍👌👌👏👍👍......and I subscribed..too...I will encourage..to my extreme...as we have the same...passion..and interset.....anyway....all the very Best from Electrical Coder 👍

  • @omereroglu6772
    @omereroglu6772 2 ปีที่แล้ว

    good job
    thank you

  • @sitinuruliman7789
    @sitinuruliman7789 3 ปีที่แล้ว +1

    In python codes, what if I want to split multiple data values, for example I have 3 sensors reading. So what codes need to be done? it is the same?

  • @bogdanapachitei3284
    @bogdanapachitei3284 4 ปีที่แล้ว +1

    Thanks for help you . It doesn't work for Atmega 2560,
    receives erroneous information from serial . Do you have a solution please?

  • @edgaromarreynatorres3940
    @edgaromarreynatorres3940 3 ปีที่แล้ว

    So the values sensor are in
    list_variables [1]
    list_variables [2]
    ???

  • @prasadvaidya9563
    @prasadvaidya9563 3 ปีที่แล้ว

    I’m setting the timeout to 2 while creating the serial object. When I’m reading from serial port I’m checking wether data is present in input buffer by :
    if(obj.inWaiting>0) :
    If the data packets are interrupted it hangs in there.... I have given timeout value as 2 still it’s waiting indefinitely... why it’s not considering timeout value????

  • @rverm1000
    @rverm1000 2 ปีที่แล้ว

    I want to use a 16 to 1 mux chip with an arduino to read 16 voltages continously. This video will help in accomplishing that

  • @mayureshkulkarni4534
    @mayureshkulkarni4534 3 ปีที่แล้ว

    Can we add a counter to the values that are being read from arduino?

  • @cometmace
    @cometmace 3 ปีที่แล้ว

    Why open and close the serial port in a loop? Why not open, enter a loop, close when loop finishes? Is there some disadvange to keeping a quiet serial port open?

  • @victormungai
    @victormungai 2 ปีที่แล้ว

    This person just saved my degree🤣🤣🤣

  • @TykeBread
    @TykeBread 2 ปีที่แล้ว

    is there a way to constantly read the arduino without it pausing everytime it reads

  • @Manuelol
    @Manuelol 3 ปีที่แล้ว

    How can i write in the serial port of the arduino tho?

  • @-scieng-6592
    @-scieng-6592 3 ปีที่แล้ว

    thanks, tried this but was only able to get it working by using
    arduino_data = arduino.read()
    instead of
    arduino_data = arduino.readline()
    Also, I do not get the exact values, decimals, just rounded to the nearest value.

  • @akshatpande1649
    @akshatpande1649 4 ปีที่แล้ว

    can we do the reverse?? like send a string of data to arduino because i wanted to send my x and y stepper values to the arduino from python

    • @thatsengineering5235
      @thatsengineering5235  4 ปีที่แล้ว

      Yes, you can try the arduino.write (variable_name) attribute of the Pyserial lib

  • @kimatong1166
    @kimatong1166 2 ปีที่แล้ว

    Why your (-) of HDT11 is connected to 3.3V?

  • @ravishah8176
    @ravishah8176 3 ปีที่แล้ว

    Greeting
    How can i transfer data from Arduino serial monitor to website automatically.

  • @Slayer-ft6tl
    @Slayer-ft6tl 2 ปีที่แล้ว

    why should the connection be re-established everytime as shown here?

  • @ilkeraykut7064
    @ilkeraykut7064 3 ปีที่แล้ว

    Thanks for the video.I have question.How can we do this without Arduino USB cable? How can we communicate python and arduino without cable?

    • @Manuelol
      @Manuelol 3 ปีที่แล้ว

      You could use a wireless USB cable, but the computer must be connected to the arduino via an USB cable in order to get the data from the python code.

  • @027_lakshaynegi6
    @027_lakshaynegi6 2 ปีที่แล้ว

    Can we send data from pc to MCU?

  • @sreekantha4025
    @sreekantha4025 2 ปีที่แล้ว

    I am getting empty data while reading the lines from serial like empty b ' ' could any one help me on this

  • @mariopadilla1524
    @mariopadilla1524 3 ปีที่แล้ว

    can it be done if i want to send data via bluetooth?

    • @behnammobaraki5091
      @behnammobaraki5091 3 ปีที่แล้ว

      Hey. Have you found any solution for bluetooth connection between Arduino and Raspberry Pi then saving the data?!! I have the same problem!!!!

  • @leonhs1476
    @leonhs1476 3 ปีที่แล้ว

    why does my python look so different im confused

  • @achmadarifmunaji3320
    @achmadarifmunaji3320 3 ปีที่แล้ว

    then what if we want to send data from Arduino via the internet, please explain how, thank you

    • @thatsengineering5235
      @thatsengineering5235  3 ปีที่แล้ว

      You would need a WiFi module to connect the Arduino to the internet. You can use an ESP8266 module or a NodeMCU (ESP 12) to do this.

  • @ademguler8931
    @ademguler8931 3 ปีที่แล้ว

    i have a error in your arduino code and i cant fixed.

  • @henkoegema6390
    @henkoegema6390 2 ปีที่แล้ว

    Thanks for interesting video.
    However, this line in my program: "arduinoData=serial.Serial('/dev/ttyACM0',115200)" gives me
    error: arduinoData=serial.Serial('/dev/ttyACM0',115200) AttributeError: module 'serial' has no attribute 'Serial'
    I am running my program in a virtual environment (venv) an have imported module pyserial3.5.

    • @bijonmathew1001
      @bijonmathew1001 2 ปีที่แล้ว

      have you installed pyserial. If yes and still you have problem then I believe you might have named your python file as serial.py . If that is the case change the name .