Questions tagged [python]

Python questions about libraries, algorithms, syntax, or code optimization should be directed to stackoverflow.com .... 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.

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

Using Encoder data to map / visualize

I have a little robot, with two wheels and two encoders. I get the way and speed of each wheel in software. I am using the speed to calculate these equations: ...
0
votes
0answers
67 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
20 views

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

I have real industry data of distribution feeder with line data consisting of r ,x and c values as shown in the attached figure. ...
0
votes
2answers
118 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 ...
1
vote
0answers
14 views

Discrete Cosine Transform (DCT) Coefficient Distribution

I have two images : Original Image Binarized Image I have applied Discrete Cosine Transform to the two images by dividing the 256x256 image into 8x8 blocks. After, I want to compare their DCT ...
0
votes
1answer
55 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 ...
0
votes
0answers
27 views

M5Stick turns off randomly

I recently got an M5StickC, and I'm programming it using UIFlow. I wrote some code for it, and it works fine for about 45 minutes (not plugged in, not on Wifi), then it just turns off for no reason. I ...
1
vote
1answer
37 views

PCA9456A i2c switch channel 1 not showing up

I am using an PCA9456A i2c switch to help me toggle between i2c devices with the same address, but i am having problems opening channel 1 (second channel out of 4) and i ran out of ideas what is ...
0
votes
4answers
144 views

FFT of a square wave

I'm generating a square wave as PWM whose frequency is set to 25 Hz. On the oscilloscope, I've got: The data referred to the image above was stored and maniputed, then I plot it using jupyter ...
0
votes
0answers
21 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
28 views

How to use MLX90640 thermal camera code for a AMG8833 thermal camera?

So I want to use the AMG8833 sensor with my raspberry pi and some machine learning code, but the code was using the platypush package which is meant for the MLX90640 thermal camera. But after some ...
0
votes
1answer
108 views

Help with understanding the Memory Map of MLX90393

(Using a Raspberry Pi 3 Model B+ and python) I needed some assistance in understanding the memory map of MLX90393 I've attached the memory map here and you could also find it in the datasheet. I'm a ...
0
votes
1answer
60 views

ESC control with Raspberry Pi

I'm trying to control some ESC and brushless motors using a raspberry pi. I used the pigpio library to control them using servo pulses. But it seems that my motors wont increase rpm after a limit ...
0
votes
1answer
352 views

VISA: (Hex 0xBFFF0015) Timeout expired before operation completed

I'm writing a simple code in Python to remotely send commands from PC to RSHameg HM8134-3, using USB. I'm using visa to do so. Something to note, when I write to it, it doesn't give me any errors(...
0
votes
0answers
47 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

Electret MIC MAX4466 with ADC ADS1015 in python with rasberrypi 3

I have been trying to read the values from this mic https://www.adafruit.com/product/1063 with the this ADC https://www.adafruit.com/product/1083 in python. I am confused about the readings, because ...
1
vote
2answers
147 views

Writing commands to a microcontroller with a STM32f chip from python

Manual to the micro controller: https://drive.google.com/file/d/0B8PmY6nhQadKSVc5OE04c3ZJaFU/view?usp=sharing , where page 18-19 introduces the serial communication protocol. The micro controller on ...
1
vote
1answer
81 views

Lighting up LEDS via I2C Bus of a NeoTrellis 4x4 RGB Led Matrix

Many attempts to write to an i2c slave to make rgb leds light up have failed. The hardware in question is found at: https://learn.adafruit.com/adafruit-neotrellis There is an arduino library and a ...
0
votes
0answers
39 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
1answer
98 views

What's a better way to integrate an ODE for one time-step than the Euler method?

I'm simulating a simple cart-pendulum system for purposes of testing different control strategies and data-driven approaches. I need to simulate the dynamical system one time-step at a time. I'm ...
0
votes
0answers
22 views

Is the xyGyroAngle and the cfangle output correct?

...
0
votes
2answers
45 views

Voltage drop after writing to slave register with I2C protocol

I'm trying to control this bipolar stepper motor with an Adafruit Huzzah32 (ESP32) board and a stepper driver shield. Power sources: ESP32: 5V USB port Shield: 4 AA-batteries in series I ...
2
votes
0answers
346 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 ...
0
votes
0answers
57 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 ...
1
vote
1answer
113 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: ...
0
votes
2answers
401 views

AttributeError: 'NoneType' object has no attribute 'send' pigpiod

So I create an another program that can run stepper motor clockwise and counter clockwise with a ramp up and ramp down in there and adding limiter switch on GPIO 16 and 26 to stop the ...
0
votes
0answers
57 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
2answers
235 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
1answer
43 views

Getting valid input from Ultrasonic range finder

(I am posting this question here since I feel that the issue is a part of my lacking understanding of the electronics, and not a ) I am trying to monitor the feed hopper for my pellet furnace. I had ...
0
votes
2answers
273 views

Increase the ramp up stepper motor performance

I'm driving a NEMA34 bipolar stepper motor with the following specifications: Holding torque 5.9 Nm Step angle 1.8° Resistance / phase 0.33±10% Ω Inductance / phase 3.00±20% mH Max load axial 65 N ...
1
vote
1answer
379 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
55 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 ...
-1
votes
3answers
162 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 ...
1
vote
0answers
231 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 ...
0
votes
0answers
31 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
3answers
145 views

using an ADC under Linux for automated current monitoring setup

I'm a slightly overchallenged undergrad ee student. I'm working on a project where I'm supposed to build an automated setup to measure hard disk currents over time. I want to use a Current Shunt ...
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 ...
1
vote
1answer
148 views

Device for toggling power to another device via raspberry pi GPIO?

So I have a PTZ camera and a siren. What I'm trying to do is trigger the siren when the camera detects motion. The camera hooks up via PoE, but the siren just has a 12 volt connection, so it has to ...
0
votes
1answer
2k views

Data acquisition with Python on a Beaglebone Black - Increasing sample speed

This is my first foray into programming and using a BeagleBone Black. I have some limited experience in Python, and have used this within the provided Cloud9 IDE in order to capture data and write ...
1
vote
1answer
156 views

Current flow between 2 circuits without common ground

I made a clock circuit with a 555 timer ic, then I measured the wavelength of the square wave generated using my Raspberry Pi. At first I connected the ground of the RPi to the ground of the circuit. ...
1
vote
0answers
208 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
215 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 ...
0
votes
1answer
164 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
442 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
1answer
199 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? Full problem description: I want to be able to simulate simple (idealized) RF circuits, such as ...
0
votes
0answers
154 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 ...
1
vote
2answers
1k views

Serial communication between embedded system and PC with only USB ports available.

I am working on an application where I have part of an embedded linux system transferring some data to a PC utilizing PySerial (a Python module). My question is: is there an alternative to finding a ...
1
vote
1answer
63 views

Issue reading pressure transducers and getting floating value

So I'm trying to read a Honeywell pressure transducer off an Arduino Mega and I'm just getting floating values. I've tried ground the line straight to the Gnd and then I get a consistent 0 but ...
4
votes
3answers
2k 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 ...
0
votes
1answer
122 views

Logic Behind MQx Sensors Calculation - Raspberry Pi

Would you please explain the logic behind this snippet of code which is taken from here for calibrating MQx Sensor(s): ...