Go to advanced search

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

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: 561

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: 792

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: 792

Re: MCP3008 SPI at 5V

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

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: 792

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: 792

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.
by danjperron
Fri Feb 15, 2019 8:53 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: MCP3008 SPI at 5V
Replies: 14
Views: 792

Re: MCP3008 SPI at 5V

So this should work as an alternative to a voltage divider right Even better ! You would have the full span. The MCP3008 and mcp3208 are diode protected on the analog input pins. Then just add a resistor between the sensor output and the mcp3008 input to limit the current if by error you got 5V! Al...
by danjperron
Fri Feb 15, 2019 7:16 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: MCP3008 SPI at 5V
Replies: 14
Views: 792

Re: MCP3008 SPI at 5V

Two options, 1 - Connect the MCP3008 to 3.3V with the Vref . (you should used a better Vref than 3.3v from the Pi. too noisy!) Use a resistor divider to get the sensor voltage correctly. 2- Use level converter on DI,DO, CLK and CE. something like https://www.adafruit.com/product/757
by danjperron
Fri Feb 15, 2019 6:32 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Interfacing with the MCP3208
Replies: 6
Views: 5423

Re: Interfacing with the MCP3208

http://ww1.microchip.com/downloads/en/DeviceDoc/21298e.pdf Page 21 show you the IN/OUT bit information. The first bit high indicates the start of synchronisation. The second bit indicates if you are using single or differential channel. The three others bits are the channel value. Look at the table...
by danjperron
Thu Feb 14, 2019 12:33 pm
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6475

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

So the problem is that on one hand the professional wants to work in all severe outdoor conditions (perhaps except in Mars where there are dust storms). On the other hand the casual sloppy hobbyist just wants to play with a toy motor indoor, in the home sweet home. Well first this is the wrong mosf...
by danjperron
Wed Feb 13, 2019 7:30 pm
Forum: General discussion
Topic: Controll Sonoff from RPi with Python
Replies: 2
Views: 353

Re: Controll Sonoff from RPi with Python

Well it is more than 2 years than all my sonoff use firmware from https://github.com/arendst This firmware is not compatible with the itead cloud but instead of a cloud it uses Mosquitto , a local MQTT broker, which is in on my raspberry Pi. I'm able to access it on my phone via MQTT Dash. Or I coul...
by danjperron
Wed Feb 13, 2019 5:27 pm
Forum: Python
Topic: ACS712+MCP3008 - Need help to convert bit values to current values
Replies: 14
Views: 591

Re: ACS712+MCP3008 - Need help to convert bit values to current values

@paddyg is correct. Resolution is an issue! Not just on the way you calculate it but 10 bits is not a lot. At Vref=5V you have 5V/1024 = 4.88 mv per digital value. The ACS712-05 is ~ 185mV/A. Then the precision of the system is (1A/185mV) * 4.88mV = 26.37mA per digital value. This is confirm with on...
by danjperron
Tue Feb 12, 2019 9:44 pm
Forum: Beginners
Topic: Raspberry pi + RFID + database
Replies: 12
Views: 1220

Re: Raspberry pi + RFID + database

The sql query will be the same. You just need to change the security part which could be different.
The python is just an sql query than it is straight forward!
by danjperron
Tue Feb 12, 2019 3:14 pm
Forum: Python
Topic: ACS712+MCP3008 - Need help to convert bit values to current values
Replies: 14
Views: 591

Re: ACS712+MCP3008 - Need help to convert bit values to current values

Everything is getting 5 volts, and the MCP is getting 5v on supply and Vref yes. Oh shoot, i did not take that into consideration.. Should i use a voltage divider on all the connections between the RPI and the MCP3008? Yes! you need to fix this if you don't want the gpio to fail!!! You need to redu...
by danjperron
Tue Feb 12, 2019 12:33 pm
Forum: Python
Topic: ACS712+MCP3008 - Need help to convert bit values to current values
Replies: 14
Views: 591

Re: ACS712+MCP3008 - Need help to convert bit values to current values

