Questions tagged [python]

On-topic questions related to Python would include embedded programming, using it as a tool for circuit analysis, or how Python interacts with computational hardware. Questions about libraries, algorithms, syntax, or code optimization should be directed to stackoverflow.com.

43 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
73 views

How to calculate the Samples per second possible of a ADC (MAXIM 11605) using i2c with raspberry pi?

I would like to find out how many samples per second this ADC im using is capable of with a raspberry pi using i2c and python SMBUS2 library, but i dont know where to start. As far as i know this ...
2
votes
0answers
41 views

Trinket M0 PWM ValueError: duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)

I'm trying to control a servo motor from a Trinket M0. My circuitpython code is: ...
2
votes
0answers
618 views

PV cells (photovoltaic) I-V curve plot simulation

I am trying to plot the I-V curve using python because that helps me in understanding PV cells / solar panels (and diodes as a general thing). I know the formulas ...
1
vote
0answers
26 views

Rx buffer overwrites Tx buffer in spidev xfer2

I'm setting up a comms link between an STM32F407 MCU and the Pi3B+. The code shown below works but when the data is printed out, it looks like the RX buffer overwrites the TX one. How do I stop that? ...
1
vote
1answer
98 views

Problem communicating with UART1 with Python on Beaglebone Black

I am having issues communicatong to UART1 of my Beaglebone Black with python My code on Python3 is as follows: import Adafruit_BBIO.ADC as ADC import Adafruit_BBIO.GPIO as GPIO from time import sleep ...
1
vote
1answer
183 views

Sudden raspbery pi power cut or random long delay when running stepper motor using pigpiod

So I wrote another program that can run stepper motor nema 34 using leadshine DM860 driver and this is the example of my code: ...
1
vote
0answers
313 views

Dac over raspberry pi spi troubleshooting

