Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

using a PIC for my project...how?

Status
Not open for further replies.

strokedmaro

New Member
Hello...Im pretty new here and have gotten a lot of help from some of you already which I really appreciate. Ive got a pretty basic background in electronics but am able to read a mean schematic and pick up really quick on things I'm interested in.

I recently undertook a fairly simple project and with a little research and reading have figured out how to make it work with transistors and gates. The problem is it requires so many components to work. I was told that not only would a PIC be cheaper but it would require far less components to operate.

Ive tried to figure this out on my own but the information I've found is primarily for someone who has a clue to begin with. Please let me know what I should buy to get started. Keep in mind I know absolutely nothing about the process but this is what I hope to be able to achieve:

I need a way to take 3 separate input voltages of 12vdc in 3 combinations and either have 1 ground (preferred if possible) or 1 voltage output on 3 different pins. Here is my table:

INPUTS_________OUTPUTS
A: 12vdc_______D: ground (or voltage)
B: 12vdc_______E:
C: 12vdc_______F:

INPUTS_________OUTPUTS
A: 12vdc_______D:
B: 12vdc_______E: ground (or voltage)
C: 0vdc________F:


INPUTS_________OUTPUTS
A: 12vdc_______D:
B: 0vdc________E:
C: 0vdc________F:ground (or voltage)


Please let me know if this is even possible, what equipment and PIC you would recommend that would work with this application. Also, any links to any information that will help the newest of the new guys understand. (I was directed to a sticky somewhere on this forum but again, most info was for more advanced people)

I really want to figure it out on my own and if I have the equipment, PIC and a little knowledge provided from some more experienced people I know I can make it work eventually. THANKS IN ADVANCE FOR ANY INFO YOU PROVIDE!!!
 
Last edited:
You could do this easily with a single 4028 chip and three transistors and resistors. You could also use a 74HC138 or other 74138 series chip if a 0-5V output was OK. You could also use a PIC, it'll take a lot longer to learn, but it'll be more versatile in the future; ie if you wanted to change the truth table you made above, the PIC would just need reprogramming where as a discreet circuit would need physical modifications.
 
I'm having a little difficulty reading the datasheet for the 4028. Is the output based on the Vdd input? If I understand correctly, I can use 12vdc inputs and would get 12vdc outputs correct? If I used 5vdc with this chip, I would only get 5vdc out correct....Thanks for help :D
 
Yes, the outputs and inputs will be compatible with voltages from 0-12V if you power the 4028 from 12V. If you are using this in a car, you'll need to protect the circuit from voltage spikes. The following diagram shows the basic circuit:
 

Attachments

  • DECODE.PNG
    DECODE.PNG
    9.2 KB · Views: 142
Thats exactly what I needed to know and exactly how I set the 4028 up in my schematic! How would I protect the Vdd 12vdc and the 3 inputs from voltage spikes? It is for a car project so I would imagine it would between 12-13.5 vdc with alternator voltage. Thanks again for the great information!!!
 
You can add some current limiting resistors on the inputs. Some capacitors to ground will also improve the noise immunity but will slow the response of the circuit a little (1-2 milliseconds). You can also protect the Vdd line with a simple zener:
 

Attachments

  • DECODE2.PNG
    DECODE2.PNG
    12.5 KB · Views: 117
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top