Can i remote control a diesel engine?

mik3

Joined Feb 4, 2008
4,843
I am not an engineer too but I am trying to be :p
Also, remember that not every electrical engineer knows to design circuits. Most of them get a degree just to show it and get a job.

I couldn't open the file. I will try to build a circuit for you and post it.

In what language are you interested to program the PIC?

Have a search in ebay for PLCs and smart relays, you may find cheap ones there.
 

eblc1388

Joined Nov 28, 2008
1,542
Jonathan Westhues has coded a PLC compiler which generate native (PIC or AVR) code from PLC ladder diagram.

If one understands relay/timer logic, then it is a piece of cake to build the ladder diagram on GUI and compile it into HEX code for downloading to the PIC or AVR.

The program is free, comes with a tutorial.

All one needs is a hardware programmer.

Ladder Logic for PIC and AVR
 

Thread Starter

Franco_oz

Joined Jan 12, 2009
60
Hello Eblc, i built this circuit using LTSpice but Mik can't open it. Do you mind to have a look at it? As i told Mik, all the feedback i can get would be very appreciated. Mik, i thought MIcrochip has a software available for free to design, simulate and create the native code for the chip? May have to research it a bit and have a play if time allow me!.
 

mik3

Joined Feb 4, 2008
4,843
I know to write programs in C for PIC microcontrollers. If you want make the circuit, define which inputs and outputs you want on the microcontroller and I can write the code for you. I hope I will find some time. However, it will be good for you to learn how to program them, so have a try.
 

Thread Starter

Franco_oz

Joined Jan 12, 2009
60
Thanks, still would like your comments about this design, hope u get it running. Also don't forget few points: I am near 50, run a farm and am a shift worker! What i know now is what i loved to do as hobby over these years. Now i am trying to use my little experience to help running common tasks around my place. This autostarter for example would just relif a task. When i run it, i walk there, start it, flick the main switch and walk back. If something goes wrong, i am not there and rely only on the emergency relay. That is why i have undervoltage protectors to force the contactor to open and switch back to solar. So even if what i get to start it won't have frills and thrills and merely replace my "human duty" to walk and turn a key i'll be happy.
I'll have a go to find a tutorial for pic programming and see if can understand it. Thanks for all the good input given and the help offered during your studies and exams. I have no dout you will be a good and smart engineer. I reposted the asm file just in case. Note that you need the CD4000 library. Let me know if you want it and i put it here.
 

Attachments

mik3

Joined Feb 4, 2008
4,843
I will try to make a circuit. if you are planning to use a PIC have in mind that you will need a programmer. You can find cheap ones in ebay. However, I still support the idea of the PLC ;)
 

eblc1388

Joined Nov 28, 2008
1,542
Hello Eblc, i built this circuit using LTSpice but Mik can't open it. Do you mind to have a look at it?
Your circuit opened and simulated fine in LTSpice. However, as it involves so many 555s, others would have no idea if these outputs are changing as they suppose to. Only you would know.

However, connecting so many 555s together and hoping they will are act sequentially in sync would not be easy. If any one missed a trigger or miss fired then your whole sequence will fail.

Right now, your best course of action is to look at the PLC link I posted above. Builds your sequential circuit on screen using ladder diagram. Simulated it in side the PLC software and see it working as it should and then generate the HEX code for the PIC or AVR.

If you try to learn uP programming first and then program your chips, this of course is the best one can do. However, it will take twice as long as there are now two separate learning processes.
 

Cornbread

Joined Jan 22, 2009
5
Thanks for the link...eblc1388,
The idea of PLC's for use around the house has caught my interest....something fierce.
Being so common in industrial environment, I guess Ive never given them a second thought before. Been a little entertaining daydreaming little choirs for them. Im hoping the idea of starting and stopping diesel genset is still alive and well on this thread.
 

Thread Starter

Franco_oz

Joined Jan 12, 2009
60
hello Cornbread, well it is still very well alive for me and the circuit is actually working! Only prob is that is all mounted on 2 bredboard, from there it goes to a relay card and from relay card goes to relays inside the engine. It is very messy and i am waiting some more comments about it before going ahead and build it on proper pcb. I am also waiting feedback from Mik. If i get it done in a decent way I put feedback in here. I like the idea to program a pic with ladder diagram. If you are trying to make one as well, we can both have a go and get advise and help form the guys here... surely they know more than me! :)
 

mik3

Joined Feb 4, 2008
4,843
Franco, have you considered what will happen if one relay or something else brakes down?
Will the engine get destroyed?
 

Cornbread

Joined Jan 22, 2009
5
Ive been cruising through a few suggested sites from this thread about PLC's and PIC's. I have a question from anyone with real world experience with these things. How sensitive are they to using somewhat "dirty power"? Specifically, in older vehicle with garden variety regulator and such (non-computer). Im seeing a new regulator is called for at minimum, and a few sensors of sort. Trying to get a handle on PLC and how to make life easier for it.
Appreciate the thinking going on in here.
 

Cornbread