I am trying to output a signal with dac124s085 from python code on a raspberry pi 3b, running Raspbian Stretch (kernel 4.14.30-v7+ #1102). I am sure the spi master driver is enabled - dtparam=spi=on ...
1
vote
0answers
323 views

Solve \$n \times n\$ rectangular grid of resistors for mesh currents

I am modeling a mechanical process by using an electrical analogue. I need to calculate the loop (mesh) currents, then I can see if any mesh current is greater than a predetermined value \$\lambda\$. ...
1
vote
0answers
245 views

Problem with Pyserial read time

I'm building a RS485 network with rpi3 as master and a bunch of c51 mcu as slaves. After sending an address, the master waits for the slave to respond and then starts to send data. I'm using Pyserial ...
1
vote
0answers
195 views

What are the materials needed for boiling milk alarm sensor?

I have recently bought raspberry pi to start working on it. I have never ever used it before. I am thinking of doing very basic task of led bulb on/off for getting into it. I am curious on developing ...
0
votes
0answers
44 views

Custom PCB with ADC for monitoring Lifepo4 battery bank voltages

I designed a custom PCB board to allow me to monitor the individual battery cell voltages in my Lifepo4 48v battery bank. Here is a schematic of the PCB: Basically I'm using a molex micro fit junior ...
0
votes
0answers
17 views

How to implement “burst” functionality for bare-bones function generator

Some fancy function generators have a burst feature which gives precise control over on-time and periodicity of the desired waveform. Ex: For my application, I have a 25 MHz sin wave (2.5 Vpp) and, in ...
0
votes
0answers
13 views

pyupdi 1s timeout in readline

I just installed pyupdi and it works, but is very slow. I googled this and AVRfreaks says something about delay settings which seems irrelevant in my case (while ...
0
votes
0answers
62 views

CircuitPython & ESP32-S2-Saola boards returning code 43 errors

I am currently trying to connect to some ESP32-S2-Saola devboards that are running CircuitPython 6.1.0 via the USB OTG pins, but the device shows up as as "Unknown USB Device (Device Descriptor ...
0
votes
1answer
41 views

Run Ngspice in batch mode or with python

For circuit simulations I have mostly been using LTSpice, where the netlist is generated automatically with a python script I ...
0
votes
1answer
36 views

Recognizing the COM port used with STLINK

I'm using a STM Nucleo as a bridge to flash a BLE EM9304 module and another ST-LINK from another STM Nucleo to flash a STM32. Both MCU are in a third board. So, I'm integrating the sequence of ...
0
votes
0answers
24 views

Switching Circuit from Arduino to Raspberry Pi (Reading Analog Values)

I have wired up this circuit from learn.parallax I have wired this up to an Arduino and it works exactly how I want it too. This is the code that I used to get it working (also from parallax): ...
0
votes
0answers
61 views

Tracking location with GSM tower triangulation

I want to track location with GSM tower triangulation. I searched and I found this API for GSM positioning. ...
0
votes
0answers
71 views

Unable to read output of a joystick on a Raspberry Pi

I connected my joystick with this tutorial: link However, it does not work. The code runs fine (after changing print "---" to ...
0
votes
0answers
34 views

Segments not totally off when multiplexing 7 segments display with CD4051BE

I'm trying to make a display with several 7 segment displays so I decided to use multiplexing to make it work. I use CD4051BE to do that. The circuit is as follow: Circuit of the multiplexing The ...
0
votes
1answer
83 views

ESP32 WROOM switching back from MicroPython to Arduino framework

I have recently switched my ESP32's firmware to work with python (using Thonny IDE) and I want to switch back to work with C++ and Arduino IDE, but I remmember flashing that bin file on the device. Is ...
0
votes
0answers
89 views

NFC communication - CR95HF over 15693 and 14443-A

CR95HF datasheet: https://www.st.com/resource/en/datasheet/cr95hf.pdf Demo board: https://docs.rs-online.com/562c/0900766b811c6bc2.pdf C/C++ library and guide for demo board: https://www.st.com/...
0
votes
0answers
33 views

Are my charging equations being used correctly in my lithium ion battery Python simulation?

This is a continuation of a previous question I asked (Are my equations correct for a simple lithium ion battery model in Python?). My issue now is I do not believe I am using the charge equations ...
0
votes
0answers
521 views

Are my equations correct for a simple lithium ion battery model in Python?

I am trying to create a simple battery model in Python based on the RC circuit from, http://firsttimeprogrammer.blogspot.com/2015/07/electric-circuits-101-rc-and-rl-circuits.html. I have attached ...
0
votes
0answers
285 views

Precise sampling rate for data acquisition with Arduino and Python

I built a simple data logger with Arduino and Python (Accelerometer --SPI--> ESP32 --USBSerial--> RPi). I used the timer interrupt to control the output data rate, which is set to 300Hz. But I noticed ...
0
votes
0answers
43 views

Raspberry pi not getting any data from hx711

I'm trying to combine two boards into one: SparkFun Load Sensor Combinator(basically just a wheatstone bridge) and SparkFun Load Cell Amplifier. The data will be transmitted to a Raspberry Pi 3 so ...
0
votes
0answers
58 views

need help deciphering accel/gyro datasheet for i2c communication using python RPi

I have barely any knowledge in this area, the most I have done is used my RPi3 with pre-built python libraries for sensors such as ADS1115 so I didn't have to go through the process of understanding ...
0
votes
0answers
47 views

Implementation of complementary filter and output of sensor while stationary

The code for a complementary filtered angle is not outputting the expected angle. I can get close to 90° using arctan formula from the accelerometer sensor data. Whereas, the complementary filter ...
0
votes
0answers
61 views

Serial communication between raspberry and laptop not giving right values

I want to communicate between a Raspberry Pi 3 model B and a laptop using a USB to RS-232 cable and this RS-232 to 3.3V TTL converter via the serial module in Python: GND is connected to board pin #6 ...
0
votes
0answers
83 views

Converting the output of a Proportional Control System to a meaningful drive of a Peltier

Trying to create a PID controller for temperature control using a Peltier element, I decided to take it step by step and create first the Proportional and then the Integral and the Derivative ...
0
votes
1answer
537 views

Tektronix TBS 2000 oscilloscope to Python

I am a total beginner when it comes to communicating to your electronic devices using python. I installed PyVISA, Open Choice Talker Listner (Tektronix), a few other items. I was able to send basic ...
0
votes
0answers
76 views

Checking for signals above strength threshold over SDR on VHF

So I have a small NooElec Software Defined Radio and I've got it working well with my Raspberry Pi using GQRX as a controller and to visualize the SDR output. My goal though is to use a python script ...
0
votes
0answers
33 views

Calculating cell resistance in dependence from cell temperature from CAN bus logs

I'm part of a formula student team. When we go testing we are logging the CAN bus data the car produces to further understand what the car is doing. We log all the battery cell temperatures/voltages ...
0
votes
0answers
1k views

Most accurate, available way to control a stepper motor with python

I am doing a project where I am controlling a nema 17 stepper motor with a raspberry pi 3b. The raspberry pi is controlling the motor through a pyqt5 gui (python 3 is the language). I am using tb6600 ...
0
votes
1answer
206 views

Comunication Xbee S1 Coordinator to End Device

I am new in the Xbee world, I have 4 Xbee S1 802.15.4, that 3 are end device and one a coordinator. The end devices transmit good to coordinator.The coordinator is connect to Raspberry Pi via USB ...
0
votes
0answers
457 views

Internet access to LoPy (ESP32) using its GPIO pins

LoPy is a LoRa module which uses ESP32 chipset. It has WiFi and Bluetooth connectivity for Internet. In my setup, I have certain interference issues, so I can't use WiFi nor Bluetooth to connect my ...
0
votes
0answers
62 views

Embedding python interpreter in the TM4c1294XL

I have a python file that I want to run on the board. Hence I want to embed the python interpreter (written in C) in the board. I managed to write separate C project that runs the Python file. It ...
0
votes
1answer
182 views

PSOC 5 interfacing with PIR sensor

I am trying to interface the PSOC5 LP097 with PIR sensor to trigger the stepper motor for my Pet Feeder System. In addition, everytime the PIR sensor detects a movement, I try to send a mail using ...
-1
votes
1answer
33 views

Stepper motor position control

i currently try to control a stepper motor to position a camera, to keep my face in the middle of the frame. The face detection is working, and my python program(on raspberry pi 3) can determin the ...
-1
votes
1answer
490 views

How to talk with RTC hardware by Python?

I am using DT6 custom board from Variscite . This board is connect with DART MX6 board. DT6 in below link http://www.variscite.com/products/single-board-computers/dt6customboard I need to handle the ...
-1
votes
2answers
474 views

Using Python to control Brooks MFC Power Supply

Is it possible to use Python to control the Brooks 0152/0154 power supply that powers and controls Brooks MFC units? The manual mentions the pin outs of the RS-232 ...
-2
votes
1answer
797 views

How to connect LM35 Tempreture sensor to xbee

I suppose to calculate actual temperature of remote location using lm35 temperature sensor and xbee sensor. I am getting analog input from sensor, but I am unable to calculate temperature. complete ...
-2
votes
3answers
173 views

Need Help with Python Script - ' 4 Dollar Programmer'

I am working on an embedded project and have made my first PCB with a processor mounted on board. The trouble seems to be actually getting my code onto that processor! I was sort of banking on being ...