Go to advanced search

by ghp
Thu Sep 17, 2020 1:12 pm
Forum: Automation, sensing and robotics
Topic: Reading charging time of RC circuit
Replies: 2
Views: 66

Re: Reading charging time of RC circuit

Usual capacitors have a precision of +-20% or even worse. The voltage low-->high on a GPIO is not fixed, but somewhere between 0.8 to 2V. Fortunately a usual resistor R nowadays has 1% accuracy, hope you got one of these. The time measured is quite accurate. Think you will measure times above 3 sec ...
by ghp
Mon Sep 14, 2020 12:28 pm
Forum: Python
Topic: Python editor for Win10
Replies: 4
Views: 279

Re: Python editor for Win10

As B.Goode pointed out "The job of a text editor is to edit text." If you want to edit python code on win10, then I would recommend eclipse with pydev or pycharm. Then transfer the code to pi and run it there. If you build a network share on pi, the editor on win10 could access the files directly on...
by ghp
Sat Sep 12, 2020 5:59 am
Forum: Automation, sensing and robotics
Topic: Query on using 1 PWM to control 4 MOSFETS
Replies: 3
Views: 138

Re: Query on using 1 PWM to control 4 MOSFETS

I took a look to the datasheet of IRF520. The mosfet seems to switch on around 4V (see 'Transfer Characteristics' ). https://www.mouser.de/datasheet/2/389/stmicroelectronics_cd00000698-1204495.pdf Compare this to a IRLB8721PbF, which starts to switch on at prox 2.5V https://cdn-shop.adafruit.com/dat...
by ghp
Sat Sep 12, 2020 5:34 am
Forum: Python
Topic: How to handle a simple task in Python, that...
Replies: 5
Views: 404

Re: How to handle a simple task in Python, that...

There is a nice page about bytes, among many others. https://www.devdungeon.com/content/working-binary-data-python#bytes # produce a bytearray to play with. # create an empty bytearray of length 2. r = bytearray(2) # assign values to the fields r[0] = 1 r[1] = 2 # just to see what is around in the a...
by ghp
Fri Sep 11, 2020 8:56 pm
Forum: Automation, sensing and robotics
Topic: Send data from ESP32 to Raspberry PI
Replies: 33
Views: 1305

Re: Send data from ESP32 to Raspberry PI

Capture.PNG A sample of a NODE-RED application. The mqtt node receives a json '{ "status": "on", "period" : "1000" }' (which I use here to switch a blinking LED in an ESP32 application). The json node converts json to javascript object. The function node uses javascript: "msg.payload = msg.payload....
by ghp
Tue Sep 08, 2020 5:42 pm
Forum: Python
Topic: Pip doesn't work
Replies: 6
Views: 292

Re: Pip doesn't work

There is a discussion of (similiar, same ?) problem in
https://github.com/pypa/pip/issues/5429
by ghp
Tue Sep 08, 2020 5:27 pm
Forum: Python
Topic: Python script slows over time.
Replies: 2
Views: 132

Re: Python script slows over time.

Possibly a reason is that your code creates new elements for the Drawing in each call to midiloop. Example: REVERB = drawing.oval(20, 20, 45, 45, color="black") The underlying tk element is a tk.Canvas, which accumulates all these elements and consumes more and more memory. Analysis: run 'top' in a ...
by ghp
Mon Sep 07, 2020 4:37 am
Forum: Python
Topic: Send Scheduled Email Every 4 weeks.
Replies: 2
Views: 122

Re: Send Scheduled Email Every 4 weeks.

Perhaps apscheduler could solve this problem. https://apscheduler.readthedocs.io/en/stable/userguide.html Taken from the api description, here a slightly modified sample: from datetime import datetime from apscheduler.schedulers.blocking import BlockingScheduler def job_function(): print("Hello Worl...
by ghp
Sun Sep 06, 2020 6:59 am
Forum: Python
Topic: AWS Detect text in image
Replies: 1
Views: 120

