Go to advanced search

by danjperron
Sun Mar 03, 2019 10:31 pm
Forum: Python
Topic: ADC SAMPLE RATE
Replies: 20
Views: 840

Re: ADC SAMPLE RATE

Thanks for your information, i did everthing you said but it's still too slow.

You know that printing the ADC value each time reduces the speed a lot.You have print() in your code!

you should store your data into an array without printing and see what is your sample rate.
by danjperron
Thu Feb 28, 2019 4:56 pm
Forum: HATs and other add-ons
Topic: ADS1115-ADC Module for Raspberry PI 3 B+
Replies: 5
Views: 394

Re: ADS1115-ADC Module for Raspberry PI 3 B+

Just to confirm; Since my source is mono (I only have two wires from the amp) I would use GND and AN0? Yes! and ground AN1 , AN2 and AN3. You won't be able to get higher the 430Hz in frequency. You need at least two samples per cycle. The Pi is not able to give you a constant sampling rate. It will...
by danjperron
Thu Feb 28, 2019 4:45 pm
Forum: Troubleshooting
Topic: MCP3008 only returns a 0 value when using gpiozero
Replies: 1
Views: 65

Re: MCP3008 only returns a 0 value when using gpiozero

A picture of your gig will help!

Did you enable the SPI ?
sudo raspi-config , interfacing options, SPI

Did you try adafruit library PI ?


https://github.com/adafruit/Adafruit_Python_MCP3008
by danjperron
Thu Feb 28, 2019 4:35 pm
Forum: Automation, sensing and robotics
Topic: Water Depth Sensing
Replies: 10
Views: 575

Re: Water Depth Sensing

Why not buying cheap fish sonar finder and figure out how to interface the transducer with the Pi.
by danjperron
Thu Feb 28, 2019 4:21 pm
Forum: HATs and other add-ons
Topic: ADS1115-ADC Module for Raspberry PI 3 B+
Replies: 5
Views: 394

Re: ADS1115-ADC Module for Raspberry PI 3 B+

The ADS1115 maximum sample rate is 860 samples per second.

For audio you need at least 40 000 samples per second for each channel.


The ADS115 has 4 analog inputs

you need to connect the ground and use AN0 and AN1 for left and right. Ground AN2 and AN3 if you don't used them!
by danjperron
Wed Feb 27, 2019 3:33 pm
Forum: Troubleshooting
Topic: Error to run MFRC522 library
Replies: 2
Views: 556

Re: Error to run MFRC522 library

You could try my modified version of the MFRC522-python library. I'm using spidev instead of spi library. I also change to code to read 7 and 10 bytes RFID Card. N.B. I removed the reset pins and the GPIO from the library. Don't connect the reset! It doesn't need to be connected. https://github.com/...
by danjperron
Wed Feb 27, 2019 3:24 pm
Forum: Français
Topic: Raspberry serial port connexion
Replies: 3
Views: 276

Re: Raspberry serial port connexion

Tu peux tout simplement utiliser "C" ou python avec pyserial pour communiquer avec le GPS. Mon GPS envoie d'une façon continue. Code en C https://www.dropbox.com/s/n036oi4jn9vy1s4/readGPS.c?dl=1 https://www.raspberrypi.org/forums/viewtopic.php?p=661794#p661794 Pour commencer install minicom et regar...
by danjperron
Tue Feb 26, 2019 4:32 pm
Forum: Python
Topic: ADC SAMPLE RATE
Replies: 20
Views: 840

Re: ADC SAMPLE RATE

# Create the ADC object using the I2C bus ads = ADS.ADS1115(i2c, gain=1, data_rate=860) The data_rate has to be one of these values. # Data sample rates _ADS1115_CONFIG_DR = { 8: 0x0000, 16: 0x0020, 32: 0x0040, 64: 0x0060, 128: 0x0080, 250: 0x00A0, 475: 0x00C0, 860: 0x00E0 } N.B. The gain could be ...
by danjperron
Mon Feb 25, 2019 6:29 pm
Forum: Troubleshooting
Topic: cron wont run from ~/newfolder but will~/ ?
Replies: 2
Views: 112

Re: cron wont run from ~/newfolder but will~/ ?

Could you try crontab in root. Don't put sudo in crontab


sudo crontab -e


* * * * * /usr/bin/python /home/pi/newfolder/scripts/script.py


also you should specify the full path for python.
by danjperron
Sun Feb 24, 2019 1:08 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Curious SPI behaviour with spidev-3.4
Replies: 5
Views: 803

Re: Curious SPI behaviour with spidev-3.4

Looking at your first chart of your scope and It was on my mind that the spike is a full SPI exchange. You only see a pike because your timing of your scope was way to slow. I checked the python library and there was no clock speed set then it was obvious that the SPI could be way too fast. A small ...
by danjperron
Sun Feb 24, 2019 12:46 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: PCF8574 5V Ouput
Replies: 4
Views: 657

Re: PCF8574 5V Ouput

You are probably OK! I checked the link of your relays and they are active Low. The relay will turn on when the input is at 0V. Then you don't need any transistor at all. Sending 1 to the pcf8574 IO pin will turn the relay OFF. Sending 0 to the PCF8574 IO pin will turn the relay ON. This means that ...
by danjperron
Sat Feb 23, 2019 8:21 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: PCF8574 5V Ouput
Replies: 4
Views: 657

Re: PCF8574 5V Ouput

