Increase Inputs on -08M

-Gary

New Member
Greetings!
I am building a line follower robot and want to use the -08M chip with the Proto-Board. The mechanical is done with (1) motor for the power and a servo to steer. A IRF510 controls the motor on-off and the servo does its job. MOSFET gate is on Pin0, Servo signal is on Pin1. I want to use (3) QRD1113 IR Sensors to follow a black line.

Now the question... I think that with (3)-08M pins remaining, I could use a CD4021-B Shift-In Register chip to get an on-off feedback signal to my -08M. The chip requires a Data, Clock and Latch connection. Clock could go to Pin2, Latch could go to Pin4 but would Data work on Input Pin3?? I have done a Forum Search and could not find anything that covers my question.

I am going to order the chip and finish my bot if you think this has a chance of working. Attached is a schematic of my circuit.

Thanks for your help!
 

Attachments

hippy

Technical Support
Staff member
You can use Pin 3 ( leg 4 ) for input, but it doesn't look like you have the right connections to the CD4021. P/S is an input on the CD4021 for a start.

To be honest, you'd be better off putting the 08M aside for some other project and using a 14M, 20M, or 20X2 which would likely be much simpler to use in this instance.
 

westaust55

Moderator
I suspect most on this forum have been looking to expand on the number of outputs and use the 74HC595 which has latched outputs so the outputs do not ripple as the data is shifted in.
For inputs the 74HC165 is the input equivalent which will load 8-bit parallel data and then allows the PICAXE to clock this byte of data into the PICAXE.
Both the 74HC595 and 74HC165 can be cascaded for even more signals.
The CD4021 is also a parallel load serial output chip but works very slightly different to achieve the same end result.

So in summary, yes the CD4021 would suit the intended application.


= = = = = =

In theory, you could expand both inputs and outputs by adding both 74HC165 and 74HC595 chips.
One clock, one latch and two data lines. Suspect that the 256 bytes program space in the “M” (but not “M2”) series PICAXE would be more a limitation in having lots of added IO and the code to shift in and out. Going to a 20M would get more IO with no code overhead.
 
Last edited:

westaust55

Moderator
Over and above the comments by hippy on use of O8M (pin3 = input only), looking at the QRD1113 datasheet, I believe you need a series resistor in the LED part of the opto switch together with pull-up or pull-down resistor on the 4021 inputs. Your circuit indicates that you have the opto transistor pulling the 4021 inputs to ground so pull-up resistors would be in order.


Also, with the 4xxx series CMOS chips all unused inputs should be pulled to ground. An advantage of the 74HCxxx series in that it is not so essential to control unused inputs.


- - - - -


Also why not connect the three optos switches to the F, G and H inputs rather than A, B and C.
Then you only need to clock in the 3 bits used rather than 5 leading unused values first. Saves a small amount of processing time.
 
Last edited:

inglewoodpete

Senior Member
In theory, you could expand both inputs and outputs by adding both 74HC165 and 74HC595 chips.
One clock, one latch and two data lines. Suspect that the 256 bytes program space in the “M” (but not “M2”) series PICAXE would be more a limitation in having lots of added IO and the code to shift in and out.
I would go the other way when using input and output expanders: One data, one latch and two clock lines. Separate clock lines means that the data in each shift register doesn't change unless required.

Agree that 256 bytes will be a limiting factor. If the 14M won't do the job, I'd be looking at the 18X. Plenty program space and probably enough I/O pins.
 

westaust55

Moderator
True IWP

I was more thinking more “globally” where other PICAXE chips do not have the ease of bidirectional pins.
 

-Gary

New Member
Thanks!

Thanks for all the informative replies! After reading everything it looks like I will save my -08M for another time. I have a 20M chip doing nothing so I shall put it to use on this project.

I found that Parallax has a circuit using this IR device with the appropriate resistors so I will use their schematic.

Thanks again!
 
I used the same IR sensor/emmiter in several POV projects. The connections shown in the upper right corner of the attached schematic worked very well for me
 

Attachments

westaust55

Moderator
I used the same IR sensor/emmiter in several POV projects. The connections shown in the upper right corner of the attached schematic worked very well for me
From your diagram, the QRD1134 is a 3 terminal device whereas the QRD1113/QRD1114 are 4 terminal devices.
But yes, you are using a series resistor for the LED portion as mentioned in post 4
 
Top