Joined Jan 22, 2009
5
Just a sidebar comment for Mik3...
Diesels are about bulletproof. They fire-off cylinders thru high compression, hence no spark plugs needed. The glow plugs are more or less a kick in the pants to get going. They heat up air in cylingers then they are done. (aid in initial compression). Aside from that, it is often harder to shut them down... Maybe you are familiar with old term...diesel-ing, or as Sgt Wookie called it...runaway.
 

mik3

Joined Feb 4, 2008
4,843
I designed the circuit I was talking about. Look in the attachment.

The 555 has to have a frequency of 2 Hz and the JK have to have an asynchronous clear input. Note that the resistor and capacitor values on the 555 are not the correct for 2 Hz.
 

Attachments

Thread Starter

Franco_oz

Joined Jan 12, 2009
60
With 2Hz timing will be too short. Think you mean 2sec? On 2 sec i can get timing very close to what i need to make sure it start. Any reason why you invert the clock entering the 161 counter? Only other problem is that i need two separate lines to control it. This circuit is much simpler and easier to understand than mine! :)
 

mik3

Joined Feb 4, 2008
4,843
Sorry about the frequency, I meant 0.5 Hz and thus a period of 2 sec.

The counter counts up on the negative edge of the pulse, thus I used the inverter.

Also, I forgot to connect the K input of the power flip flop to ground.

In addition, if you want, connect a 10nF capacitor between pin 5 of the 555 and ground to minimize noise on the internal comparators.
 

Thread Starter

Franco_oz

Joined Jan 12, 2009
60
Ok, it is now mounted on a proto board and it all works fine! I built another smaller board with relays and buffers and connected it to the outputs. At this stage i am pretty sure it will all work... just didnt have time to wire it all up at the genset side.
Making the board was quite more complex and time demanding then what i originally thought but all up it has been an interesting excercise and i learned a fair bit from it.
I been looking at PLC and PICs and as i have to make two more boards for the other gensets (and one is hopefully now independent thanks to this circuit) i may spend some time learning more but i am stuck on how to start. First i think Eblc is right about trying to learn pic programming (at this stage) and concentrate on programming the pic with LdMicro which appears to be easier to use. My problem is how to approch the task and start to build my project. If i want to make the same circuit using a plc (or pic) where do i start? Shall i have a counter and depending on the count i start TimeOff relays to make what i want? Or i shall use a different way?
If i post in here a simple ladder diagram can i count on your suggestions?
 

mik3

Joined Feb 4, 2008
4,843
If you use a PIC or a PLC you won't need a counter. You just need to provide the input signals and get the outputs (with a few resistors and capacitors if needed, especially in the PIC case).

My suggestion is to learn PLCs rather than PIC if you are going to use them in this kind of applications.
 
Franco Oz,
Have you looked into a simple enbeded system? wiring board http://www.wiring.org.co/ would do it with a few MOSFETS and an Cheap RC toys guts. It would be a on push botton and it would start and push the same botton and it would stop. The wiring board has 54 I/O so you could use the signal from the oil pressure sending unit to cut the power if it is not present. take a look it could be a great way to go.

Vaccumdiode
 

Thread Starter

Franco_oz

Joined Jan 12, 2009
60
I wired it all up this arvo and finally tested the all lot. It is all running good and it does the job! Thanks for the infos, had a look but didnt quite get what it is?
Mik3 i didnt explain proply what i meant in my previous post. First i can't afford to buy a commercial PLC due to the hi cost involved. This board all up costed about 25 dollars in parts without relays (i had already most parts) and lots of hours at night to wire up the gates! Now i was thinking to use ldmicro which allows me to use ladder diagram to design my application and then program a pic with the hex file. Correct me if i am wrong, If i get a pic 16F877, use one port as output and connect relays to it via a ULN5803 buffer and use another port as input and connect optocoupler to it, i should be able to use my 12v signals and give feedback to the pic while the relays control the engine functions. With ldmicro i design my application and load it onto the pic... am i right? That way i can make a board lot smaller, 1 pic 1 buffer few relays and the input circuitry. Does it make sense? Eblc is right, ldmicro is a lot easier then learning pic programming. What do you think?
 

eblc1388

Joined Nov 28, 2008
1,542
Glad to be of help.

To your new endeavor, I would offer several suggestions.

1. Get yourself a simple and good PIC hardware programmer so that you can download the HEX code into the target PIC. PICKIT2 is a good one. Don't try to build a programmer yourself as that's a whole new project in itself.

2. Start out small, with one or two relays and work your way up. Do not design the whole engine startup/shutdown project in your first go. In PIC programming, we all starts by flashing a LED. Perhaps you can set yourself some exercises like push button to turn on lights or let them go off after a certain time. These are proof of concepts exercises and let you gradually build up your ability to command the logic of the PLC. Do really built those circuits to prove that the whole tool chains actually works.

3. Document your progress from time to time here in the project section. Maybe you can also offer your findings or tips for others to ease their learning path a little. A lot of people are facing the same situation as yours but do not have the courage to take the first step in trying out or learning new methods as there are no "example" for them to aspire to. Learning to do something differently is hard. Just talk to the 555 guys.

4. Credit the LDMicro author from time to time for his great software offering for free to everyone. You can also let him know of your progress.
 
Top