Author Topic: Reading an LDR array with a micro  (Read 1747 times)

0 Members and 1 Guest are viewing this topic.

Offline CyberJacobTopic starter

  • Newbie
  • Posts: 2
  • Country: gb
  • Foxocube
    • www.foxocube.xyz
Reading an LDR array with a micro
« on: May 15, 2017, 10:29:04 pm »
I am trying to repurpose a replica GPO 746 using a micro to replace the phone-line logic, however the rotary mechanism is rather different to that in an original 746.
The circuit has 12 LDRs arranged in an array (3 columns, 4 rows), a shutter attached to the dial, and an LED above the shutter. The shutter is arranged so that when the dial is rotated, a single LDR is illuminated by the LED. The finger stop incorporates a microswitch which powers the LED. I've included a rough circuit diagram below.

The row and column wires were previously connected to an HM9102D, however I cannot reliably replicate the setup using a Raspberry Pi. Reading the GPIO pins via multiplexing seems to have inputs triggered at random, even when the LED is off.

How can I reliably read the inputs from the dial?

 

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 6349
  • Country: ca
  • Non-expert
Re: Reading an LDR array with a micro
« Reply #1 on: May 18, 2017, 11:45:29 pm »
Since this is a switch matrix you need to scan through the rows and columns, you cant just read inputs.

It should work similarly to this:
http://hackyourmind.org/articles/raspberry-pi-with-a-keypad-matrix

Although you may want to check what the open/closed resistance of the LDR is.
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf