MCP23017 - Input signals where there should none - Raspberry Pi Forums


hello,

first of all, mother tongue german, please patient english.

second not find topic related problem, maybe used wrong terms neither google or forum search couldn't me information. started topic.

little backround: have little eletronics know-how, i've learned 15 years ago , never got use until now. mistake related lack of knowledge. i'm no programmer nor engineer, there mistakes made in sourcecode , schematics :)

project: tried make board can connect buzzer quiz-night. idea connect buzzer via usb port board mcp23017 port expander present , connect gpio of raspberry. on raspberry python code should checking if input given , write textfile can determine "buzzed" first.

first drawed schematic, messy , amateurish hope idea should do:
http://abload.de/img/buzzer_schematic6zxra.png

soldered components board. checked every connection, there shouldn't short circuits. picture provided:
http://abload.de/img/c43c76d1-5975-45b3-b0t1uk5.jpg

wrote little python programm test out if working:

code: select all

import rpi.gpio gpio import os import smbus time import sleep  b = smbus.smbus(1) address = 0x20 b.write_byte_data(address,0x01,0xff) b.write_byte_data(address,0x00,0xff)  while true: 	hexdata = b.read_byte_data(address,0x13) 	output = str(hexdata)[-2:] 	#print output 	scale = 16 	bits = 8 	result = bin(int(output, scale))[2:].zfill(bits) 	print result 	sleep(1) 
, there ran problem. mcp23017 can found , configured, no problem there. output rather strange. if there nothing on usb ports, , every input therefore should low python script post things this:

code: select all

00000001 00000001 00000001 00000001 00000001 00000001 00010001 00000011 01010101 00000000 00001001 00001001 00001001 00000001 
, on. there no pattern, inputs none should be. if connect buzzer or simple close circuit form 3.3v e.g. gpb0 high input on gpb0 again on other ports (e.g. 00000011).

here am, @ end of knowledge. toughts went missing capacitors , inductive noises. not determine point start. hope i've provided enough information maybe of can me? :)

in advance
bg
loki

edit: forgot say, tried measure voltage on inputs, voltmeter touches pins shows 0,01v , python output switched 00000000 or 01000100 or else, pin in question low

i've figured out myself.

stumbles across same problem:

use built in pull-up resistors of mcp23017 , connect "buzzers" gnd.

best regards
loki


raspberrypi



Comments