LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 03-20-2017, 03:46 AM   #1
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Cool Phototransistor Raspberry Pi


Hello guys, is phototransistor an ideal sensor for detecting objects? distance to detect the object from the sensor most probably around 1cm.

Or LDR is ideal for this?

any ideas or suggestion is greatly appreciated.

Thank you.

Last edited by JJJCR; 03-20-2017 at 03:51 AM. Reason: edit
 
Old 03-20-2017, 03:55 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
that highly depends on the object itself (if it was glass or ???), on the speed of it and size of it and ....
What should be detected at all (there should be at least 2 different states)
 
Old 03-20-2017, 04:01 AM   #3
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Hi Pan64, basically it is some sort of a close range detection.

The object is a medicine pill.

Thanks.
 
Old 03-20-2017, 04:31 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
I do not think you can measure any range/distance or similar with that, but you can check if the pill is there (or not). But probably I misunderstood something
 
1 members found this post helpful.
Old 03-20-2017, 05:37 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Not enough information to say. As stated you can use them to detect a change in state. One example is an encoder that switches between black and white lines.
 
1 members found this post helpful.
Old 03-20-2017, 07:16 AM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: Slackware®
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member response

Hi,

A Photo transistor would not be the best choice since distance of the moving object would not effect the transistor unless the change is reflective to that device. Maybe looking into IR or look here; https://en.wikipedia.org/wiki/Passive_infrared_sensor to possibly modify detection of a small object at a distance. Even then the reaction thresh hold time may not be fast for a moving object that small.

Hope this helps.
Have fun & enjoy!
 
1 members found this post helpful.
Old 03-21-2017, 01:12 AM   #7
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Hi guys, thanks for all the replies.

Pan64 got it, I just want to check whether the pill is present or not.

What's the best option for this?
 
Old 03-21-2017, 01:14 AM   #8
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Cool

Quote:
Originally Posted by michaelk View Post
Not enough information to say. As stated you can use them to detect a change in state. One example is an encoder that switches between black and white lines.
Hi Michaelk, can elaborate further what do you mean by switching black and white? What's an encoder?
 
Old 03-21-2017, 01:39 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
You may want to detect if that thing moves, spins, you may want to identify that object (shape of it), you may want to measure its size, or there is a pattern on it you want to identify, want to know its weight, color ...
So there can be a lot of things .... In some cases you may need an encoder to do the job, but I do not think we need to go into details right now.
If you want to know only if there is something in between the LED and that transistor your setup may work properly (although you will not be able to tell if that was your finger, a screwdriver or a pill).
 
Old 03-21-2017, 02:58 AM   #10
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
The pill is in stationary mode, it's not moving. I only want to know whether in the holder, there is a pill and I am thinking whether a Phototransistor is able to do the job.
 
Old 03-21-2017, 03:01 AM   #11
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
depending on the layout, a phototransistor can be a good solution.
 
Old 03-21-2017, 05:38 AM   #12
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: Slackware®
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member response

Hi,

Quote:
Originally Posted by JJJCR View Post
The pill is in stationary mode, it's not moving. I only want to know whether in the holder, there is a pill and I am thinking whether a Phototransistor is able to do the job.
If the pill is contained and not in motion then an interruption on when the pill enters and remains in position could be done by interruption of the beam from a source to the photo-transistor. As long as the state remains then that could be sense for the pill or whatever is breaking your beam for the Photo-transistor. Your pill and beam should be contained so there are no leaks for the threshold settings of the detection. Your source beam must be finite and not cause to much flooding. The container material will need to have the beam and sense transistor aligned to provide a path to be broken by the pill. Ambient light could be factored in for the sense levels to allow bias of the Photo-transistor. Or use opaque material for the container then align the source and photo-transistor so a proper trigger point will occur.

Hope this helps.
Have fun & enjoy!
 
Old 03-22-2017, 08:24 PM   #13
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Thank you guys, a lot of mechanism is on my mind.

But I haven't really find a good time to implement in order to find out the limitation or whatever is the best way of doing it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Ubuntu MATE 16.04 LTS Officially Released for Raspberry Pi 3 and Raspberry Pi 2 LXer Syndicated Linux News 0 04-26-2016 03:20 AM
LXer: Raspberry Pi vs. Raspberry Pi 2 vs. CuBox: performance comparison LXer Syndicated Linux News 0 05-26-2015 09:33 AM
LXer: Raspberry Jams: why Raspberry Pi is going back to school LXer Syndicated Linux News 0 10-25-2013 12:20 PM
LXer: Raspberry Pi becomes Raspberry PC via Mini-ITX carrier LXer Syndicated Linux News 0 07-17-2013 01:20 PM
LXer: Enter the element14 Pi Day â??Raspberry RoadTestâ?ť Challenge for a chance to win a Raspberry Pi c LXer Syndicated Linux News 0 03-08-2012 06:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 12:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration