Picaxe 18A infrared system

ope

New Member
Hello

I'm new here, and I'll start right away with stupid question. I'm making a system, where a small box has infrared led and receiver at the top of it (one in each side), and systems should alarm me when the box is full (something gets in the way of the beam). Is this kind of system possible with picaxe 18A and how I should programm it. (Similar to conveyor belt in the supermarket and automatic stop in it?)

IR-Led needs to "blink" for the receiver?? How?

The manuals doesn,t handle this kind on systems at all...
 

eclectic

Moderator
@ope
Welcome to the Forum.

It's a perfectly good question, just in the wrong place. :)

This area is for finished projects.

Please can you re-post, in the
Active forum.

e
 

Andrew Cowan

Senior Member
This is assuming you are using a modulated receiver:

The IR LED needs to flash at 38KHz - you can use PWMout (although I don't know if the 18A can do this), or you can use an external chip eg a 555 timer.

The modulated reciever will give a low output when it sees the beam, and a high output when the beam is broken.

A
 

ope

New Member
Hello

Sorry the wrong forum, my mistake ;)

Can I do the 38KHz flashing with the existing chip, 18A? I think this chip doesn't handle PWMout-function... Is it possible to programm the IR led to flash 38kHZ for instanse with PULSEOUT-command or some another way?

"The modulated reciever will give a low output when it sees the beam, and a high output when the beam is broken." Thank's for this inportant tip, Andrew!

o
 

hippy

Ex-Staff (retired)
The PICAXE-18A doesn't support PWMOUT due to firmware size limitations but the chip does have on-chip support for PWM so this could potentially be achieved by poking SFR's ( see the Microchip 16F819 datasheet ) or by using external hardware to produce 38kHz, a PICAXE-08M or 555 timer.

The easiest solution would be to upgrade to the PICAXE-18M which has superseded the 18A and supports PWMOUT, and keep the 18A for a project which doesn't require PWMOUT.
 

ope

New Member
Hello

I found in my scrapbox a 555 timer. How I can connect it to Picaxe 18A to archieve 38kHz pulse for IR-led? Similar projects or circuits?
 

ope

New Member
Second option. Extra 08M chip to 18A output, and from there through INFRAOUT-command to the IR-led? What command should I use when I want to send just steady continuing 38kHz signal out to the IR receiver to detect:

infraout 1,1 ?

Thank you very much for all your help so far!!!
 

hippy

Ex-Staff (retired)
To use the 08M to generate a continuous 38kHz signal you don't need to connect it to the 18A. Connect the IR LED + R between Leg 5 ( Output Pin 2, bottom right ) and 0V and use the following code ...

PwmOut 2, 25, 53,
Do:Loop

For detecting the signal just read the TSOP IR receiver chip with the 18A; that will be low when the IR is present, high when the beam is broken.
 

slurp

Senior Member
For detecting the signal just read the TSOP IR receiver chip with the 18A; that will be low when the IR is present, high when the beam is broken.
I'm not so sure it's that simple, doesn't the TSOP attenuates the signal if it's continuous. A burst of 10-70 cycles with a gap of 10 should work around this.

Mr Anderson has an example here that might help:

http://www.phanderson.com/picaxe/ir_1.html

I'm playing with a two channel reflective sensor based on the 08M - restarting an old project.

best regards,
Colin
 

hippy

Ex-Staff (retired)
I'm not so sure it's that simple, doesn't the TSOP attenuates the signal if it's continuous.
Doesn't seem so. Ambient light will do that but that's why we're using a modulated carrier.

#picaxe08m
PwmOut 2, 25, 52
do
outpin0 = not pin3
loop

Status LED on Output Pin 0 to 0V
IR LED on Output Pin 2 to 0V
TSOP output to Input Pin 3

Led stays on while IR present.
 
Last edited:

manuka

