Go to advanced search

by ghp
Mon Aug 02, 2021 8:24 pm
Forum: Other projects
Topic: Simplest Way to Protect RPi Against EMF Caused by Electromagnet
Replies: 12
Views: 451

Re: Simplest Way to Protect RPi Against EMF Caused by Electromagnet

Consider to use a logic level mosfet like the IRLZ44. A 9V battery is for sure a 'safe' option as it has no mains connection... From the net: "A standard 9V battery has about 400-600 mAh capacity. In the most basic terms, these batteries can supply about 500 milliamps for one hour before being ...
by ghp
Sun Aug 01, 2021 7:55 pm
Forum: Python
Topic: Before I build, scoreboard questions.
Replies: 8
Views: 305

Re: Before I build, scoreboard questions.

Still might look for a way to play a sound file
There is I2S sound output possible on the pico by using PIO. I used an Adafruit breakout MAX98357A; I2S sample code is in https://github.com/raspberrypi/pico-ext ... _audio_i2s
by ghp
Fri Jul 30, 2021 5:01 am
Forum: Other projects
Topic: Simplest Way to Protect RPi Against EMF Caused by Electromagnet
Replies: 12
Views: 451

Re: Simplest Way to Protect RPi Against EMF Caused by Electromagnet

If R=0.014 and U=5V, current is 357 A which is very very high, And far beyond what a RPi power supply can deliver, Think your calculation is not perfect, 1000 turns around a 5mm screw need 1000 * 0,016 m minimum. To drive a solenoid, use a separate power supply, a transistor switch and a 1N4007 flyb...
by ghp
Thu Jul 29, 2021 8:56 pm
Forum: Automation, sensing and robotics
Topic: (Beginner) servo motor arm and toggle switch
Replies: 2
Views: 148

Re: (Beginner) servo motor arm and toggle switch

Those servo have limited torque. See https://en.wikipedia.org/wiki/Torque If you increase the length of the arm, the force available decreases. If you do not want to exchange the servo with a more powerful one, then decrease the length of the arm. Here a quick sketch how you could achieve this 20210...
by ghp
Tue Jul 27, 2021 6:12 pm
Forum: Python
Topic: Recursive Triangle Python Project
Replies: 13
Views: 448

Re: Recursive Triangle Python Project

Code efficiency: "Finally, the golden rule of optimization: don't optimize unless you know you need to, and measure rather than guessing. You can measure different methods using the timeit module. That can tell you which is fastest, instead of random strangers on the internet making guesses.&qu...
by ghp
Tue Jul 20, 2021 3:41 am
Forum: Python
Topic: python error
Replies: 6
Views: 444

Re: python error

ConnectionRefusedError: [Errno 111] Connection refused

Possibly there is no application running on the server HOST which accepts connections on port PORT.
by ghp
Fri Jul 16, 2021 5:49 pm
Forum: Automation, sensing and robotics
Topic: Need Help: Simple Home Power Status Detector
Replies: 13
Views: 647

Re: Need Help: Simple Home Power Status Detector

Be careful and never use mains voltage directly. As stated already, many UPS can monitor power. If you want to learn on this subject, use a AC/AC power supply, e.g. http://catalog.triadmagnetics.com/Asset/WAU060-2000.pdf ac_measurement.png The 6V AC on output is still above the range most ADC can ha...
by ghp
Wed Jul 14, 2021 8:12 pm
Forum: Automation, sensing and robotics
Topic: How to connect PC water coolant sensor to a Raspberry Pi
Replies: 31
Views: 1157

Re: How to connect PC water coolant sensor to a Raspberry Pi

Perhaps better if you look for ready to use hardware and software. Example are https://www.microedgeinstruments.com/lpth-01.php, but there are many more.
by ghp
Wed Jul 14, 2021 5:49 am
Forum: Automation, sensing and robotics
Topic: How to connect PC water coolant sensor to a Raspberry Pi
Replies: 31
Views: 1157

Re: How to connect PC water coolant sensor to a Raspberry Pi

For the NTC solution: This ADC board is not a bad choice ADC https://thepihut.com/collections/raspbe ... spberry-pi - schema available - there is a separate 3.3V regulator on board, so a stable, low noise ref voltage is available. You need to buy a 1206 resistor 10k for each of your NTC and solder i...
by ghp
Tue Jul 13, 2021 8:51 pm
Forum: Automation, sensing and robotics
Topic: How to connect PC water coolant sensor to a Raspberry Pi
Replies: 31
Views: 1157

Re: How to connect PC water coolant sensor to a Raspberry Pi

According to the datasheet the sensor is a NTC-Thermistor. You can not connect it directly to a GPIO pin. Use a fixed 1% resistor (possibly 10k) in series and use an ADC to measure the voltage at junction point. To get precise measurements, a precision voltage regulator for the voltage divider and f...
by ghp
Tue Jul 13, 2021 5:14 pm
Forum: Python
Topic: PWM fan control for intel
Replies: 1
Views: 194

Re: PWM fan control for intel

There are spec on the net for the pwm signal, e.g. https://wiki.kobol.io/helios4/files/fan/4_Wire_PWM_Spec.pdf 2.3.1 PWM Output Signal The Hardware Monitor Devise is required to provide an open-drain or open-collector type output for the PWM signal on pin 4 (see Table 1 and Figure 8) with the follow...
by ghp
Mon Jul 12, 2021 6:56 pm
Forum: Automation, sensing and robotics
Topic: Pi Drip Irrigation System
Replies: 3
Views: 319

Re: Pi Drip Irrigation System

