Go to advanced search

by joan
Sun Jun 23, 2019 7:22 pm
Forum: Beginners
Topic: 4 AA Battery pack for Servo
Replies: 11
Views: 252

Re: 4 AA Battery pack for Servo

The obvious interpretation is the battery pack is flat and can not supply enough current. A clear photo of the connections may help.
by joan
Sat Jun 22, 2019 10:10 pm
Forum: Automation, sensing and robotics
Topic: Pulse output water meter (using pigpio?)
Replies: 9
Views: 866

Re: Pulse output water meter (using pigpio?)

Perhaps it is mechanical as well and their pulse counter also filters out the transients. I doubt your configuration could cause this problem.

You can set the filter from Python.

http://abyz.me.uk/rpi/pigpio/python.htm ... tch_filter
by joan
Sat Jun 22, 2019 8:26 pm
Forum: Automation, sensing and robotics
Topic: Pulse output water meter (using pigpio?)
Replies: 9
Views: 866

Re: Pulse output water meter (using pigpio?)

The need for a pull (up or down) is dependent on the electronics built in to your pulse meter. The hobby ones I have used have so called open collector outputs. This means the output data line is connected to ground during each pulse and otherwise floats. You need to make sure it floats to something...
by joan
Sat Jun 22, 2019 4:29 pm
Forum: C/C++
Topic: What is the correct way to use /dev/gpiomem with mmap to get access to Raspberry PI3 peripherals
Replies: 11
Views: 478

Re: What is the correct way to use /dev/gpiomem with mmap to get access to Raspberry PI3 peripherals

Not really. mmap expects you to be using the /dev/mem device where offsets mean something.

The /dev/gpiomem device (as written) ignores any offset and always grants access to the GPIO register area.
by joan
Sat Jun 22, 2019 2:08 pm
Forum: Weather station
Topic: measuring wind speed using hall effect
Replies: 9
Views: 1529

Re: measuring wind speed using hall effect

I changed domains from abyz.co.uk to abyz.me.uk.
by joan
Sat Jun 22, 2019 6:45 am
Forum: Automation, sensing and robotics
Topic: Pulse output water meter (using pigpio?)
Replies: 9
Views: 866

Re: Pulse output water meter (using pigpio?)

If you are usung a button rather than an actual water meter you are likely suffering from mechanical contact bounce.

As an experiment enter the following from the command line to filter the bounce.

pigs fg 27 5000 # filter out all bounce less than 5000 µs

pigs fg 27 0 # cancel filter when done
by joan
Fri Jun 21, 2019 10:22 pm
Forum: Automation, sensing and robotics
Topic: Pulse output water meter (using pigpio?)
Replies: 9
Views: 866

Re: Pulse output water meter (using pigpio?)

As OutoftheBOTS says - any GPIO library/module will handle what you want. Here is a simple pigpio script which prints the reading every 6 second. #!/usr/bin/env python import time import pigpio GPIO=27 pi = pigpio.pi() if not pi.connected: exit() cb = pi.callback(GPIO) prev = 0 while True: now = cb....
by joan
Fri Jun 21, 2019 5:21 pm
Forum: C/C++
Topic: WiringPi / Raw SPI speed issue
Replies: 8
Views: 345

Re: WiringPi / Raw SPI speed issue

The Linux SPI driver buffer size is mainly irrelevant to your problem which is caused by the SPI driver transaction overhead. For the sake of argument assume the Linux SPI driver tops out at 20 thousand transactions per second. If you send one byte per transaction that's 20 thousand bytes per second...
by joan
Wed Jun 19, 2019 5:28 am
Forum: Beginners
Topic: 4 AA Battery pack for Servo
Replies: 11
Views: 252

Re: 4 AA Battery pack for Servo

It needs Pi ground to battery or servo ground. Battery ground to servo ground. Battery +ve to servo power. Pi GPIO to servo control.

It then needs pulses. At 50Hz
by joan
Mon Jun 17, 2019 1:11 pm
Forum: Other projects
Topic: ADS1115 is not detected by i2c
Replies: 6
Views: 280

Re: ADS1115 is not detected by i2c

Two possibilities.

The device is broken.
The device is not connected to the I2C bus.

You need to provide more information if you want us to judge.
by joan
Sun Jun 16, 2019 9:14 pm
Forum: C/C++
Topic: WiringPi / Raw SPI speed issue
Replies: 8
Views: 345

Re: WiringPi / Raw SPI speed issue

The best you can probably do with the Linux SPI driver is pack as much data into each SPI transfer as possible.
by joan
Sun Jun 16, 2019 8:34 pm
Forum: C/C++
Topic: WiringPi / Raw SPI speed issue
Replies: 8
Views: 345

