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
5
votes
3answers
3k views

ESP8266-12E MicroPython Unable to access REPL (Python prompt)

I am trying to install MIcroPython Firmware on my ESP8266-12E chip. I am using esptool.py to flash the firmware. I have successfully uploaded the firmware ...
1
vote
0answers
39 views

Run *.net files with python sequentially

I work for a project in which we use Pspice and *.net files.In my code I use a button which is selecting *.net files and it returns back their paths in the Entry.The following code doesn't work for ...
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 ...
0
votes
3answers
569 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 ...
1
vote
1answer
181 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
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
29 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
16 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
1answer
49 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
0answers
12 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
35 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
1answer
228 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 - ...
0
votes
0answers
51 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
181 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 ...
0
votes
1answer
38 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
45 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
34 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
1answer
204 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 ...
3
votes
1answer
77 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
60 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
70 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
52 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
73 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
87 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
82 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
90 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
124 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....
1
vote
2answers
65 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
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 ...
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 ...
0
votes
3answers
344 views

Monte Carlo Simulation In Python instead of HSPICE

Suppose I have a resistor and I want to simulate process variation on it. When I was reading online, I noticed that Monte Carlo simulation is used for this purpose. I also noticed that HSPICE has ...
0
votes
3answers
152 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
32 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
3k views

Difficulty in reading values Modbus application in Python(Pyserial) On Energy meter (EM6400)

I am trying to read energy meter(EM6400) voltage values in python by using modbus protocol. But there are issues when I am reading values. I think the issue is with,...
0
votes
1answer
987 views

Connecting Raspberry Pi to Arduino Leonardo

Can any Raspberry Pi/Arduino experts tell me what are the best options of sending data from the RPi to a Leonardo given the following: Running Raspbian on the RPi. Running a Python script on the RPi ...
0
votes
1answer
86 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
0answers
40 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
2answers
334 views

Simple Impedance/Admittance based Transmission/Reflection Simulation

TL;DR: Why does the (pseudo-)code below produce a different output than a proper simulation software? Edit: -> Answer: The program (RFSim99) displays only abs, not squared (which is what I plotted). ...
2
votes
3answers
223 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
157 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
444 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 ...
2
votes
2answers
4k views

Laplace transform on simple low pass filter in Python

Looking at the first picture in the link, showing a simple graph of an with- and without bypass filter circuit voltage difference. I wanted to recreate this chart: I have coded the noise and ...
0
votes
2answers
201 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 ...
1
vote
1answer
155 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 ...