11/28: networking and communications

How do you search for tasty plants to eat while remaining aware of any stalking predators?

Assignment

-design, build, and connect wired or wireless node(s) with network or bus addresses
-send a message between two projects

Goal

Create a unique IR light pattern which can be detected and identified.

Steps

1. Leveraging the past few weeks of input, output, and interface work, with an eye on the final. I started work on creating my sensor-detect-output loop for the delightful dinosaur communication. I quickly realized my goal with sensing could be achieved in a variety of ways and so I spent a good chunk of time working on an RF solution with the nRF24L01-2.4G. Last week one of my major issues with IR-phototransistor sensing was range, with the max being around 20 cm and I knew I wanted to increase that for the final project. I met up with Sam Calisch to work through my systems map for the final project and decided to switch from IR light to RF. I did a load of research on the nRF24L01 and then went about designing a board in Eagle. The timing with the nRF24L01 is a challenge and there are a myriad of libraries that can be used with the sensor so I was focusing predominantly on code in ATmega (in order to realize RF communication), which I had not done yet this semester. I ran into Rob on Monday morning, when I was about to stuff my new board, and we talked through my final project goals as well as utilizing the nRF24L01, and by 11am, following some Arduino and breadboard experimentation, I was back on IR light! So long RF communication.



2. I started by creating a new IR_Light_Sensor board. Last week I used a super simple battery, LED, resistor set-up, but now I need to be able to pattern the light. I focused on keeping the board as small as possible as well as keeping the IR light towards the outside of the board in order to have as little interference as possible. Milling, stuffing, testing, board looks good. I programmed a very basic pattern of 10 ms on, 10 ms off, in a loop, into this new input device. Initial testing on the oscilloscope indicated a much slower pattern than 10ms/10ms and I realized I needed to add the timing adjustment from Neil’s code into my code. I reloaded and tested again and had a pretty accurate 10 ms on, followed by 10 ms off light pattern!






3. The heart of the work this week was on programming the IR_Light_Detector board to be able to both see and identify the patterned light. I created a loop function in which an initial threshold is set to help eliminate any ambient environmental noise and then checks for light each millisecond. After one high and one low, at the next high the count begins. After detecting a drop after 10 ms, a doSomething occurs and there is a delay of 1sec to allow the doSomething to happen. The loop repeats. This needs to be tuned as it currently only works out to about 20 cm.





4. Troubleshooting the code took a bit of time, but moving the function into the loop (since it is only called once) helped, as well as naming the phases and looking for the outputs on CoolTerm. I then tested this device with my new pattern-emitting input device and boom, I have a network with a unique light address! I also have a good start to my final project network! I need to increase range, include additional light patterns (currently just a change in period), and then for the doSomething to output a unique noise!!



Struggles

Code, code, code, code, code, AND range! The heart of the code is in the IR_Light_Reciever, which will also output a signal to the speaker. I have a nice loop function for detection, but I need to increase range not just with hardware, but software.

Tools

Eagle
Illustrator
Arduino UNO (x2)
Breadboard (x2)
Meterman
MODS
SRM-20
Weller WES51 Soldering Iron
Bausch & Lomb Microscope
Programmer Board
CoolTerm
Splitters/Cables
Oscilloscope
Friends

Source Files

Link to Eagle Schematic
Link to Eagle Board
Link to IR_Light_Source.c
Link to IR_Light_Source.make
Link to IR_Light_Detection_V2.c
Link to IR_Light_Detection_V2.make