Re: WiringPi / Raw SPI speed issue

Why not just use the bcm2853 library?

The limit you are reaching is probably the number of SPI transfers per second you can do with the Linux SPI driver.
by joan
Sun Jun 16, 2019 11:41 am
Forum: Automation, sensing and robotics
Topic: Send number of pulses with Pigpio
Replies: 18
Views: 497

Re: Send number of pulses with Pigpio

You can only have one wave chain running at a time. You can't use a wave chain and the hardware_PWM function at the same time. You can control multiple GPIO in a single wave chain. It becomes trickier to control two steppers but is possible (software isn't always easy). Can you give any concrete exa...
by joan
Fri Jun 14, 2019 10:53 am
Forum: Python
Topic: A problem with execution frequency
Replies: 4
Views: 180

Re: A problem with execution frequency

An example using any spare GPIO. This uses a command line utility called pigs. You can do the same with pigpio Python calls. sudo pigpiod # start the pigpio daemon pigs pfs 4 1000 # set GPIO 4 to use a frequency of 1000 pigs p 4 128 # set GPIO 4 to use a dutycycle of 128 (out of 255). http://abyz.me...
by joan
Fri Jun 14, 2019 7:55 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: WiringPi interfacing with Infineon pressure sensor dps310 not working
Replies: 11
Views: 423

Re: WiringPi interfacing with Infineon pressure sensor dps310 not working

It is simpler than that. Most SPI devices reset their state machine when their chip select changes level. The SPI hardware asserts/deasserts chip select for each SPI transfer.
by joan
Thu Jun 13, 2019 7:45 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: WiringPi interfacing with Infineon pressure sensor dps310 not working
Replies: 11
Views: 423

Re: WiringPi interfacing with Infineon pressure sensor dps310 not working

Instead of

Code: Select all

wiringPiSPIDataRW(CHANN, &buffer[0], 1);
wiringPiSPIDataRW(CHANN, &buffer[1], 1) ;
try

Code: Select all

wiringPiSPIDataRW(CHANN, &buffer, 2);
by joan
Thu Jun 13, 2019 4:55 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: WiringPi interfacing with Infineon pressure sensor dps310 not working
Replies: 11
Views: 423

Re: WiringPi interfacing with Infineon pressure sensor dps310 not working

In your code you have buffer[0]. The expected parameter is an address so that should be &buffer[0] or buffer.
by joan
Thu Jun 13, 2019 10:55 am
Forum: Python
Topic: A problem with execution frequency
Replies: 4
Views: 180

Re: A problem with execution frequency

How accurate does the frequency need to be? You need to adjust the sleep time to account for all the delays in the code (including the sleep itself). Change it until you get an average of a kHz. If that is not good enough you will need to use a hardware PWM pin or something like (my) pigpio which ca...
by joan
Wed Jun 12, 2019 8:23 am
Forum: Automation, sensing and robotics
Topic: Send number of pulses with Pigpio
Replies: 18
Views: 497

Re: Send number of pulses with Pigpio

That seems okay, but it should have worked if you set it before and after the call to wave_chain. It wouldn't work if you set it while the wave_chain is running. Note that wave_chain returns control to Python as soon as it is started. The wave_chain can take a long time to complete (e.g. 60000 secon...
by joan
Tue Jun 11, 2019 9:46 pm
Forum: Automation, sensing and robotics
Topic: Send number of pulses with Pigpio
Replies: 18
Views: 497

Re: Send number of pulses with Pigpio

You don't need an additional delay in the wave chain (the 255 2 command) as the wave already has a delay (the off period).

Say you want to loop REPEAT times (I assume 1 <= REPEAT <= 65535).

Then set x = (REPEAT&255) and y = ((REPEAT>>8)&255) then

255 1 x y will loop REPEAT times.
by joan
Tue Jun 11, 2019 1:35 pm
Forum: Automation, sensing and robotics
Topic: Send number of pulses with Pigpio
Replies: 18
Views: 497

Re: Send number of pulses with Pigpio

You really need to use a wave chain. It can handle pulse loops. The way you are doing it is fine but you do hit a resource limit (each pulse uses up some limited memory).
by joan
Tue Jun 11, 2019 12:27 pm
Forum: General discussion
Topic: Magnetic Encoder Rotary Incremental and Raspberry Pi
Replies: 1
Views: 99

Re: Magnetic Encoder Rotary Incremental and Raspberry Pi

If you google rotary encoder and raspberry pi you should find hundreds of examples.

Go to advanced search