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.
221
questions
21
votes
6
answers
30k
views
LTspice automation
I have a battery-powered boost converter and I'm attempting to measure the maximum input (battery) voltage droop under various load conditions of high current draws (different duty-cycles/...
21
votes
1
answer
11k
views
ESP8266 eLUA (NodeMCU) vs MicroPython
I am searching for an unbiased, up-to-date comparison of the eLUA (NodeMCU) and MicroPython on ESP8266.
I can only find very superficial reports/blogs of users trying out one or the other. - All of ...
8
votes
2
answers
11k
views
Is there a spice directive to export waveform data in LTspice?
http://www.linear.com/solutions/1815
The above web-page explains how to export the waveform data to a text file. You basically run the LTspice simulation, clicking on the waveform window, go to ...
7
votes
4
answers
5k
views
Wheatstone bridge sensitivity and accuracy
From my earlier question I was able to wire up 2 SEN-10245 weight sensors (each forming one half of a wheatstone bridge) with an AD620 InAmp & 47 Ohm resistor (to set the gain to ~1000). I then ...
7
votes
0
answers
4k
views
Automate LT-SPICE? [duplicate]
I'm running a lot of simulations in LT-Spice, and I need someway to run them all either sequentially or at the same time.
I was going to use Python, but I'm not entirely clear on how I would get ...
6
votes
3
answers
2k
views
Why am I detecting two I2C addresses on the same board, and why do neither of them appear in the datasheet?
I have this MIKROE board wired up to an S2 Feather via the SDA and SCL pins. The MIKROE board is powered by the Feather via <...
5
votes
3
answers
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 ...
5
votes
1
answer
356
views
Interfacing an old spectrometer with PySerial
I asked this question on the Engineering StackExchange and someone said it might be more appropriate here.
I want to interface an old Shimadzu spectrophotometer (Model UV-1601, manual here) through ...
5
votes
1
answer
7k
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 ...
4
votes
1
answer
707
views
Am I using Shannon-Hartley Theorem and thermal noise correctly here?
I'm trying to learn about noise, sensitivity, and the Shannon-Hartley theorem, and I'm using some specs for a LoRa node IC to try it out.
The Shannon-Hartley theorem says that the maximum data rate \$...
4
votes
1
answer
477
views
FSK Modulation in Python
I am currently writing a script that uses I/Q data to do FSK modulation.
My question is about the FFT plot. I expected to have a peak at 1Hz and 2Hz which are the frequencies that represent binary 0 ...
4
votes
5
answers
19k
views
Python serial between Arduino and Raspberry Pi: Data is modified upon reception
I'm using an Arduino for sensor readings and sending them to a Raspberry Pi via USB, using PySerial for data reception.
It works great, except for the fact received data is awkwardly modified (And ...
3
votes
4
answers
2k
views
How to calculate resistance from points using linear regression?
I have a lists of current and voltage of one device and I would like to calculate the resistance. There are some errors with the ...
3
votes
2
answers
5k
views
Passing data from Python to Arduino over ethernet
I have an Arduino with Ethernet shield handshaking with my machine over Ethernet, and now I want to send data between them. My problem seems to be correctly parsing the different data types.
For ...
3
votes
1
answer
195
views
How does LTSpice solver know the type of the component?
I am doing automation of LTSpice using PyLTSpice library in Python.
I need to know the types of the components in the netlist or in the raw file.
How can I know programmatically that ...
3
votes
1
answer
659
views
Interacting with SPICE netlists using PySpice
I am trying to come up with a generic Python program that I can use to simulate different simple electronic circuits. The actual idea is to programmaticaly change parameters and do Montecarlo analyses....
3
votes
1
answer
143
views
JFET Id calculation mismatch in SPICE
I'm simulating the following circuit in PySpice:
simulate this circuit – Schematic created using CircuitLab
In this configuration, the N-JFET is always in saturation mode, as you can see by the ...
3
votes
1
answer
3k
views
Test automation framework/software for hardware applications
I am an Electrical engineer so my background on software testing is limited. My application is not a software testing issue. I need to develop a software package in python to interact with a RF ...
3
votes
1
answer
1k
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,...
3
votes
2
answers
245
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/...
3
votes
1
answer
13k
views
Digital Potentiometer (MCP4131) with Raspberry Pi
I'm very new in electronic stuff. I'm used to develop for desktop and mobile applications not for hardware products.
I try to wire up my Raspberry Pi board with an MCP4131 digital potentiometer. But ...
3
votes
1
answer
109
views
Time-varying capacitor generates higher than supply voltage? Capacitor power generators?
I was playing around with electret capacitors, supposedly time-varying capacitors with accordance with sound waves, trying to understand them deeply when I found that I need to model it mathematically,...
3
votes
2
answers
2k
views
Can't Get Raspberry Pi and Xbee to Work Together
I am having the hardest time trying to get my XBEE's to work with my Raspberry pi (RP). I have one on a USB breakout board into my computer and the other XBEE connected to a RP. The one on the RP is ...
2
votes
3
answers
793
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 ...
2
votes
2
answers
5k
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 ...
2
votes
3
answers
12k
views
How to hook Raspberry Pi with Electret Microphone to detect sound levels in dB?
I have to detect sounds levels in an enclosed area, so I thought this could be the right choice.
/*EDIT
I wish to collect sounds levels of about 30-60dB, normally human conversations or just ...
2
votes
1
answer
488
views
Bipolar stepper motor spins very slowly and makes a loud noise
I got a custom PCB. I am using DRV8428P driver (here is the datasheet) for a stepper motor. The problem I am facing is not being able to have the stepper rotate ...
2
votes
2
answers
1k
views
Using more than two I2C OLED displays on a Pico
I have a Raspberry Pi Pico running CircuitPython and I use the adafruit_ssd1306 library to drive SSD1306 OLED displays.
This works very well for two displays, but when adding the third it doesn't ...
2
votes
2
answers
4k
views
start a LTSpice simulation using code in MacOS
Help me please, I'm looking for the solution how to automate spice simulation with python on MacOS, currently, I'm thinking to use LTspice. However, I'm open to any proposal.
I want to make ...
2
votes
1
answer
405
views
Magic number in ADC Pi code
Im trying to measure temperature using PT100. Im using ADC Pi board for that. ADC Pi uses MCP3424(pdf datasheet) A/D converters, and in datasheet I found how to calculate voltage - it is pretty simple ...
2
votes
2
answers
58
views
Can MUXs or their channels be sperate busses?
I am doing a little project with some MUXs. PCB is currently being built; I'm waiting for it to be shipped out to me. I have multiple MUXs on my board (TCA9548As). They are connected to a master pair ...
2
votes
1
answer
245
views
voltage divider using skrf
I'm trying to use Python skrf's Circuit description and started with a voltage divider but I must be mis-using the library because my attempt does not give a realistic result. The circuit I try to ...
2
votes
1
answer
740
views
How to properly use i2c.writeto_then_readfrom() method
See also follow-up question about i2c addresses
I have this mikroe board wired up to an S2 Feather via the SDA and SCL pins. The ...
2
votes
2
answers
938
views
Analyzing sniffed data from pins of LCD 2*16 using Atmega32
I sniffed DB4..7 of an 2*16 LCD using the below circuit : (Atmega32.PORTA1..3 is connected to GND)
As you see above I connected En pin of LCD to INT0 of Atmega32 (That is configured for Falling Edge ...
2
votes
2
answers
3k
views
Solving electrical network in Python
I have a complicated electrical network. I would like to calculate voltage drop across across the network i.e. nodes 2-15, given V1=10 V and V16=0 V. The values of the resistances are known.
Is there ...
2
votes
2
answers
3k
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 ...
2
votes
2
answers
383
views
Undesirable dim light of LEDs on 7 segment display
I have a 7 segment display (common cathode) with 2 LEDs in each segment, powered by 12V, each segment controlled with a transistor (NPN) and Raspberry Pi 3.3V GPIO (and 4026 IC). What could be the ...
2
votes
2
answers
137
views
Calculating voltage of a circuit with changing current
I'm taking a class about batteries and circuits, and I'm trying a bunch of practice problems in Python. I'm having trouble solving for the voltage of a battery's circuit:
I am given that, with a ...
2
votes
1
answer
336
views
Scaling Waveform from LeCroy 4104HD using Python/IEEE488.2
I am automating control of a LeCroy oscilloscope using IEEE488.2 and Python/PyVisa.
It seems like it should be relatively straightforward. I use the WF? command to get the waveform + header, I use the ...
2
votes
1
answer
176
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 ...
2
votes
1
answer
366
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
...
2
votes
1
answer
251
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
2
answers
778
views
GPIO Input fluctuating between high and low when no input is received
I posted this on the Raspberry Pi StackExchange but I feel as though it might be better suited for here, as the SE is pretty inactive anyway.
I've got a fairly simple circuit that I've made where a ...
2
votes
1
answer
5k
views
Parsing .s2p data through an automation script to plot graphs of the various s-parameters
Need to find a way to quickly decipher and plot s-parameters for tons of .s2p files in a short period of time.
In specific, I need to plot the angle of the s-parameters versus frequency and then the ...
2
votes
2
answers
111
views
How to customize the 'write' to instrument?
I'm communicating with Power Supply RIGOL DP832A via Ethernet.
...
2
votes
1
answer
565
views
Communications issues between Ardupilot and Computer
The Issue and Project:
I have been at a standstill with my autopilot because I cannot communicate with it using my high powered transmitter: the Ubiquity Rocket M5. But the whole communications issue ...
2
votes
0
answers
66
views
Bugged Clarke Park transform on three-phase signal using Python
I'm supposed to apply a Clarke-Park transformation to an electrical signal so other people at my office can study the "quality" (?) of said signal.
I was given a Jupyter Notebook replicating ...
2
votes
2
answers
89
views
python vs matlab? [closed]
What is so special about MATLAB? Why in engineering (especially electrical engineering) hasn't pyhton replaced it?
I was watching a Youtube video regarding MATLAB:
https://www.youtube.com/watch?v=...
2
votes
0
answers
135
views
Logging data from High Precision AD/DA board using Raspberry Pi 3B
I have a High Precision AD/DA board from waveshare with Raspberry Pi 3B (running on Raspbian).
However, I can write only 27 samples in 1s in my CSV file. I am using this Python code for writing to a ...
2
votes
0
answers
129
views
Get alpha-beta plot of Clarke Transform in Python
For a project I'm working on, I want to use the Clarke Transform to detect faults in a power system. To do this, I already wrote a script in Python which returns the sine wave behavior of the Alpha, ...