Go to advanced search

by danjperron
Thu Feb 07, 2019 1:20 am
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6437

Re: Resistors and MOSFETs and fire-prevention, oh my

I only sort-of get it. If I connect the 5V pin at all, it will give constant voltage; I want to CONTROL the voltage, only sending through BPM mode in software here and there No! the diode is in reverse. It will just prevent the gate , if the mosfet burned, in will prevent more than 3.3V on the GPIO...
by danjperron
Wed Feb 06, 2019 5:12 pm
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6437

Re: Resistors and MOSFETs and fire-prevention, oh my

I notice on one of your picture that the resistor was on the ground instead of the GPIO. Then The Raspberry Pi wasn't really at the same ground level than the rest of your setup. Check this image https://imgur.com/DUVjwYr You have a kind of faulty ground there. The GPIO has no resistor to limit the ...
by danjperron
Wed Feb 06, 2019 12:05 am
Forum: Beginners
Topic: ssh from Mac
Replies: 14
Views: 429

Re: ssh from Mac

@rpdom Mac O.S. is based on BSD Unix. It's very like Linux. I got my Macbook since 2011. I do have Windows computer but when I work with the Raspberry Pi I used the MacBook since the console is pretty much the same. My 9 years old Macbook Air still perform very well compare to my third PC laptop I u...
by danjperron
Tue Feb 05, 2019 9:17 pm
Forum: Beginners
Topic: ssh from Mac
Replies: 14
Views: 429

Re: ssh from Mac

Oops I forget to mention that is nothing wrong with your Pi, except the password. I suppose that you have a new SDcard or another Raspberry Pi with the same name. The Mac will store the public key into .ssh/known_hosts and if it found that the new connection is not the same key it will complain. Thi...
by danjperron
Tue Feb 05, 2019 8:50 pm
Forum: Beginners
Topic: ssh from Mac
Replies: 14
Views: 429

Re: ssh from Mac

The fifth line is identified to be the offender


remove the fifth line in .ssh/known_hosts on your mac.

sed -i '5d' ~/.ssh/known_hosts

or use a text editor to remove the fifth line
nano .ssh/know_hosts
ctrl-w ctrl-t 5 [enter]
ctrl-k ctrl-x y
by danjperron
Tue Feb 05, 2019 3:48 pm
Forum: Automation, sensing and robotics
Topic: Time log with MPU Vibration sensor
Replies: 2
Views: 234

Re: Time log with MPU Vibration sensor

https://github.com/danjperron/mpu6050TestInC

Don't forget to increase the i2c frame rate to 400Khz in /boot/config.txt

dtparam=i2c_arm=on,i2c_arm_baudrate=400000

P.S. maximum rate is 1000 samples/sec.
by danjperron
Mon Feb 04, 2019 9:12 pm
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6437

Re: Resistors and MOSFETs and fire-prevention, oh my

RPi to Mosfet.png
Rpi with a mosfet to activate a selenoid
RPi to Mosfet.png (79.72 KiB) Viewed 869 times
I added a 10K resistor to discharge the gate if you disconnect the GPIO from the gate.
by danjperron
Mon Feb 04, 2019 7:25 pm
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6437

Re: Resistors and MOSFETs and fire-prevention, oh my

Are you using python for your code? According to your picture you are using GPIO21 which is pin 40. Did you set the correct GPIO mode if you are using RPi.GPIO ? If the touch with a wire using 3.3V and GND toggles your valve could you try this python script #!/usr/bin/env python3 import RPi.GPIO as ...
by danjperron
Mon Feb 04, 2019 7:13 pm
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6437

Re: Resistors and MOSFETs and fire-prevention, oh my

You need a load on the gate. If you touch the gate with the 3.3V. It will turn on. This is what you describe right? Then you need to discharge the gate. Use a load resistor. A resistor attached to ground on one side and the gate on the other. Or simply use a gnd wire and touch the gate. It should tu...
by danjperron
Mon Feb 04, 2019 6:31 pm
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6437

Re: Resistors and MOSFETs and fire-prevention, oh my

NOT connected: About .20 (voltmeter set to DCV 20)
CONNECTED: .10/.09
It's not working then. The mosfet not connected should give you ~20V and not 0.2V.

Did you put a resistor load on the drain like I did on the schema?
Do you have another mosfet on hand?
by danjperron
Mon Feb 04, 2019 5:26 pm
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6437

Re: Resistors and MOSFETs and fire-prevention, oh my

Thanks but what I was expected the connection between the mosfet (view of the raspberry Pi) and the view of your selenoid. First you should check if your mosfet behave like it is suppose to do. No Raspberry Pi needed. Please check your mosfet with a voltmeter. If you put the red wire to P1 the voltm...
by danjperron
Mon Feb 04, 2019 4:02 pm
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6437

Re: Resistors and MOSFETs and fire-prevention, oh my

I think what I'm missing is the GND on the GPIO. Don't I need to connect 2 pins to the RPi? a POS AND a NEG? Of course the ground of the Pi needs to be connected to the ground of your 12V supply which is your source of your mosfet. You need to close the loop!!! This is also true for the GPIO. if 3....
by danjperron
Mon Feb 04, 2019 3:22 pm
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6437

Re: Resistors and MOSFETs and fire-prevention, oh my

