Some background: I am putting together a display to teach children about how neural circuits work. I am making a group of 'blocks' (each of which contains an ATTiny85, an indicator LED, and input/output wires) that can be connected in different configurations to represent different circuit motifs.
The problem: I am trying to use PWM to communicate between the ATTiny85s. My original idea, simply reading input PWM signals with
analogRead and generating a PWM output with
analogWrite, worked fine while all the ATTiny85s were running off a 5V power supply from an Arduino. However, now that I've switched to using a 4.5V battery pack for each ATTiny85, the PWM communication no longer works.
I expected the PWM outputs to change somewhat (given that
HIGH is now limited to 4.5V), but what I am finding is that the output values (when read into an Arduino using
pulseIn) now jump around hugely (e.g.
pulseIn read out between 50 and 15000 from PWM output
analogWrite(250)). Even averaging over up to 1000 pulses doesn't do much to smooth out the value.
Am I missing something?