Senior Member
ope: Welcome,but perhaps forget that 18A! As I've stated many times before on this forum, inbuilt PICAXE-08M "INFRA" commands so revolutionised IR data work that IMHO it makes little sense now to use anything else. Such setups are simple,reliable & outstanding "bang for buck" - although naturally an IR sender & 3 leg receiver will still be needed. Just across a box will be trivial, as IR ranges to many 10s of metres are typical in darkened conditions.

But it seems you don't even really need IR data, so why not just consider more fundamental " full up" monitoring approaches? What materials are being boxed, & how large is this container? Stan
 
Last edited:

ope

New Member
18A is used just becouse the rest of the system is built around it, circuitboard and so on...

Box is small max. 15cm*15cm*15cm (6"*6"*6") and it contains coins ;)

This is just a learning project, and I would like to get this to work. Still I have a 08M chip that is reserved just to send 38kHz pulse, and 18A to detect when the beam breaks. Is that impossible to do? Or should I do new PCB to the 08M chip and do this whole operation with it?? If I could just get this present system to work, it would be the best choice...
 

manuka

Senior Member
Ok- but what is "the rest of the system"? Just an alert etc? Always the same coins or different values/weights/sizes? Aren't randomly placed coins going to interrupt the beam even when the box is not yet full?

A further aspect may relate to system power drain of course- it may be better to only turn on the alert when the box is nearing full. Otherwise of course you're wasting energy monitoring almost nothing at all! How long does it take to fill the box? Can you perhaps use a pulsed check every 10 secs or so? Maybe a weight system?

This topic has come up many times before on the forum,although it usually relates to liquids (especially water). Stan
 
Last edited:

ope

New Member
There's a microswitch and a recordable soundunit which plays a recorded message when coins inserted in the box, for instance "thank you fo your donation" ;) And 9V input voltage system and 5V regulation for the chip and the rest of the reguired wirings...

I know that stack of coins might be in disorder and distract the beam, but you can shake the box a little bit in that case... As I said, this is juts a learning project where I study Picaxes possibilities!!

Any suggestions how to get this system to work?
 
Last edited:

hippy

Ex-Staff (retired)
Still I have a 08M chip that is reserved just to send 38kHz pulse, and 18A to detect when the beam breaks. Is that impossible to do?
It's entirely possible and quite simply as you say, 08M generates IR pulses, 18A reads the TSOP IR Receiver; when the signal is low the IR is present,when high the beam has been broken.
 

manuka

Senior Member
Aha- microswitch & voice messages! Now you're talking. But have you done previous simple PICAXE work- LEDs/READADC/SOUNDS etc

Is your box mains powered ? How about this switch turning on a check IR beam as well? I assume the prerecorded messages will be simply presented from a voice IC? Again even a 08M could switch that in as needed. Mmm- if this full up alert is too visible someone may be tempted to pinch the money box. Should it be able to detect someone feeding in "holey" washers etc? Maybe provide a "silent" option for donors who don't wish the publicity?

FWIW it's strongly recommended that making & soldering up the PCB should be the very last stage of the project. YOU SHOULD TAME EVERYTHING (preferably on solderless breadboard) FIRST.

Yeah- I'm being a tad tedious, BUT these boring aspects may be crucial to the overall approach of course, & with (often bitter) past memories they are the sort of background material most experienced designers FIRST insist on. Even the most trivial "Ah- you never told me about that!" overlooked factor may eventually shoot down the whole project. It's like setting up solar energy system in high summer,located in a convenient valley site, only to find it's a flop in winter due to massive hill shading caused by the lowered sun angle. " Ah- we never thought of that..." Stan in (sunny) NZ
 
Last edited:

ope

New Member
Thank's for the tips...

I've done lot's of systems, but never IR before. Everything else has always been succesfull very easely, but this IR confuses me. Could there be this kind of examples for instance in Picaxe tutorial? There's just remotesystems now...

Voice comes from ready outside chip, what is controlled by picaxe. Works just fine... I assumed the IR to be easier. But now I'm wiser!! This is just a fun studyproject and I'm not gonna cry if I don't make this IR system to work ;)
 
Top