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.

Filter by
Sorted by
Tagged with
-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
35 views

Problem while implementing a n-bit substractor circuit in python

I'm trying to implement the following substractor circuit in python: And below is my code for it: ...
0
votes
1answer
28 views

Logarithmic binning of smartphone sensor measurements

I' measuring linear acceleration (acceleration minus gravity) and gyroscope from Android smartphones on three axis (x,y,z). Becuase the distribution of the measurments is exponential, i.e. there are ...
0
votes
0answers
43 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 ...
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? ...
2
votes
1answer
30 views

Dotstar Light Strip Low Update Frequency

I've built the start of a persistence of vision display. The rotation platform itself is built and I have just mounted the LEDs. After doing some testing, I can only get very slow update speeds of the ...
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
1answer
41 views

How do I invoke pymcuprog?

I have successfully created an ATtiny406 binary using avr-gcc in Linux, and I can program it to the device via Atmel-ICE under Atmel Studio in Windows, and it ...
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
64 views

How to read an already existing NgSpice raw file

This has taken me a couple of days to solve. I have a set of NgSpice raw files that I would like to exploit so as to visualize the voltage distributions in ...
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
47 views

Measurement of delay between two signals using MSO4104 with PyVisa

I need to automate the measurement of delay between two signals using the oscilloscope. I am using MSO4104 from Tektronix. I programmed the oscilloscope for delay measurement, but I am not getting the ...
0
votes
1answer
44 views

3.3 V relay switches on/off/on - off fails 2nd switch off connected to Pi4

UPDATE Issue only happens when load is connected, triggers every time without load This 3.3 V .relay, link to the the >>> Datasheet As the title mentions, it works fine until I try to switch ...
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 ...
3
votes
1answer
146 views

HX711 with RaspberryPi and python

I have been working to create a digital scale for IOT project, using HX711 ADC. The problem Since it is crucial to have wifi connection, I use Raspberry Pi, to control the scale. Everything works well,...
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 ...
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 ...
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
1answer
92 views

Is there a way to set different sampling frequencies to channels in ADS1256?

In order to acquire 3 analog signals with a Raspberry Pi 4, I want to use Waveshare's ADS1256 AD expansion board (8 channels single-ended, 24 bit.) I was wondering if there's a way to set a different ...
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/...
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 ...
0
votes
1answer
61 views

problem in parsing LTspice data

I am using the ltspice python package to extract the data from the .raw file as seen in this link. However, when I try to apply it to my raw file I get the following error: ...
0
votes
1answer
135 views

Run Ltspice netlist using python