Re: AWS Detect text in image

If you add code, please use code-tags as described in https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=84477 You replace the bucket and photo in def main(): bucket='your_bucket' photo='your_photo' text_count=detect_text(photo,bucket) print("Text detected: " + str(text_count)) There are other ...
by ghp
Sat Sep 05, 2020 6:32 pm
Forum: Automation, sensing and robotics
Topic: Automation of a metal pretreatment line
Replies: 6
Views: 294

Re: Automation of a metal pretreatment line

For the PLC part, there are solutions available like https://www.unipi.technology. Programming is usually done in IEC 61131-3 languages. pcmanbob already pointed out valid points to consider. Electrical safety, chemical resistant cables, waterproof housing of the electronics and power switches, powe...
by ghp
Sat Sep 05, 2020 5:07 am
Forum: Python
Topic: LED Bar Graph (tkinter Display on Screen)
Replies: 12
Views: 412

Re: LED Bar Graph (tkinter Display on Screen)

Does the modified program I provided still show the behavior "The onscreen tkinter simulation still waits until ... the LED Hardware... have completed before displaying" ?
by ghp
Fri Sep 04, 2020 8:31 pm
Forum: Python
Topic: LED Bar Graph (tkinter Display on Screen)
Replies: 12
Views: 412

Re: LED Bar Graph (tkinter Display on Screen)

# 28th August 2020 # Python 3 program from tkinter import * import RPi.GPIO as GPIO from datetime import * from time import * LEDblue = 5 LEDgreen4 = 6 LEDgreen3 = 13 LEDgreen2 = 19 LEDgreen1 = 26 LEDyellow3 = 21 LEDyellow2 = 20 LEDyellow1 = 16 LEDred2 = 12 LEDred1 = 7 GPIO.setwarnings(False) GPIO....
by ghp
Fri Sep 04, 2020 8:50 am
Forum: Automation, sensing and robotics
Topic: Motor Driver Board should stop motor when torque > limit
Replies: 4
Views: 243

Re: Motor Driver Board should stop motor when torque > limit

There are various methods to protect - putting end switches at the stop-points (already mentioned by ElEscalador) - place an encoder disc (magnetic) on the drive shaft and use a hall sensor like US5881LUA which has open drain output, simple to interface with GPIO. You could detect the 'it does not t...
by ghp
Thu Sep 03, 2020 7:08 am
Forum: Python
Topic: Email logfile from previous week, delete after email, repeat
Replies: 7
Views: 187

Re: Email logfile from previous week, delete after email, repeat

You could solve your problem with a scheduler. What I understood from your requirements is: you have three task - one for the minute: acquire sensor data, send by email. - the day create/append to log, - and one for the monday: send log, delete log. # sudo pip3 install apscheduler import apscheduler...
by ghp
Wed Sep 02, 2020 5:14 pm
Forum: Automation, sensing and robotics
Topic: Using Stepper Motors
Replies: 7
Views: 302

Re: Using Stepper Motors

does powering but not moving motor use significant power? Yes. A stepper motor provides "Holding torque" only when powered. When not powered, of course the power consumption is zero, but it may move when 'external torque' is applied. Depends on your driver board if it has the possibility to control...
by ghp
Tue Sep 01, 2020 8:54 am
Forum: Python
Topic: Email script sending DS18B20 device ID, not the device reading
Replies: 3
Views: 97

Re: Email script sending DS18B20 device ID, not the device reading

Use "read_temp ()" instead of "read_temp ".
The first calls the method and provides a return value.
The second 'is the method' and prints details about it.
by ghp
Tue Sep 01, 2020 6:17 am
Forum: Automation, sensing and robotics
Topic: Send data from ESP32 to Raspberry PI
Replies: 33
Views: 1305

Re: Send data from ESP32 to Raspberry PI