First Test if you put 3.3v directly to the resistor, is the mosfet activate?. (remove the gpio pin). Is the drain voltage lower on the mosfet? if yes what is the voltage. If the 3.3V works at the mosfet then it is time to check if your GPIO toggle. Use a led with a resistor to limit the current and ...
by danjperron
Mon Feb 04, 2019 3:05 pm
Forum: Beginners
Topic: Raspberry pi + RFID + database
Replies: 12
Views: 1193

Re: Raspberry pi + RFID + database

Check my howto in that github https://github.com/danjperron/MFRC522-python It is a modified version which accept 7 and 10 Bytes UID cards. Also it doesn't need sudo since I use ioctl for the spi. Download phpmyadmin webpage admin for sql. very handy. Also I include a small python script which called...
by danjperron
Mon Feb 04, 2019 12:16 pm
Forum: Troubleshooting
Topic: Radar Project Using Ultra Sonic Sensor
Replies: 20
Views: 964

Re: Radar Project Using Ultra Sonic Sensor

I forget to mention that the GPIO is set to GPIO.BOARD.

Be sure that you are using the pin number and not the GPIO number!
by danjperron
Mon Feb 04, 2019 12:13 pm
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6437

Re: Resistors and MOSFETs and fire-prevention, oh my

I do own a Orcad license and a free version of Eagle but it is Fritzing! In schematic mode. ;-)

I just did a screen save from my Mac.
by danjperron
Mon Feb 04, 2019 3:38 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Can't get SPI working
Replies: 5
Views: 396

Re: Can't get SPI working

Hum, The Raspberry Pi doesn't like 5V on its GPIO. Good chance that you burned your SPI , even your GPIO chips. You didn't explain how you connect the Raspberry Pi to your PCB. Be sure that no 5V goes on the GPIO. There is some bidirectional 5V to 3.3V adapter if you need 5V I/O. https://www.sparkfu...
by danjperron
Mon Feb 04, 2019 2:27 am
Forum: Troubleshooting
Topic: Radar Project Using Ultra Sonic Sensor
Replies: 20
Views: 964

Re: Radar Project Using Ultra Sonic Sensor

https://github.com/AmrMohamed-95/radar-simulation/tree/master/src[url] [/url] The code works fine. there is a small error and it is easy to fix. in the ultrasonicsensor.py module just create the variable start_time. This way if the condition doesn't create it python won't report an error. def ultra...
by danjperron
Sun Feb 03, 2019 6:38 pm
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6437

Re: Resistors and MOSFETs and fire-prevention, oh my

Capture d’écran 2019-02-03 à 13.37.19.png
schematic example
Capture d’écran 2019-02-03 à 13.37.19.png (44.76 KiB) Viewed 1255 times
by danjperron
Sun Feb 03, 2019 2:11 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Can't get SPI working
Replies: 5
Views: 396

Re: Can't get SPI working

Two questions! 1 - I do you connect your SPI to your lenovo computer. is it 3.3V or 5V. What kind of flash chip on your lenovo. 2- Do you check the SPI alone. Please use this python script and check if your SPI works, #!/usr/bin/env python3 import spidev spi=spidev.SpiDev() spi.open(bus=0,device=0) ...
by danjperron
Sun Feb 03, 2019 1:37 pm
Forum: Graphics, sound and multimedia
Topic: Play video file when someone sit
Replies: 6
Views: 364

Re: Play video file when someone sit

'-b' gives me problem with the new update.

Could you please use this line instead and tell me if it works?

Popen(['/usr/bin/omxplayer', '--display', '0', video1]


Also in your loop you should check if the video is already started otherwise you will rerun the same video every second.
by danjperron
Thu Jan 31, 2019 3:44 pm
Forum: Troubleshooting
Topic: Read Problems with SMBus & Ras Pi [SOLVED]
Replies: 16
Views: 623

Re: Read Problems with SMBus & Ras Pi

Sorry my bad, say take 10 bytes and convert them into 5 unsigned short values, this way code will be future proof fileh=io.open("/dev/i2c-1","rb",buffering=0) values = i2c_simple_block_read(fileh,addr,10) V = struct.unpack('>HHHHH',values) print(V) fileh.close() If they aren't Big endian please rem...
by danjperron
Thu Jan 31, 2019 12:37 pm
Forum: Troubleshooting
Topic: Read Problems with SMBus & Ras Pi [SOLVED]
Replies: 16
Views: 623

Re: Read Problems with SMBus & Ras Pi

It works fine with 4 bytes, with anything less such as 3 or 2 compiler error says: of course! This is why I didn't put the unpack inside the i2c_simple_read_block() function The struct.unpack('>HH',values) tell to take four bytes and convert it into 2 unsigned short values. You have to specify the ...
by danjperron
Wed Jan 30, 2019 5:01 pm
Forum: Troubleshooting
Topic: Read Problems with SMBus & Ras Pi [SOLVED]
Replies: 16
Views: 623

Re: Read Problems with SMBus & Ras Pi

Ok I create a simple read block function. Just add this function into my python code. You still need the parts I copied from SMBus. The function i2c_simple_block_read() needs the file handle, the i2c address and the number of bytes to read. It will return a bytearray. P.S. I just type it!!! I can't ...
by danjperron
Mon Jan 28, 2019 3:20 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: PCF8591 over I2C - need to read twice?
Replies: 4
Views: 315

Re: PCF8591 over I2C - need to read twice?

Looking at the spec. You are correct the first byte is the previous one. (Check figure 8 from the spec). the thing to do is to offset the result by one byte. If you are reading only one channel at the time then read 2 bytes , only one transaction, and toss the first one. On continous read with auto ...

Go to advanced search