| |
||
|
|
DIY Sensor Multiplexer
The K8000 computer interface board, used on the robot, is limited to four analogue inputs. A multiplexer was essential in order to capture more sensor data. The multiplexer can allow the computer to capture data from several sensors using a single analogue input on the K8000. To do this it was necessary to create a device that could switch eight digital outputs one at a time and be controlled by 1 digital input from K8000. This is very similar to ‘running lights’ where several LED’s run in sequence and start again. To keep the multiplexer small it was decided that a PIC microcontroler would be used, as this would greatly reduce the number of required components. The chosen PIC was the 12F675 because of its small size (8 pin) and the low cost of the chip programmer. This PIC has only four digital outputs so these also needed to be multiplexed. The digital outputs when low can be used like a ground connection, allowing LEDs to be connected directly across two outputs as shown below.
The diagram above shows how four outputs of a PIC can be used to control 8 LEDs. If these LEDs are inside an optoisolator then they can be used to trigger transistors, allowing a sensor to pass data to the computer. The diagram below is intended to show the connections of the sensor multiplexer. This diagram does not show some components such as resistors and capacitors, and is intended only as a guide. To capture sensor data from the multiplexer a subroutine named ‘GetPlexer’ was created in the robots main code. This loop can read the value of the analogue input on the K8000, store it in an array, and then switch the digital output to the multiplexer on and then off again. This process will loop until all 8 sensors have been read.
When power is connected the first sensor in the array will
be active. It would be as if it were connected directly to the analogue
input of the K8000. When the signal from the digital output of the K8000
goes from low to high the power to the first sensor is disconnected and
the next sensor is activated. This process repeats until the last sensor
is activated and then it starts again from the beginning. This was housed
in a plastic box and jack sockets added to allow easy connection and removal
of sensors |
|
|
|||||||||||||||||||||||||||||||||||||||||||||
| Generator | Saturday, 4th April 2009 5:44am - No.3737 |
| In the diagram, Showing how control 8 LED's with only 4 output pins on the microcontroller, Is it possible to have all the LED's on at once? | |
| RMCybernetics | Saturday, 4th April 2009 11:20am - No.3738 |
| No, it is not possible. If you ran it fast enough you could make it appear like they were all on at once. | |
| Generator | Saturday, 4th April 2009 1:51pm - No.3743 |
| Oh. Which pins can I multiplex on a PIC18F4550? http://ww1.microchip.coam/downloads/en/DeviceDoc/39632D.pdf | |
| RMCybernetics | Sunday, 5th April 2009 2:46am - No.3744 |
| Any of the digital I/O ports | |
| Generato | Sunday, 5th April 2009 9:54am - No.3745 |
| Oh, So I can't use the analog ports? | |
| Generator | Sunday, 5th April 2009 11:25am - No.3746 |
| And I'm guessing you can't use input pins? | |
| RMCybernetics | Wednesday, 8th April 2009 1:15am - No.3752 |
| They are the same pins. You just configure them as input or output in your code. | |
| Generator | Wednesday, 8th April 2009 7:47am - No.3755 |
| But the analog pins are still useless in this design, right? By the way, Thanks for all the times you've helped me. | |
| RMCybernetics | Friday, 10th April 2009 2:53pm - No.3760 |
| Yes | |
High Power Pulse Width Modulated Signal Generators |
Electrodes for Hydrogen and Oxygen production |
Variable Frequency PWM Circuits |
Aura Photo Electrodes |
© 2010 All Rights Reserved
About Us | Terms of Use | Services