PDA

View Full Version : 3 Volt Sensor with 5 Volt PIC?



Ramius
- 23rd March 2011, 18:59
Hi All! :)
There are probably several ways to interface a PIC running on 5 volts to a sensor that has a maximum operating voltage of 3 volts. I understand the sensor may need its own 3 volt supply rather than a resistor divider off the 5 volts or 2 each 1N914 diodes in series with the 5 volts which may be another possibility? Okay so I think you can take the output of the PIC through a 1K resistor to the base of an NPN (2N3904) transistor and either place another 1K resistor in either between the collector and +3 volts or between the emitter to ground. Anyone know which method is best? Next question. The sensor has a pin marked "SCLK". My best guess is this is an "input" from the PIC? The sensor in an MS5541C and what I understand so far is that " SCLK " wants a 3 volt clock signal, " MCLK " is an input (Master Clock?), " Din " is "Data in" requiring a 3 volt signal and " Dout " is data out at a 3 volt level? Therefore SCLK, MCLK, DIN, will each require a transistor to provide a 3 volt signal and DOUT will need to feed a transistor to supply a 5 volt signal? Or should I go back to my doctor and have him adjust my medications? :confused:

Thanks, Ed :D

mark_s
- 23rd March 2011, 20:42
Heres one solution, note the schematic on this page.

http://www.sparkfun.com/products/8745

Ramius
- 23rd March 2011, 23:21
Thanks Mark!
What a great device! Are my assumptions as to what is an input and what is an output correct?

Acetronics2
- 24th March 2011, 08:20
A simple solution ...

just need to adapt R4 to your requirements ... :rolleyes:

Note, the solution generally used is to run the Pic AND the sensor @ 3v ...

Alain

Ramius
- 24th March 2011, 09:26
Thanks Alain!
It is a great idea. This sensor is to measure the depth for a radio controlled submarine. It is one of a group of "sensors" that will be progammed into one big PIC. There is a tachometer on the port and starboard motors with temperature sensors, control for a sound module, a compass, internal flooding alarm, battery voltage and current draw, missile and torpedo status, and speed. Everything is to feed an on screen display as a overlay on the video from a periscope camera. The compass was my first project and turned out to be extremely accurate (.1 degrees). If you are interested, the compass is at http://www.robsonco.com/Dinsmore/Untitled_5.html.

Best, Ed

Ramius
- 24th March 2011, 14:56
Hi All! :)
After reading up on the sparkfun product I became uncomfortable with the posts about how the 3.3 volt side was actually only 2.5 volts due to a resistor divider of 2 equal values (1/2 the 5.0 volts applied). :eek: From my experience when you start operating towards the lower limits of a device it will tend to become "spritual" (technical term) ;) where sometimes it will work and sometimes it won't! A company called "Analog Devices" makes an IC called the ADG3304 which has one side that you give it your 3.3 volts and the other side the 5.0 volts. Another company called "Technological Arts" makes a model AD325V14 which takes this tiny IC and puts it on a board so it will plug in to a standard 14 pin DIP socket. The device has 4 bi-directional channels and they have other versions for upto 8 channels as well as a 4 channel open drain version. I hope this is useful to others.

Best, Ed

mark_s
- 24th March 2011, 16:26
You might find this helpful also.

http://ww1.microchip.com/downloads/en/DeviceDoc/chapter%208.pdf

Regards