I would like to know please if there is a way I can run a LTspice simulation using only python. In other words, I need a python alternative to this command: subprocess.run(['scad3.exe','-b','netlist....
0
votes
1answer
33 views

Cause of delay in CAN

I am dealing with a differential drive robot that interacts with several motors and actuators, all through a powerful NVIDIA Jetson Xavier. The Jetson runs Ubuntu and I use Python3 for programming all ...
1
vote
2answers
66 views

How can I adequately recreate a signal with a biphase line code after band-pass filter in python?

I want to create a python model of a transmitter. The transmitter uses a biphase line code, which looks like this (from a datasheet): Additionally, the datasheet states that the signal is "...
0
votes
3answers
196 views

Digital filtering after analog to digital conversion (ADC)

I am making a PCB that receives a signal with a frequency band of 3-50 Hz and peaks of up to 10's of uV. I have implemented proper analog LP and HP (band-pass) filters and am using a 16-bit isolated ...
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
1answer
25 views

Is it possible to specify a script that should be executed as soon as synthesis starts in Synopsys Synplify?

The Synopsys Synplify Pro is used internally to carry out synthesis in Libero and probably other places. Is there a method to assign a tcl or python script to be executed just before or just after ...
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: ...
0
votes
1answer
92 views

Response time of RTS and DTS pins of the chip FT232RL (USB to Serial)

I'm controlling the values ("High" or "Low") of RTS and DTR pins in FT232RL using python package serial. My question is what's the maximum time between executing the command ser....
2
votes
3answers
233 views

How can I model an optical filter using python?

Say I have an RGB LED which transmit intensity modulated signals, at one symbol transmission I want to send a symbol with all three chips.. Can I just model three bandpass optical filters like RF ...
0
votes
1answer
167 views

Controlling a digital switch using Python through USB

I have an RF digital switch that takes two digital inputs (AB) in order to decide from which antenna port to take the input. Is their a simple way to use Python to send the AB values through the USB ...
2
votes
1answer
2k views

Using Python to simulate an LTspice netlist

I am new to Python, and I want to simulate LTspice circuits automatically using Python. I added the library ltspice and scripted a fair amount in order for Python to automatically generate an ...
0
votes
0answers
520 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 ...
2
votes
1answer
46 views

Compute electric field in complex 3D geometry

I have a CAD file with a pretty complex geometry. I would like to compute the electric field generated by this geometry when a specific charge density is defined. I guess I will have to go through ...
0
votes
2answers
207 views

20kg digital servo not working, probably because my frequency calculations are very wrong (raspberry pi)

summary I changed my servos for a more powerful one and cannot get it to work, I believe it is because I can't get the right duty cycle calculation in the code explanation I have a robotic arm that I ...
0
votes
1answer
274 views

How do I set up serial communication between two Holybro Telemetry Radios?

I have two USB Holybro 915 MHz Telemetry Radios. These are usually used with Mavlink for communication between drones and ground stations, but I would like to use them to send small amounts of data - ...
1
vote
1answer
157 views

How to find out the used code?

I have a data stream that looks like x\xdam\xdd]\xc4\xeemZ\xc7q)2\xcc\xd6cL\x1a1\x8c\xc9hc\x0c)\xeb^\xaf\xd7Z (...) How can I find out what I do see here? At the ...
1
vote
4answers
57 views

with a L298N controller I need to “warm up” the motor to get it to run without stopping, why and how to do it with python

I understand that this will be a very trivial question but I cannot find an explanation online, probably because in my ignorance I'm asking the wrong question, to support my explanation I'm leaving ...
1
vote
2answers
668 views

I fried my Raspberry Pi while using L298N but I don't understand why

Everything seems to indicate that I fried my raspberry pi: the green light wouldn't turn on, I changed the SD card for a new one but it still didn't work. That is a shame because I was having a lot ...
3
votes
2answers
115 views

Error correctly identifying Ls and Rs from measured Vin and Vo in LTSpice

As an exercise (using Python to process LTSpice exported data), I am trying to determine the values of Rs and Ls that were used in a circuit, from the the measurements of Vin, Vout, and the phase lead/...
0
votes
1answer
339 views

Which Raspberry Pi 3B+ GPIO pin is connected to which module in Adeept Motor Hat v2.0?

I need to find out which GPIO pin on the raspberry pi will be connected to which module when I fit the Adeept Motor Hat v2.0 on the 40 GPIO pins. I am attaching the image and the schematic of the ...
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 ...
1
vote
0answers
27 views

Finding the impedance of a distribution line from R,X,C values [closed]

I have real industry data of distribution feeder with line data consisting of r ,x and c values as shown in the attached figure. ...
-1
votes
2answers
379 views

Python to trigger USB square wave pulse for camera

I'm sorry if this was posted somewhere, but I'm trying to trigger a FLIR camera for acquisition using a USB port. I already purchased a USB split cable, and have queried the ports, so I know exactly ...
0
votes
3answers
609 views

How to free up memory in a CircuitPython board?

I'm using a Feather M0 Express from Adafruit with a DS3231 Precision RTC FeatherWing for a custom clock project that displays time with LEDs. The clock works as follows: When the clock gets plugged ...