![]() | ![]() | ![]() |
| | |||||||
| General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion? |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) | |
| Quote:
__________________ When God was handing out the brains, I thought he said trains, so I asked for a small, slow one! | ||
| |
| | (permalink) | |
| OK, now I have been away and read up on some stuff, I have bought a few bit's and I'm almost ready for a hardware 'Play'. This is my attempt at rebuilding this split charger using a PIC. Can anyone advise me on my program please, It's written in 'Basic' as far as I believe, I've copied examples of other peoples snippets of code and added some other stuff which I have made educated guesses at. My description of it is as follows.. A split charger, It monitors two batteries which are seperately fused at around 100A (12V Lead Acid) and the output of an alternator on a vehicle, then it should display the results on the LCD. When the alternator is sensed as running it checks wether the fuses are blown by sensing if there is any voltage at each terminal of the solenoid which is eventually going to connect the batteries together in order to charge them, providing the fuse checks are passed. If the fuse check fails then the proggy should go into a warning 'Alarm' condition whereby it should pulse a piezo sounder, and display on the LCD which battery has a blown fuse, At this point the proggy should NOT allow the solenoid to be energised. I understand the "< 1" in the 'Fusecheck' sub routine may be completely wrong and this might not actually be the correct way to sense the state of the batteries connected to the analogue inputs so if I have this wrong please say so and possibly offer an alternative solution. The main reason I am posting this here is for information which I cant find anywhere, If you look at this snippet of code..... Result1 = Result1 * 5 / 1023 ' Scale it to volts Result2 = Result2 * 5 / 1023 ' I know & understand the hardware side of feeding a voltage of 12 - 15 volts into the PIC through a resistor network which allows a max of 5volts to enter the pic. But, what do I put into this piece of code in order to 'scale' the pic's interpretation of the input voltage of 5 volts and display it as up to 15volts. I just can't get my head around the maths involved, Basically because I don't understand the program I have just written lol. Here's what I have come up with so far. Quote:
Marks out of ten anyone?? hackableFM.
__________________ When God was handing out the brains, I thought he said trains, so I asked for a small, slow one! Last edited by hackableFM; 16th March 2008 at 04:43 AM. | ||
| |
| | (permalink) | |
| Can anyone help on this bit please? Quote:
__________________ When God was handing out the brains, I thought he said trains, so I asked for a small, slow one! | ||
| |
| | (permalink) |
| Well, the ADC is gonna return a number between 0 and 1023 for an ADC input of 0 - 5V. So think 10.23V and multiply this voltage by 2 to get a range of 0 - 20.46V. Put the decimal point in when you display it but keep the number internally in the PIC as an integer of 0 - 2046. Use a resistive divider that would give you 5V at the PICs ADC input if you put 20.46V into it. Say a 3.9K and 1.2K resistor with a 250R trimmer in the middle added for calibration.
__________________ --- The days of the digital watch are numbered. --- | |
| |
| | (permalink) |
| OK, now I think I understand that lol. I'll have a further play and see what I come up with. Many thanks. hackableFM.
__________________ When God was handing out the brains, I thought he said trains, so I asked for a small, slow one! | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Nokia S60 v1 USB Charger | antok.tm | Electronic Projects Design/Ideas/Reviews | 4 | 15th November 2007 01:30 AM |
| Nokia charger | bananasiong | General Electronics Chat | 6 | 7th August 2007 04:04 PM |
| Lead Acid Battery Charger Help Request | jagzviruz | Electronic Projects Design/Ideas/Reviews | 17 | 16th January 2007 11:46 AM |
| Battery charger for mobile phone Motorola | 2PAC Mafia | General Electronics Chat | 0 | 4th October 2005 04:20 PM |
| Split Charger | jezzz | Electronic Projects Design/Ideas/Reviews | 7 | 12th April 2003 08:13 AM |