Did you forget that the PCF8574 is a quasi output. it has a low current pull-up this way it could be INPUT IO when the IO are set to HIGH. Only on LOW level that the sink current is strong enough. On high output the maximum output current is 100µA. Mostly the output are made for sinking and not sour...
by danjperron
Fri Feb 22, 2019 8:07 pm
Forum: Raspbian
Topic: There is a big chunk of unallocated space after flashing Raspbian to SD card
Replies: 13
Views: 752

Re: There is a big chunk of unallocated space after flashing Raspbian to SD card

So the fact that linux goes on to use the space on first boot means that it IS used by Linux.....
if you create another partition before booting the SD card then the resize won't work!
by danjperron
Fri Feb 22, 2019 7:09 pm
Forum: Raspbian
Topic: There is a big chunk of unallocated space after flashing Raspbian to SD card
Replies: 13
Views: 752

Re: There is a big chunk of unallocated space after flashing Raspbian to SD card

They are not "un-allocated", they are used by linux This is not true. Once you just finish to program an SD card it is exactly like the window OS reports. root@linuxserver:/usr/data/OpTest/public/RaspberryPi# fdisk -l /dev/sde Disk /dev/sde: 7.3 GiB, 7822376960 bytes, 15278080 sectors Units: sector...
by danjperron
Thu Feb 21, 2019 7:27 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: RS485 with UART and pyserial
Replies: 4
Views: 828

Re: RS485 with UART and pyserial

There is a class for rs485 settings in pyserial.

https://www.raspberrypi.org/forums/view ... 5#p1383709
by danjperron
Tue Feb 19, 2019 11:30 pm
Forum: General discussion
Topic: Strange Multiple AM2302/DHT22 Issue
Replies: 7
Views: 229

Re: Strange Multiple AM2302/DHT22 Issue

So DHT22's are sorta known to hang? If so then I guess what I am experiencing would be kind of expected and should wire their power to a gpio pin.

Yes this is the old story about it!

https://www.raspberrypi.org/forums/view ... ilit=DHT22
by danjperron
Tue Feb 19, 2019 8:43 pm
Forum: General discussion
Topic: Strange Multiple AM2302/DHT22 Issue
Replies: 7
Views: 229

Re: Strange Multiple AM2302/DHT22 Issue

Look at pigpiod , Joan add a gpio pin to power cycle if the DHT22 hang.


http://abyz.me.uk/rpi/pigpio/examples.h ... hon%20code



Works great!
by danjperron
Tue Feb 19, 2019 1:54 am
Forum: Automation, sensing and robotics
Topic: Inductive Proximity Sensor
Replies: 5
Views: 555

Re: Inductive Proximity Sensor

lets say that I use 12v DC to power the sensor.
then

Vout = Vin * R1 / (R1 + R2)

Vout= 3.3V
Vin = 12V
Let's say that R1 is 1K
Then R2 is 2636Ω => 2k7

1K to ground and the 2K7 to your sensor. The middle of both to the GPIO.
by danjperron
Mon Feb 18, 2019 9:58 pm
Forum: Automation, sensing and robotics
Topic: Inductive Proximity Sensor
Replies: 5
Views: 555

Re: Inductive Proximity Sensor

PNP pull high and you need to limit the GPIO input to 3.3V. The best way to protect the GPIO is to invert with a transistor or use a opto-isolator. proximity_PNP_to_GPIO.png It is possible to use 2 resistors only but you will need to calculate the ratio to be sure that the proximty sensor will never...
by danjperron
Sat Feb 16, 2019 7:23 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: MCP3008 SPI at 5V
Replies: 14
Views: 773

Re: MCP3008 SPI at 5V

I guess? If yes, how would I dimension this one? look at the specification of the LE33C. they specify at least 2.2µF for Vout. Normally I used 0.1µF for the filter capacitor. It should be wise also to add a 0.1µF with the electrolitic capacitor. Electrolytic capacitor are wrapped aluminium so they ...
by danjperron
Sat Feb 16, 2019 4:45 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: MCP3008 SPI at 5V
Replies: 14
Views: 773

Re: MCP3008 SPI at 5V

Maybe something like this
mcp3008WIthRefulator.png
MCP3008 with le33C for Vref
mcp3008WIthRefulator.png (157.67 KiB) Viewed 605 times
by danjperron
Sat Feb 16, 2019 12:08 am
Forum: Troubleshooting
Topic: Another question about RPi and the DHT11
Replies: 4
Views: 176

Re: Another question about RPi and the DHT11

DHT11 is +/- 2 Celsius.

You should have used another type of sensor for that purpose. At least the DS18B20 will have more resolution.
by danjperron
Fri Feb 15, 2019 11:49 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: MCP3008 SPI at 5V
Replies: 14
Views: 773

Re: MCP3008 SPI at 5V

Normally I used a LE33Cze regulator. I know it is not perfect but you could drive it directly from the 5V supply. Just connect the output to Vref with the suggested capacitor. You will notice that noise is way less. The Analog ground and digital ground has to be connected together but try to connect...
by danjperron
Fri Feb 15, 2019 9:06 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: MCP3008 SPI at 5V
Replies: 14
Views: 773

Re: MCP3008 SPI at 5V

I Agree with Brandon92. I didn't look at the specification ;-(

At 100% humidity you will get around 4.25V. Then use a resistor divider. Be aware that you can't drive to much current from it.
Try high value resistor first. something like 22K and 33K.

Go to advanced search