Python 🐍 + Arduino UNO with pyFirmata

Поділитися
Вставка
  • Опубліковано 11 гру 2024

КОМЕНТАРІ • 194

  • @RonKirchner
    @RonKirchner 4 роки тому +8

    Thank you Sir! I liked the tutorial and learned a lot about the combination of those two strong players (Arduino + Python) in the IoT.

  • @RunningRunner46
    @RunningRunner46 Рік тому +1

    my arduino program stops working when I terminate the consol why??. how can I store my upload inside arduino?? as soon as I close python the arduino board stops working

    • @apm
      @apm  Рік тому

      pyFirmata communicates over a serial port to read and write instructions. The instructions come from the attached computer. When the cord is disconnected, the instructions stop. Embedded code is needed to continue running on the Arduino. Options are MicroPython: apmonitor.com/dde/index.php/Main/SensorMeasurement or the Processing IDE to compile and run C code on the Arduino.

  • @Gabasbds
    @Gabasbds 5 років тому +3

    Thank you so much! I was stuck in my project, but with your video I was able to get it done!

    • @apm
      @apm  5 років тому

      I'm glad it helped.

  • @jameswelperez3185
    @jameswelperez3185 3 роки тому +1

    Does pyFirmata support SIM808 GPS Module and Arduino Uno? I want to interface and get the GPS location data real time using Python.

    • @apm
      @apm  3 роки тому

      pyFirmata is a generic interface to the Arduino. It allows you to read the pins and control the digital outputs. The SIM808 has an ATMega328 that likely has custom firmware to read from the GPS and make the data available through Bluetooth. I do not recommend overwriting the Firmware with the Standard Firmata.

  • @teddyhraje5117
    @teddyhraje5117 4 роки тому +3

    Hello, I have installed pyfirmata but when i wrote this: from pyfirmata import Arduino, util. It gave me ImportError: cannot import name 'Arduino' from partially initialized module 'pyfirmata' (most likely due to a circular import). Does anyone know how to fix this?

    • @apm
      @apm  4 роки тому +1

      This can happen if you named your program pyfirmata.py. Try changing the name to something else like test_pyfirmata.py. Here is additional help on pyFirmata: pypi.org/project/pyFirmata/

  • @jumbo999614
    @jumbo999614 4 роки тому +2

    I got error at 8:04 : 'pip' has no attribute 'main'

    • @apm
      @apm  4 роки тому +4

      Try this instead: apmonitor.com/wiki/index.php/Main/GekkoPythonOptimization?action=sourceblock&num=1 but replace gekko with the package name.

  • @rrocky20_
    @rrocky20_ 2 роки тому +1

    How can i make a door lock system with Arduino + a face mask detection as my project ?

    • @apm
      @apm  2 роки тому

      An Arduino likely wouldn't have enough CPU / memory to handle the task. Maybe try a Raspberry Pi or other type of more capable compute modules. Here is some help on the face detection: apmonitor.com/pds/index.php/Main/FacialRecognition

  • @SunilBisoyisbsunil3
    @SunilBisoyisbsunil3 Рік тому +1

    How to read I2C data received from acclerometer? This averages all the acceleration values and gives an overall acceleration. I want to receive all the data from all three axes.

    • @apm
      @apm  Рік тому

      Here is another I2C device connection. apmonitor.com/dde/index.php/Main/TemperatureSensor Try looking online for Arduino or Micropython code for your device.

  • @duller9430
    @duller9430 3 роки тому +2

    Do u have a video about arduinos for complete beginners on how to code.
    Btw not for python

    • @apm
      @apm  3 роки тому

      It is Processing (C±± code). You can get any C±± tutorial to help you get started.

  • @khaileng3020
    @khaileng3020 2 роки тому +1

    I got an error of
    AttributeError : 'module' object has no attribute 'main'

    • @apm
      @apm  2 роки тому

      Try renaming your script file as something else than main.py. Does that help? www.linuxquestions.org/questions/linux-software-2/python-attributeerror-%27module%27-object-has-no-attribute-%27main%27-4175478873/

  • @khaileng3020
    @khaileng3020 2 роки тому +1

    Can u make a video of pyfirmata with hc-06 bluetooth ?

    • @apm
      @apm  2 роки тому

      Thanks for the suggestion.

  • @jinaykothari4511
    @jinaykothari4511 2 роки тому +1

    Do you have an arduino simulator with python

    • @apm
      @apm  2 роки тому

      Yes, here is an offline emulator for the TCLab that is based on an Arduino Leonardo: tclab.readthedocs.io/en/latest/notebooks/04_Emulation_of_TCLab_for_Offline_Use.html There are also emulators such as micropython.org/unicorn/

  • @durgakrishnan8526
    @durgakrishnan8526 3 роки тому

    Tq somuch sir. It will take twodays to catch this concept. This is the end point to my question which i was search in several websites🙏🙏🙏

  • @j.a.m.s6340
    @j.a.m.s6340 3 роки тому +1

    thank you so much, i have been looking how to do this for days and now i found it, thank you so much

  • @sudeshkumar5640
    @sudeshkumar5640 4 роки тому +2

    Hello sir,
    I am a Macintosh user. Is there a way to use pyfirmata and get the data because I don't have the name as "COM 3 or COM 4".... What can I do??

    • @apm
      @apm  4 роки тому +1

      Search for /dev/tty.usbserial* or /dev/cn.* (on MacOS) and /dev/ttyUSB* or /dev/ttyACM* (on Linux).

  • @mdmohidulhasan588
    @mdmohidulhasan588 4 роки тому +1

    Can you explain exactly how you back propagated from pyfirmata analog read which is 0 - 1 to ADC 10 bit 0 - 1024 . Is there a way to scale the raw sensor data back to 10 bit ADC ??

    • @apm
      @apm  4 роки тому

      More information on reading the temperature sensor is here: apmonitor.com/pdc/index.php/Main/TCLabSensor

  • @kellerwaldron2452
    @kellerwaldron2452 5 років тому +5

    is it possible to upload the python code to the arduino in the same way you upload a sketch to the arduino? the purpose here being so you can disconnect from the serial port.

    • @apm
      @apm  5 років тому +2

      Here are some tips on doing this: arduino.stackexchange.com/questions/105/programming-an-arduino-using-python-rather-than-c-c and stackoverflow.com/questions/8114916/is-there-a-way-to-compile-python-code-onto-an-arduino-uno

  • @Koolkole27
    @Koolkole27 2 роки тому +1

    Will this work if you have it not connected to the computer like you can with the default code language of the audrino? Like load the code to it then un plug it from the pc and have it exicute the code?

    • @apm
      @apm  2 роки тому

      You would need to use microPython if you want to run Python on the device. The ESP32, Teensy, or pyBoard, or others can run a simplified version of Python.

  • @mattm7482
    @mattm7482 4 роки тому +1

    Thanks for the help on Pyfirmata with setting things up!

  • @Omaralejandroli
    @Omaralejandroli 4 роки тому +1

    I'm sorry, I'm new in this area, my question is: what's the reason why you define the variable "iterator"? It's the only thing that I didn't understand their function

    • @apm
      @apm  4 роки тому +1

      I'm not sure why the package requires it but I think it is so that you can make repeated calls to get data.

    • @Omaralejandroli
      @Omaralejandroli 4 роки тому +1

      @@apm such a fast answer, I really appreciate it, do you have some URL or website where I can learn how to make an interface Arduino-Python? It's my last question, thanks!!!

    • @apm
      @apm  4 роки тому

      Here are additional examples: apmonitor.com/heat.htm You can write custom firmware or use pyFirmata.

  • @crimsonburn12
    @crimsonburn12 3 роки тому +1

    HI, i keep getting a module not found and ive already downloaded it multiple times

    • @apm
      @apm  3 роки тому

      You probably have multiple versions of python on your computer. Here are some tips on installing packages: apmonitor.com/pds/index.php/Main/InstallPythonPackages

  • @jasonackermann7804
    @jasonackermann7804 4 роки тому +2

    Does pyFirmata also support the Elegoo UNO R3? Thank you!

    • @apm
      @apm  4 роки тому

      Yes, it should work with any UNO R3 device. The Elegoo is just the name of the company that produces the UNO R3.

  • @waleedaiad3411
    @waleedaiad3411 2 роки тому +1

    How can i use hc-12 with arduino using python language?

    • @apm
      @apm  2 роки тому +1

      Probably not with Python: howtomechatronics.com/tutorials/arduino/arduino-and-hc-12-long-range-wireless-communication-module/

  • @rosedew5932
    @rosedew5932 3 роки тому +2

    Hi, I'm actually trying to connect my phyton code with arduino using pyserial but I can't run the code so I found your video. I will try this pyFirmata package later but how does the two relate with each other? I mean pyserial and pyFirmata?

    • @apm
      @apm  3 роки тому +1

      pyserial just communicates over a serial connection while pyFirmata also includes the firmware for communication. If you use pyserial, you'll need to write your own firmware such as done here: apmonitor.com/heat.htm

  • @jeremiahhardge6968
    @jeremiahhardge6968 3 роки тому +1

    is it possible to run a python script with imported modules on an arduino?

    • @apm
      @apm  3 роки тому

      Unfortunately, that is not possible to run directly on the Arduino.

  • @Zainab-mm2yk
    @Zainab-mm2yk 4 роки тому +1

    how can I convert the analog value to the actual value sensor that has been reading? As you've mentioned (value*5000-500)/10 is the same for all kinds of sensors on Arduino Uno?

    • @apm
      @apm  4 роки тому

      Each sensor has its own relationship between voltage and the measured value. You can typically find it in the documentation for the sensor.

  • @copycarvers
    @copycarvers Рік тому +1

    getting this error
    AttributeError: module 'serial' has no attribute 'Serial'

    • @apm
      @apm  Рік тому

      You probably installed the wrong package "serial". Try "pip uninstall serial" to remove the package and "pip install pyserial" to install the correct package. More details here: stackoverflow.com/questions/11403932/python-attributeerror-module-object-has-no-attribute-serial

  • @akankshasontakke2714
    @akankshasontakke2714 5 років тому +8

    can you provide me the code for IR sensor values in python shell (arduino)

    • @apm
      @apm  5 років тому

      Sorry, I don't have data from that type of sensor.

  • @dudezgamez550
    @dudezgamez550 5 років тому +1

    My computer said it could not access the port. What can I do?

    • @apm
      @apm  5 років тому

      What operating system are you running? If it is Windows then check the device manager as you plug it in. You should see it appear. You may need to adjust the COM port number for the Serial Interface. Here are some additional tips from the TCLab: apmonitor.com/pdc/index.php/Main/ArduinoSetup

  • @duller9430
    @duller9430 3 роки тому +2

    Does this work on Mac

    • @apm
      @apm  3 роки тому +1

      Yes, no problems with a MacOS. I recommend the Arduino Leonardo for MacOS.

  • @emreaka3965
    @emreaka3965 5 років тому +3

    Can we write program with Python to Arduino?

    • @apm
      @apm  5 років тому +2

      Yes, pyFirmata is one way to communicate from python to the Arduino. You can't use Python directly on the Arduino so you need to connect with a serial connection such as with a USB cable.

    • @emreaka3965
      @emreaka3965 5 років тому

      @@apm Thank you so much.

  • @RenalTutor
    @RenalTutor 4 роки тому +1

    thank you sir. but, can code python upload to arduino, and running it without open computer ?

    • @apm
      @apm  4 роки тому +1

      Unfortunately that isn't possible with an Arduino Uno. There are other microcontrollers or microprocessors such as the Raspberry Pi that can run Python.

    • @RenalTutor
      @RenalTutor 4 роки тому

      @@apm oke sir. thank you very much

  • @pedroandretube
    @pedroandretube 5 років тому +1

    Sorry, I'm no specialist in Arduino nor in Python, but to me it looks inconsistent that you make such workaround to the case someone doesn't have the needed library pyfirmata installed, but then you hardcode the port where the Arduino is connected. Is there a way to search for the COM port where the Arduino is connected?

    • @apm
      @apm  5 років тому

      Check out the find_arduino code here: github.com/jckantor/TCLab/blob/master/tclab/tclab.py This can help you find the port automatically for Windows, Linux, or MacOS.

  • @keremakd5651
    @keremakd5651 4 роки тому +1

    can i upload the python code to the arduino- or is it only usable if it is connected to the computer

    • @apm
      @apm  4 роки тому +1

      You can't upload Python to the arduino. It needs to run through a serial connection.

  • @shaymckim5202
    @shaymckim5202 4 роки тому +2

    You are a genius!!!
    Thank you sooooo much!

  • @sahajrajmalla
    @sahajrajmalla 4 роки тому +1

    can't we use the arduino by unplugging from our PC ?

    • @apm
      @apm  4 роки тому +1

      Yes, you can but not with PyFirmata. You'll need to write custom firmware with the Processing Language (C code). There is no way to have it run Python without a serial connection to a computer.

    • @sahajrajmalla
      @sahajrajmalla 4 роки тому

      @@apm Thank you Sir!

  • @ritafarsoun9748
    @ritafarsoun9748 3 роки тому +2

    You are a born teach! Seriously most tuts don't have that clear explanation.
    Need to ask though hopefully I'll get an answer C++ or python?
    I feel python easier to understand maybe because I'm a little bit familiar with the basics.
    I will be focusing at 1st on automation building then i would like to learn about creating prothesis that respond muscle movement ect. That's my future aim
    So python or c++

    • @apm
      @apm  3 роки тому

      I'd recommend that you start with Python. C++ is good for programming the Arduino if you want the code to run on the device without any external connection. For development, Python is better.

  • @gatiktrivedi7863
    @gatiktrivedi7863 4 роки тому +1

    is it necessary to have the firmware in the Arduino software?

    • @apm
      @apm  4 роки тому

      The firmware is a default option in the Arduino IDE. Yes, it is required to run pyFirmata. You only need to load it once, however, and it will stay on the device even if power is cycled off.

  • @sbksdg7019
    @sbksdg7019 Рік тому +1

    Thank you sir!!
    How do i upload the code there??

    • @apm
      @apm  Рік тому +1

      You need to download the Arduino IDE. See the instructions starting from 0:40

  • @GiuseppeDeLilla
    @GiuseppeDeLilla 4 роки тому +1

    i can't install pyfirmata in Raspberry Pi 4 ?of this form.can you HELP me Thank you

    • @apm
      @apm  4 роки тому +1

      Sorry, I haven't installed it on a Raspberry Pi previously. Maybe try this: raspberrypi-aa.github.io/session3/firmata.html

  • @mr.47hitman19
    @mr.47hitman19 5 років тому +1

    Thank you. I have a question, Is it possible to add Q-learning algorithm by tensorflow and python? please help me..I want to make q-leaning (reinforcement learning) machine like a crawling robot.

    • @apm
      @apm  5 років тому +1

      I don't have experience with Q- learning.

    • @mr.47hitman19
      @mr.47hitman19 5 років тому

      @@apm Thank you for your reply.

  • @giobarista2882
    @giobarista2882 3 роки тому +1

    You are the man my friend thank u!!

  • @mmols9904
    @mmols9904 3 роки тому +1

    thank you ,, very interested
    i have just installed it !! works great !!

  • @nitpu2112
    @nitpu2112 4 роки тому +1

    can you explain the installation process of python

    • @apm
      @apm  4 роки тому

      Yes, here is help on installation: apmonitor.com/pdc/index.php/Main/InstallPython

  • @lucderan
    @lucderan 5 років тому +2

    thank for sharing! Very useful! I was going to get rid of my arduino since i switched to micropython and ESP32! #SaveAnArduinoUseFirmata!!

    • @apm
      @apm  5 років тому

      That was close!

  • @kit0925
    @kit0925 5 років тому +1

    .....I know this video is 2 years ago, but it is useful to a beginner like me.
    When I'm running: board = Arduino('COM6')
    I got an error:
    ---------------------------------------------------------------------------
    TypeError Traceback (most recent call last)
    in
    7 import time
    8
    ----> 9 board = Arduino('COM6')
    10 iterator = util.Iterator(board)
    11 iterator.start()
    ~\Anaconda3\lib\site-packages\pyfirmata\__init__.py in __init__(self, *args, **kwargs)
    17 args = list(args)
    18 args.append(BOARDS['arduino'])
    ---> 19 super(Arduino, self).__init__(*args, **kwargs)
    20
    21 def __str__(self):
    ~\Anaconda3\lib\site-packages\pyfirmata\pyfirmata.py in __init__(self, port, layout, baudrate, name, timeout)
    105 # Iterate over the first messages to get firmware data
    106 while self.bytes_available():
    --> 107 self.iterate()
    108 # TODO Test whether we got a firmware name and version, otherwise there
    109 # probably isn't any Firmata installed
    ~\Anaconda3\lib\site-packages\pyfirmata\pyfirmata.py in iterate(self)
    280 received_data.append(data & 0x0F)
    281 while len(received_data) < handler.bytes_needed:
    --> 282 received_data.append(ord(self.sp.read()))
    283 elif data == START_SYSEX:
    284 data = ord(self.sp.read())
    TypeError: ord() expected a character, but string of length 0 found
    And I checked I'm using the correct port (COM6), no other devices are using the same port.
    Anyone with the same issue? (running python 3 with UNO)
    Thanks a lot.

    • @apm
      @apm  5 років тому

      Did you load the Standard Firmata on your board before running the Python script? It appears that the there is no response from the board.

    • @kit0925
      @kit0925 5 років тому

      Yes I did, and funny thing is,I found out that if I press the "RESET" button on the UNO board when the code is running this line:
      board = Arduino('COM6')
      IT WILL WORK!!!!…......for once
      it gave me the reading from the Arduino
      But when I run the code again directly, the error now changed to:
      SerialException: could not open port 'COM6': PermissionError(13, 'permission denied。', None, 5)
      I have to unplug the Arduino and reconnect in order to work again, but the above repeated.....I will have to press the "RESET" on the board for the code to successfully run "board = Arduino('COM6')"...

    • @apm
      @apm  5 років тому

      @@kit0925 you can fix this error if you close the serial connection at the end of your script. Use board.exit()

  • @lataarya2611
    @lataarya2611 3 роки тому

    hello bhaiyaan maine bhi aisa arduino uno purchase kiya hain aur code editor bhi same hain arduino ka par main usme serial port select nahi kar paa raha hoon so pls make a tutorial on how to download arduino ite editer to how to upload code to arduino uno . Thanks .

    • @apm
      @apm  3 роки тому

      I don't think I understood a lot of your comment but this may help: apmonitor.com/pdc/index.php/Main/ArduinoSetup

  • @jogithajohn5689
    @jogithajohn5689 5 років тому +3

    how to make pyfirmata work for python 3.6?

    • @apm
      @apm  5 років тому +1

      You can do "pip install pyFirmata" at the command line: pypi.org/project/pyFirmata/ Here are additional details on managing packages: apmonitor.com/che263/index.php/Main/PythonIntroduction See section on "Install Packages with pip (Command Line)"

    • @Rahul2011ify
      @Rahul2011ify 5 років тому +1

      try:
      from pyfirmata import Arduino, util
      except:
      from pip._internal import main
      main(['install','pyfirmata'])
      from pyfirmata import Arduino, util

  • @yueverlasting
    @yueverlasting 7 років тому +2

    hi~ I'm a student from Taiwan.
    May I ask some question about pyfirmata?
    I use Arduino uno & DHT11 senser to try this example.
    But I can't access the data from analog port.
    I can get right data in arduino Serial port monitoring window.
    however, I can't get any data in python.
    if time is allowed, hope you can help me to slove this problem.
    Thanks

    • @apm
      @apm  7 років тому +4

      +Yu Chieh Huang, the DHT11 or DHT22 produces a digital signal (series of 1s and 0s) that you need to decode to get numbers. You should connect to a digital pin instead of an analog pin. Here is some additional help: www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-an-arduino/

    • @yueverlasting
      @yueverlasting 7 років тому

      hi
      Sorry for asking more question.
      I change my sensor to digital pin but I still can't get any data.
      I also use YL-69 Moisture Sensor .
      However it can't work too.
      Both digital and analog pins didn't work.
      I try two ways to use read()
      1. define the pin at first.
      pin_temp = board.get_pin('d:2:i'); result_temp = pin_temp.read()
      2.result_temp =board.digital[2].read()
      I'm not sure if i use in wrong way or not.
      If you have any idea about this, please share with me.
      Thanks for your reply

    • @apm
      @apm  7 років тому +1

      You won't be able to use pyFirmata to read those values. You'll need to use the custom code for DHT11 that is outlined in the link I sent. The digital pin only reads a 1 or 0. The DHT11 sends a series of 1s and 0s that you need to decode such as 11001110000101001000111000011010001010 => T=30 degC and Relative Humidity=25. Those aren't correct 1s and 0s but it hopefully gives you an idea. The DHT11 code should work if you follow the instructions on the link I sent.

    • @nobytes2
      @nobytes2 6 років тому

      if you want to use pyfirmata you'll have to roll your own firmata firmware by adding dth11 header file and use those functions for decoding which is the easiest route to take here. Or else you'll have to write a python decoder but with serial latency I don't know if is feasible to read 1/0s from a digital input over serial and then decode.
      Edit: Nevermind, I don't think firmata will work. You'll have to use plain pyserial and write custom sketch for arduino.

  • @Kamil-kg2ku
    @Kamil-kg2ku 4 роки тому +1

    How do you download pyFirmata for Mac?

    • @apm
      @apm  4 роки тому +1

      It is the same on every platform (Windows, Mac, Linux): pip install pyFirmata Here is more information on the package: pypi.org/project/pyFirmata/ and more information on how to manage the packages: apmonitor.com/pdc/index.php/Main/InstallPython

  • @hudakhafaji4180
    @hudakhafaji4180 4 роки тому +2

    Thank you for such an informative video!! If it's ok to ask, is there a way for me to control the arduino without having to plug into the computer? (For example, over a wifi connection maybe?)

    • @apm
      @apm  4 роки тому

      Yes, there are wireless connections such as Bluetooth. If you write your own firmware (ino) file then you can control the Arduino with no connection. If you want to use Python then you'll need to be connected either with a USB cable or WiFi / Bluetooth.

  • @misterx5201
    @misterx5201 6 років тому +4

    Awesome Video ...keep it up man...❤

  • @wongsuper1
    @wongsuper1 4 роки тому +1

    haii may i ask how do you convert arduino code to python code?

    • @apm
      @apm  4 роки тому

      Arduino code is very similar to C. Maybe you could find some suggestions online to convert C to Python. However, the Python code won't run on the Arduino.

  • @ahmedhesham7996
    @ahmedhesham7996 5 років тому +1

    can you help me
    i need to send an number like '1234' as a password from a python code and receive it on arduino C code
    and i need to send back the temperature from arduino using sensor to use it in the python code

    • @apm
      @apm  5 років тому

      Check out the TCLab project. We use a serial connection to communicate back and forth to an Arduino. The source code is at: github.com/jckantor/TCLab and apmonitor.com/pdc/index.php/Main/ArduinoTemperatureControl (see apmonitor.com/pdc/uploads/Main/tclab.zip for zipped archive with ino and python source). We send new heater values with a.Q1 and a.Q2 and read temperatures with a.T1 and a.T2.

  • @hightechtoucan4236
    @hightechtoucan4236 4 роки тому +1

    This is a fantastic tutorial, what is the spec of the 'heater' component? looking to build one myself :)

    • @apm
      @apm  4 роки тому +1

      There is more info on the lab at apmonitor.com/heat.htm They are also available through Paypal or Amazon.

    • @hightechtoucan4236
      @hightechtoucan4236 4 роки тому

      @@apm Thanks

  • @KristijanPruzinac
    @KristijanPruzinac 5 років тому +1

    Hi does anyone know if and how I can change the baud rate for sending data?

    • @apm
      @apm  5 років тому

      Change the baudrate optional parameter: pyfirmata.readthedocs.io/en/latest/pyfirmata.html pyfirmata.pyfirmata.Board(port, layout=None, baudrate=57600, name=None, timeout=None)

    • @KristijanPruzinac
      @KristijanPruzinac 5 років тому

      @@apm tnx nice

  • @TomCrossSound
    @TomCrossSound 4 роки тому +1

    is there a way to get this working on a pi?

    • @apm
      @apm  4 роки тому

      You can run Python directly on a Raspberry Pi because it runs Linux. If you want to interface the Raspberry Pi to an Arduino then here are some tips: raspberrypi-aa.github.io/session3/firmata.html

  • @copycarvers
    @copycarvers Рік тому +1

    I am using jupyter notebook and its not working for me

    • @apm
      @apm  Рік тому

      You probably installed the wrong package "serial". Try "pip uninstall serial" to remove the package and "pip install pyserial" to install the correct package. More details here: stackoverflow.com/questions/11403932/python-attributeerror-module-object-has-no-attribute-serial

  • @MrTeose
    @MrTeose 4 роки тому

    How can I use the SCL and SDA of my arduino using pyfirmata

    • @apm
      @apm  4 роки тому

      I'm not sure about that.

  • @christianbegg2465
    @christianbegg2465 6 років тому

    What is the difference between using pyfirmata with Arduino and the pyBoard?

    • @rrc
      @rrc 6 років тому

      pyBoard is another type of microcontroller that may be able to run pyFirmata as well. pyFirmata is a standard firmware that accelerates development by making standard the interface to the gpio pins.

    • @mrtabisdad
      @mrtabisdad 6 років тому +1

      Both pieces of hardware do very similar things, but I believe the pyBoard to be a bit more expensive in my experience - but if you use an ESP32 running microPython, then the costs come right down. Just starting to play, so not that experienced as yet...

  • @Taran72
    @Taran72 4 роки тому +2

    Interesting video...had no idea Pyfirmata existed, thank you so much! Question: can I use Pyfirmata with multiple Arduino's?

    • @apm
      @apm  4 роки тому +2

      Yes, just specify the connection such as different COM ports in Windows.

    • @Taran72
      @Taran72 4 роки тому

      @@apm , thanks!

  • @laohanme7281
    @laohanme7281 3 роки тому

    Great tutorials, but now I looking for the solution for pyfirmata connect with my 4x4 keypads.

  • @cheesepuddin1266
    @cheesepuddin1266 3 роки тому +1

    "Arduino is not defined" is all I get from this

    • @apm
      @apm  3 роки тому

      There is a new way to pip install from a Python script. Try this instead:
      from pip._internal import main as pipmain
      pipmain(['install','pyfirmata'])
      The rest of it is the same. Then when you import Arduino, it should work. Here are other instructions on how to install Python packages: ua-cam.com/video/Z_Kxg-EYvxM/v-deo.html

  • @GabrielCarvalho777
    @GabrielCarvalho777 3 роки тому +1

    Hi professor, thank you very much for all videos and tutorials, I'm a big fan of ur work. Is there any way you could provide those images of those circuits (specially in minute 3:35), when you show how to 'do it yourself' the whole thing?
    Thanks!

    • @apm
      @apm  3 роки тому +1

      Here is more info on building the lab: apmonitor.com/che436/index.php/Main/PhysicalLab and apmonitor.com/pdc/index.php/Main/ArduinoTemperatureControl You can also order one on Amazon or through Paypal.

    • @GabrielCarvalho777
      @GabrielCarvalho777 3 роки тому

      @@apm Thank you, actually I'm the 'do it yoursefl' kinda person haha but I'm surely thinking about buying it! Again, thank you for your time!

    • @johna.villamil2773
      @johna.villamil2773 2 роки тому

      Hi @@GabrielCarvalho777 Could you build the system ?

  • @ivanhernandez-kw6nr
    @ivanhernandez-kw6nr 5 років тому

    Hello! do you know how to control servos on pins 21-40 on arduino Mega with pyFirmata?

    • @apm
      @apm  5 років тому

      Sorry, I don't have experience with the Mega.

  • @teamtrebirth4998
    @teamtrebirth4998 3 роки тому +1

    how to install pyfirmata?

    • @apm
      @apm  3 роки тому

      Try installing with pip: pip install pyfirmata Here are more details on package management in Python apmonitor.com/pds/index.php/Main/InstallPythonPackages

  • @fahimmuntasirniloy
    @fahimmuntasirniloy 2 роки тому +1

    Thanks a lot, this was very helpful sir

  • @LinhNguyen-ym8yg
    @LinhNguyen-ym8yg 6 років тому

    Hi, is the pyfirmata compatible with any arduino board? I have a MCU Node e12 but I can only code in python.

    • @apm
      @apm  6 років тому

      It should work but you may need to change your baud rate to 9600. Here is a relevant discussion thread: github.com/firmata/arduino/issues/338

    • @LinhNguyen-ym8yg
      @LinhNguyen-ym8yg 6 років тому

      Thank you so much

  • @premithmendis8004
    @premithmendis8004 3 роки тому +1

    what a wonder explanation thank you i learned a lot

  • @rancmeat
    @rancmeat 6 років тому +2

    Excellent tutorial, thank you.

  • @kleiman1
    @kleiman1 4 роки тому +1

    Thanks for the video !!!! it helped me so mutch. Now i'm looking for a way to send data from text file directly to the serial port (same port Arduino in connected to). Is it possible?

    • @apm
      @apm  4 роки тому

      Yes, check out the TCLab project that communicates over a serial USB connection. apmonitor.com/heat.htm See the source code links for Java, Python, and Matlab.

  • @jiteshchawla8917
    @jiteshchawla8917 4 роки тому

    How we can use relay board with arduino and python

    • @apm
      @apm  4 роки тому +1

      You can control a relay module with one of your Digital Output pins. You shouldn't use PWM unless you are using a BJT or MOSFET NPN transistor for the switch ON/OFF. PWM uses cycling at a high rate (like 500 Hz) to give a fractional output. This will wear out the relay module switch.

    • @jiteshchawla8917
      @jiteshchawla8917 4 роки тому

      @@apm can you make a tutorial on it or any article related to it. It will be very beneficial.actually i am making a home assistant. I have almost controlled computer now i am left with lights so i need the suggestion how i can do it. There is only one light in my room

  • @tayfun11100
    @tayfun11100 2 роки тому +1

    Thank you, thank you, and thank you

  • @balazsendrodi6544
    @balazsendrodi6544 6 років тому

    Small problem, can't convert the pin reading into float. any ideas why?

    • @apm
      @apm  6 років тому

      I'm not sure why that's not working. You may try to update the firmware on your Arduino. I'd also recommend that you check the value to see if it is NaN.

  • @ermano97
    @ermano97 6 років тому

    Is it compatible with Arduino Duemilanove?

    • @apm
      @apm  6 років тому

      I don't have that hardware but a quick search online showed that the duemilanove should be able to load the standard firmata. With the standard firmata I believe it should work with pyfirmata.

  • @rverm1000
    @rverm1000 4 роки тому +1

    Wow that was so helpful

  • @haneen3731
    @haneen3731 3 роки тому

    Thanks for this video!

  • @doutormaia6923
    @doutormaia6923 2 роки тому +2

    Muito bom, meus parabéns. Ótima didática, ajudou bastante!!!
    It's amazing teacher, I sincerely appreciate it.

  • @deekshithp7303
    @deekshithp7303 4 роки тому +1

    can you give source code

    • @apm
      @apm  4 роки тому

      Yes, it is available here: apmonitor.com/pdc/index.php/Main/ProcessControlProject

  • @ariquciha58
    @ariquciha58 5 років тому +2

    With all the various backgrounds, this guy uses a blue screen!

    • @apm
      @apm  5 років тому

      Even my work desk is very clean.

  • @yongchuan2252
    @yongchuan2252 3 роки тому +1

    Good afternoon sir, currently I am in school holiday so I would like to self-learning some idea for Arduino. My planning is to connect GUI, control system and database together. My GUI is written in python (currently using jupyter notebook), control system should be Arduino (just wanted to learn Arduino as it is suitable for many project), database is planned to be linked with GUI (watched video from youtube or did I need to create a new database in other method?).
    I think it would be good to simulate first before I purchase component. But currently I am facing some difficulty on how to connect the written GUI to simulation software. Any simulation software suggested? (hopefully simulation have following specs
    1. Have Arduino and Arduino IDE (since I currently I haven’t buy one)
    Allow to create new component (like if I wanted to have more sensor but the sensor that I wanted didn’t include inside so I can create myself
    3. Can connect to my GUI (or it is more preferable that I not to use jupyter notebook?)

    • @apm
      @apm  3 роки тому

      Here is a related project that may give you ideas.

  • @rvnreddy3929
    @rvnreddy3929 4 роки тому +1

    great tutotial

  • @betov75
    @betov75 3 роки тому

    Thanks!

  • @artigeniusStore
    @artigeniusStore 3 роки тому +1

    thank you

  • @harishhanchinal2838
    @harishhanchinal2838 5 років тому +1

    Thank you.

  • @DavidAmmerlaan
    @DavidAmmerlaan 6 років тому +2

    SeemsGood

  • @karacaveli4811
    @karacaveli4811 4 роки тому +1

    Cool cool cooool realy cool

  • @EternalScienceAndTech
    @EternalScienceAndTech 3 місяці тому

    Great teachings
    But too long

  • @floodbot974
    @floodbot974 3 роки тому

    what the fuck is this pruduction quality?

  • @choudino5939
    @choudino5939 4 роки тому

    Useless vid

    • @apm
      @apm  4 роки тому

      Thanks for the feedback. Anything specific that you were looking for?

    • @choudino5939
      @choudino5939 4 роки тому

      @@apm i want to know how use open cv with arduino to track objects

    • @apm
      @apm  4 роки тому +1

      @@choudino5939 here is another resource that may help: www.instructables.com/id/Face-detection-and-tracking-with-Arduino-and-OpenC/

    • @choudino5939
      @choudino5939 4 роки тому +1

      @@apm thnx tooo much

  • @yusufmirzaozdemir3770
    @yusufmirzaozdemir3770 6 років тому +1

    hi i am student from turkey
    please speak turkish

    • @apm
      @apm  6 років тому +6

      Wow - that is the first time someone has requested that I speak in a different language. I believe that UA-cam has subtitles and may offer translation.

    • @mikeshane2048
      @mikeshane2048 6 років тому +1

      Spend some of your spare time to learn English instead, it'll be useful for programming too
      and you are funny :D

    • @alexandremarcotte7368
      @alexandremarcotte7368 6 років тому +1

      hi i am a guy from Quebec
      Parles Français svp

    • @__ryu4088
      @__ryu4088 5 років тому +1

      hi i am student from germany bitte rede deutsch

    • @Omaralejandroli
      @Omaralejandroli 4 роки тому

      Hi, I'm a student from Mexico
      por favor habla español, estudiante turco jajaja