Jump to content

Electronics gurus required


Recommended Posts

I'm struggling in finding a part here - I'm hoping someone might have an idea.

My idea is this: Around the outside of my speedo I add some LEDs to indicate RPM. Possibly I might replace the needle with more LEDs in a different colour to indicate speed, but this isn't a priority at the moment.

I have a PIC doing various bits n stuff behind the dash (mostly to do with the RFID starting system - I'm not going to discuss this here...) so programming it to produce a byte on a port to indicate RPM would be quite straight forward.

However, the issue comes with driving these LEDs - there are plenty of bar graph generators out there - but they rely on analogue signals (basically cascaded comparators - I think FridgeFreezer made a rich/lean indicator using these). I want to make these into a bargraph indicating the value of the binary output on the port of the PIC. I can find decoders to turn on a single output relating to the binary input (binary to one of four/eight/sixteen converter), but I want to keep the lower outputs on - i.e. a bargraph.

Does anyone know if these exist?

Does this post make sense to anyone? :D

Link to comment
Share on other sites

There are lots of simple d-a converter circuits that would take your digi out put and create an stepped analogue value equivilant, which would be more than fine for your application. I will have to dig out one of my text books but for a quick search:

http://www.tkk.fi/Misc/Electronics/circuits/dacs.html

This one has the R/2R network, i've palyed aorund with this and it works quite well for its simplicity:

http://www.ikalogic.com/dac08.php

Just to add, the chip/ led bar driver chip thing enables you to have a solid (bar graph liek you want) by connecting the apparopriate pins. Or alternatively jsut a single bar. To use that chip though, like you say, you need an analogue input first.

Link to comment
Share on other sites

Aha...I've just had a suggestion from my neighbour. I can use shift registers - not ideal as I'll have to pass the data out serially over time resulting in a time delay - but if I'm running at 20MHz I doubt if it will be noticeable! The advantage is that it will only tie up two lines of a port - plenty left for speed indication, or anything else groovy I can come up with!

Link to comment
Share on other sites

Why not generate a PWM output, either using the onboard timers, or simply decrement a counter in the main program loop (if the loop has fairly stable timing) or via an interrupt routine. Feed the output via an integrator to the LM3914 (bargraph driver that FF used). That only uses one pin from the micro.

Aha...I've just had a suggestion from my neighbour. I can use shift registers - not ideal as I'll have to pass the data out serially over time resulting in a time delay - but if I'm running at 20MHz I doubt if it will be noticeable! The advantage is that it will only tie up two lines of a port - plenty left for speed indication, or anything else groovy I can come up with!
Link to comment
Share on other sites

TSD - excellent idea, but my program has horrendously unstable timing (mostly due to my poor skill), and I've tied up the PWM output with dimmer control for the LEDs.

I've settled on using shift registers - specifically the HEF4894B. 12 outputs, cascadable, will cope with a 20MHz clock, and will sink enough current to drive an LED directly. Sorted :D

Link to comment
Share on other sites

Meccano - Thanks. I had considered using a D/A converter, but it seems like a bit of a bodge to me. I've taken the trouble to compute/scale the RPM in the PIC, seems a shame to spoil it all by converting it back to analogue!

What I'm really after is some sort of logic system...

But in the end all your doing is switching on some Leds, it's not exactly space age!

Link to comment
Share on other sites

I used to love programming pics!

Use whatever system takes the least pins from the micro.

The resolution of this led display is what? one led per 500 rpm?

elegance and accuracy in program design count for nought if your output device has poor resolution

It's not a criticism of your aim, but be pragmatic abut the system you use. In PIC programming the best solution is usually the one using least pins on the output, as they have relatively few outputs anyway.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We use cookies to ensure you get the best experience. By using our website you agree to our Cookie Policy