I have a 10000 mAh battery with UPS I plan on using. I'm no electrical engineer, so first thing, is this enough power storage? There are power consumption numbers here: https://www.raspberrypi.org/documentation/hardware/raspberrypi/power/README.md You are not specifying what you want to do with the...
by ghp
Sun Jul 11, 2021 6:05 pm
Forum: Other projects
Topic: How do you connect multiple devices to i2C on GPIO pins
Replies: 2
Views: 249

Re: How do you connect multiple devices to i2C on GPIO pins

You can connect multiple sensor/devices to I2C 'in parallel'. Restriction are that the bus address is different and of course all connected devices use same bus voltage of 3.3V.
Read more in https://en.wikipedia.org/wiki/I%C2%B2C
by ghp
Sun Jul 11, 2021 6:32 am
Forum: Python
Topic: Need a little help with my code (keyboard input listener and loops - almost got it).
Replies: 5
Views: 317

Re: Need a little help with my code (keyboard input listener and loops - almost got it).

In the launcher
- you should use 'python3' instead of python(2). Python2 is obsolete.
- add "export DISPLAY=:0" before starting the python app.

Or start your application with "desktop auto start". viewtopic.php?t=294014
by ghp
Sat Jul 10, 2021 10:34 am
Forum: Python
Topic: change from python 2 to python 3
Replies: 4
Views: 347

Re: change from python 2 to python 3

Simple solution: instead using the command python yourprogram.py use python3 yourprogram.py When installing additional packages, use pip3 install package_you_need Complex solution: change symbolic link which is usually python -> python2 to look like python -> python3. See https://www.raspberrypi.org...
by ghp
Sat Jul 10, 2021 10:26 am
Forum: Python
Topic: Need a little help with my code (keyboard input listener and loops - almost got it).
Replies: 5
Views: 317

Re: Need a little help with my code (keyboard input listener and loops - almost got it).

Let me propose an object oriented approach: ScreenAction, responsible for the screen switching (did not find the action when IDLE and then go back to ACTIVE) StateHandler is responsible to sort all keypress- and timeout-events. Instead of counting loop count, there is a Timer used. #!/usr/bin/env py...
by ghp
Wed Jul 07, 2021 1:24 pm
Forum: Other projects
Topic: Making: How to fill the gap
Replies: 3
Views: 272

Re: Making: How to fill the gap

I use kicad with freerouter. My notes on 'how to use' are: To get freerouting, install https://layouteditor.com/download Kical, pcb-tool: export spectra dsn start freerouter.pcb, read dsn Autoroute in freerouter, export ses session in kicad, pcb.tool, import session ... and then modify placement of ...
by ghp
Tue Jul 06, 2021 8:33 am
Forum: Automation, sensing and robotics
Topic: Motion sensor and CEC-Client
Replies: 2
Views: 227

Re: Motion sensor and CEC-Client

Please use 'code tag' when posting python code. See https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=84477 You already have the commands which work on the console, e.g. echo 'on 0.0.0.0' | cec-client -s -d 1 You can use this command in subprocess.run like subprocess.run( "echo 'on 0....
by ghp
Tue Jul 06, 2021 8:28 am
Forum: Automation, sensing and robotics
Topic: Help selecting P-channel MOSFET to be driven by Pi Zero
Replies: 6
Views: 333

Re: Help selecting P-channel MOSFET to be driven by Pi Zero

Looks good. See diagram datasheet "Fig. 6. Output characteristics: drain current as a function of drain-source voltage; typical value": for Vgs = -4.5 V (what you achieve in your setup) and Vds < -4V the transistor is 'fully on' and can handle high current. With more than enough margin.
by ghp
Tue Jul 06, 2021 7:34 am
Forum: Automation, sensing and robotics
Topic: Help selecting P-channel MOSFET to be driven by Pi Zero
Replies: 6
Views: 333

Re: Help selecting P-channel MOSFET to be driven by Pi Zero

A high side driver can be build like this: high_side_drive.png Pin numbers are random. The two resistor ensure that there is no current when GPIO is 'input' direction. This schema is suitable for low frequency switching. For high frequency switching gate driving current needs to be handled. Use mosf...
by ghp
Mon Jun 28, 2021 6:10 pm
Forum: Automation, sensing and robotics
Topic: Using resistors with ADS1115 to measure 12v battery
Replies: 8
Views: 536

Re: Using resistors with ADS1115 to measure 12v battery

You can switch on/off the voltage divider with a high side switch. Example: see https://www.vishay.com/docs/70611/70611.pdf, Figure 3 When Pi is off the voltage divider will not consume current from the battery. Of course you need a GPIO pin to control this. For a protective diode use a schottky e.g...
by ghp
Mon Jun 28, 2021 12:04 pm
Forum: Automation, sensing and robotics
Topic: Using resistors with ADS1115 to measure 12v battery
Replies: 8
Views: 536

Re: Using resistors with ADS1115 to measure 12v battery

When the ADS1115 is connected to the PI, you most probably power the ADC with 3.3V. Then the max allowed input voltage for the ADC input is 3.3V. So you need to bring down the 12V to 3.3V max. Better to have a slight margin for resistor value tolerances. voltage_divider.png Most batteries have a hig...
by ghp
Sat Jun 26, 2021 2:37 pm
Forum: Automation, sensing and robotics
Topic: MQTT data logger crash
Replies: 5
Views: 360

Re: MQTT data logger crash

There is a potential flaw in the code, here the scenario: - you receive one message for each topic "esp/bme280_01", "esp/tsl2561_01", "esp/scd30_02". - wait a while (30 sec at least), then receive a topic "esp/bme280_01" - database connection is opened, the &q...

Go to advanced search