12.07.2015 Views

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Analogue to digital conversion explainedMost modern microcontrollers have 1 analogue to digital convertor onboard. This one ADconvertor input is multiplexed to <strong>se</strong>veral input pins of the uC – giving the<strong>se</strong> pins A/Dfunctionality.MICROCONTROLLER WITHEMBEDDED AD CONVERTORAN0AN1ANALOGMULTIPLEXERAN2RESULTA/DCONVERTORAN3AN4AN58 BIT RESULT10 BIT RESULTAN6AN7The result of the AD convertor – in many ca<strong>se</strong>s – is a 10 bit binary (digital) value. In most ca<strong>se</strong>s –an accuracy of 8 bit is sufficient – so we can choo<strong>se</strong> to only u<strong>se</strong> the 8 MSB’s – or the full 10 bits.The Analogue values are measured between 0 and 5V – 0v resulting in an 8 bit digital value of0b00000000 (or 0) and 5V resulting in an 8 bit digital value of 0b11111111 (or 255). For example:2.5V will result in 0b10000000 (or 128).In robotics – often analogue <strong>se</strong>nsors (like the sharp <strong>se</strong>nsors) are u<strong>se</strong>d to measure distance –temperature – humidity – light intensity – sound pressure - …With the embedded A/D convertors of modern microcontrollers – it is no problem at all toconnect the<strong>se</strong> <strong>se</strong>nsors directly to the analogue input pins of the microcontroller.Bart Huyskens <strong>Manual</strong> <strong>Elektor</strong> <strong>Proton</strong> V1.0 3 April 2011 85

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!