# # ESP code (not tested with micropython). You could just leave the # separate topic for temp, humidity, pressure and add a new topic for 'data'. # import json # json structure to achieve: # { "humidity": 45.2, "temp": 22.3, "pressure": 4711.2 } # What I understand from the code, the read_bme_sens...
by ghp
Mon Aug 31, 2020 11:40 am
Forum: Python
Topic: open the garage true my mobile phone
Replies: 1
Views: 137

Re: open the garage true my mobile phone

Google is your friend and searching for "open garage door with raspberry pi web page" give some 1.8 million results with all flavors of technology.
by ghp
Sat Aug 29, 2020 10:56 am
Forum: Automation, sensing and robotics
Topic: Fooling CT clamp sensor for a solar power diversion unit
Replies: 2
Views: 187

Re: Fooling CT clamp sensor for a solar power diversion unit

The company producing this device offers a similar 'wireless' product. This could solve the sensor wire length problem. Or ask your installer to mount the device close to the 'henley block' and extend the 'dedicated immersion circuit'. Assuming this CT clamp sensor is a 'standard' device then it pro...
by ghp
Fri Aug 28, 2020 3:43 pm
Forum: Python
Topic: HX711 not setting reading format
Replies: 4
Views: 137

Re: HX711 not setting reading format

Depends from where you got the hx711-library. In the https://github.com/tatobari/hx711py repo, the method is available. In the https://pypi.org/project/hx711/ repo, there is no method 'set_reading_format'-method. When you found a code snippet in the net, then perhaps there is a description on how to...
by ghp
Tue Aug 25, 2020 8:05 pm
Forum: Automation, sensing and robotics
Topic: Send data from ESP32 to Raspberry PI
Replies: 33
Views: 1305

Re: Send data from ESP32 to Raspberry PI

Message design: Sending each value in a separate message makes it difficult to assemble them in one row of the database. I would propose to pack the data together in one json structure on the ESP32 "{ "humidity": 45.2, "temp": 22.3, "pressure": 4711.2 }" into one topic. Unpack in client and add to d...
by ghp
Tue Aug 25, 2020 5:46 am
Forum: Automation, sensing and robotics
Topic: Send data from ESP32 to Raspberry PI
Replies: 33
Views: 1305

Re: Send data from ESP32 to Raspberry PI

For system logging see https://docs.python.org/3.8/library/syslog.html See also the logging package of python, there is a logging handler for syslog. https://docs.python.org/3.8/library/logging.handlers.html#module-logging.handlers Or use a rolling file log handler. Many options available. And the l...
by ghp
Tue Aug 25, 2020 5:24 am
Forum: Python
Topic: Rpi Zero W with Arduino Pro Mini Serial Communication
Replies: 1
Views: 74

Re: Rpi Zero W with Arduino Pro Mini Serial Communication

A possible reason is that the arduino is not sending data at all, baudrate is wrong, arduino not sending '\n', serial port not correct on raspberry. - Does your arduino code indicate somehow if the 'S' arrives ? A short pulse on a LED is very helpful. - Did you check the arduino program with arduino...
by ghp
Mon Aug 24, 2020 7:23 pm
Forum: Automation, sensing and robotics
Topic: Send data from ESP32 to Raspberry PI
Replies: 33
Views: 1305

Re: Send data from ESP32 to Raspberry PI

To check the size of database file(s) is not a good idea. There are transaction files which increase/ decrease when queries or inserts happen, compression of files, paging, all sort of optimizations, vacuum operations. To monitor insertions, write a program which in regular intervals queries the fil...
by ghp
Mon Aug 24, 2020 5:36 pm
Forum: Python
Topic: Photobooth
Replies: 2
Views: 347

Re: Photobooth

Found something pointing to logo size in scripts/constants.py EFFECTS_PARAMETERS = { "None": { 'snap_size' : v2_full_size, #(width, height) => preferably use integer division of camera resolution ' logo_size ' : 128, # height in pixels of the logo (will be thumbnailed to this size) ' logo_padding ' ...

Go to advanced search