I am using an SPI interface on the mcp3008. I know that! ;-) The ACS-712 Vout is directly proportional to the VCC. If your reference is VCC on your MCP3008 you remove the fluctuation of the 5V. But using 5V on the MCP3008 you are not compatible with the 3.3V GPIO. Are you using 5V on the MCP3008 fo...
by danjperron
Tue Feb 12, 2019 3:43 am
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6475

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

I was curious about your chart and I test some of my IRF540N. I used three IRF540N plus one IRF630 and one IRF640. A 12V power supply was used with a 12V 2A lamp. This explains why the maximum current is 2A. The ambiant temperature is around 20 celsius. Each Mosfet was attached to a huge heatsink to...
by danjperron
Mon Feb 11, 2019 4:51 pm
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6475

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

@tlfong01 you are missing the point! When I said that they start to conduct it is not literally but according to the official specification the minimum Vgs they listed is 4V. Is the IFR540 will toggle the valve? This post is about to activate a valve which needs more than 300 ma to be ON . This is w...
by danjperron
Mon Feb 11, 2019 3:39 pm
Forum: Python
Topic: ACS712+MCP3008 - Need help to convert bit values to current values
Replies: 14
Views: 591

Re: ACS712+MCP3008 - Need help to convert bit values to current values

Yes Vcc fluctuation could be minimized if your are using the same 5V for the ASC712 and the MCP3008 Vref. Then everything is to a normalize 5V. But if the MCP3008 is 5V then you need to convert the 3.3V GPIO to 5V signal for the MCP3008. The MCP3008 at 5V => VIH = 0.7VDD (3.5V)and VIL = 0.3VDD(1.5V)...
by danjperron
Mon Feb 11, 2019 12:16 pm
Forum: Beginners
Topic: Raspberry pi + RFID + database
Replies: 12
Views: 1220

Re: Raspberry pi + RFID + database

Thank you for your answer!
Basically, my point now is to try reading RFID tags and placing them into tables created directly in Raspberry Pi, only then I should move to the net?
Did you tried my github and read the doorsystem.py to figure out how it works?
by danjperron
Sun Feb 10, 2019 1:09 pm
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6475

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

B.T.W. I just tried an IFR540N and it doesn't work on the pi . It only works if I toggle it using the 5V. So IFR540 is not a good part to be used on the Raspberry Pi directly. You need to add a stage to "uplevel" the gate. I.M.O. It is still a good mosfet but I will add an optocoupler in between. Th...
by danjperron
Sat Feb 09, 2019 6:01 am
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6475

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

1- surface mount chip are not good for beginners . Did you see the picture on this post! 2 - Yes you have to be sure that the mosfet works on all conditions. Temperature is a big problem! Here in canada it goes down to -40 celsius , and even lower. If you have something outside it needs to work. Low...
by danjperron
Sat Feb 09, 2019 3:04 am
Forum: Beginners
Topic: Resistors and MOSFETs and fire-prevention, oh my
Replies: 156
Views: 6475

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

@tlfong01 The Valve (coil) which he needs to activate is less than 1.5A so why checking the 20A???


And has you said is the twilight zone. This mean that it is not 100% of the parts which will work.
by danjperron
Fri Feb 08, 2019 9:23 pm
Forum: Beginners
Topic: Raspberry pi + RFID + database
Replies: 12
Views: 1220

Re: Raspberry pi + RFID + database

(I am using Rpi2 model B so it doesn't have wifi (i use edimax usb adapter for this)). I might be misunderstanding something myself but if I install database, phpmyadmin and apache (or something else) to my raspberry pi itself and I bring the whole project to my college and connect to the college's...
by danjperron
Fri Feb 08, 2019 9:10 pm
Forum: Python
Topic: ACS712+MCP3008 - Need help to convert bit values to current values
Replies: 14
Views: 591

Re: ACS712+MCP3008 - Need help to convert bit values to current values

Maybe you should read that post https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=221972&hilit=acs712 I did explain all the equation there. It will give you what we found about the ACS712, its resolution and the problem with the VCC power. The ACS712 Vout has a VCC/2 offset so you need to read...

Go to advanced search