Components and code

The logic

The flowchart shows the behavior of the two dolls following an ideal flow of interaction (the dolls work in both directions).

Lucio works only from 9 pm to 7 am. Squeezing the belly of their Lucio (microswitches, 1), a child sends a help call to the connected Lucio which detects it. The left hand of the Lucio-receiver flashes red (LED, 1a) until the child holds it (microswitch, 2a). When this happens, the flashing calms down and the other Lucio glows blue and starts to purr (motor, 2). If during the night the child releases Lucio’s hand (3a), it slowly dims as does the glow and purr of the other doll (3).

Circuit, prototype and components

Below, the first illustration shows the main components used for Lucio. The drawing, made with Fritzing, shows the internal circuit.



The code

Lucio is powered just by Arduino. The trickiest part of the code was the organization of the several states of vibration and lights. I used the switch/case statements to set their different behaviors according to the buttons which are pressed or released. Download the whole code with comments.

Comments are closed.