Board Bring up
So the electronics have actually been pretty good. Had a few distinct problems
So the electronics have actually been pretty good. Had a few distinct problems
- I had to remove a 22uF cap I had put at the sensor head power to ground because I was getting a crazy amount of 5v rail droop as soon as I turned that sensor on. The 22uF was there for bypass because I was getting noise on the output but seems like the cap on the output plus 5v bypass caps on the board plus the ~1.5m of wire inductance did the job just fine.
- Was seeing that once the sensor is off it takes almost a second for the voltage on its output to bleed down to 0v because of the 1uF capacitor on the output. This could give us false readings so I added a ~20k to ground to discharge the cap. Now we have sharp turn off.
- I had calculated an RC constant for the gate of Q6 to stay put keeping the FET off until ~47ms after the astable timer had gone low (triggered). This was because the Pgreen signal will go high as soon as the sensor has power because the first ~37ms of the sensor's readings are to be discarded. I calculated the the time constant for a charging cap though instead of a discharging cap. This meant by the time 37ms had passed I was still keeping the gate high which means the set/reset doesn't work right. So I recalculated using the correct formula, changed the resistor to 2M instead of 1M and we're in business!
- lastly, I goofed and forgot to check the astable timer’s duty cycle so now every second the sensor is on for like 200ms which is way more than the ~100ms I had in mind. Oh well, not gonna mess with that, it’s not a problem really. Battery drains a bit faster but we have plenty of power, also I guess it could catch me just at the cusp of leaving the green zone where noise will get it to light. Oh well, extra 10s of sensor being on but lights off since I’ll have left the driveway.
Power Consumption
I wanted to see how much power the whole thing takes now that I have it all. Disregarding the bit where the lights are on because that should only be 10 seconds every time I park (nominally once or twice a day). So I fully charged the battery so I knew what I was working with. Then I connected up the whole system together in a box without the solar charging and stuck it in a box for 24 hour test. At the 24 hour mark I took out the battery and recharged it through a USB tester to see how much juice it had lost in the 24 hours. To my astonishment the whole system was draining about 16mA/hr. The battery is 4400mAh which means it can last through 11 straight days of cloudy and overcast skies until it runs out of juice! Very excited about that.
I wanted to see how much power the whole thing takes now that I have it all. Disregarding the bit where the lights are on because that should only be 10 seconds every time I park (nominally once or twice a day). So I fully charged the battery so I knew what I was working with. Then I connected up the whole system together in a box without the solar charging and stuck it in a box for 24 hour test. At the 24 hour mark I took out the battery and recharged it through a USB tester to see how much juice it had lost in the 24 hours. To my astonishment the whole system was draining about 16mA/hr. The battery is 4400mAh which means it can last through 11 straight days of cloudy and overcast skies until it runs out of juice! Very excited about that.
Box and Thermal Engineering
I printed up the design in our 3D printer finally, glued standoffs for the board mounts and finally had a swing at putting it on the gate. Most everything went in just fine but I had to widen a hole for the top piece that holds the solar panel. This piece ended up giving me a ton of problems thanks to PLA warping from the sun! can't believe how much the features have moved on this thing. I even printed a 2nd piece which had little straps that came down to hug the base but you know what loves to move in heat? Skinny features like little straps! Will have to worry about this thing some other time I guess, the only really concern would be a gust of wind taking the top off which would suck but it's plugged into the charger board so probably not gonna lose any pieces, just hope it doesn't break. Oh I also redesigned the sensor's back bracket to give it a 15 degree angle. The sensor is mounted 16in above the ground on the rail so this angle puts the 60in max range of the sensor on the driveway which should minimize random glints of light or shiny object falsely activating the sensor.
I printed up the design in our 3D printer finally, glued standoffs for the board mounts and finally had a swing at putting it on the gate. Most everything went in just fine but I had to widen a hole for the top piece that holds the solar panel. This piece ended up giving me a ton of problems thanks to PLA warping from the sun! can't believe how much the features have moved on this thing. I even printed a 2nd piece which had little straps that came down to hug the base but you know what loves to move in heat? Skinny features like little straps! Will have to worry about this thing some other time I guess, the only really concern would be a gust of wind taking the top off which would suck but it's plugged into the charger board so probably not gonna lose any pieces, just hope it doesn't break. Oh I also redesigned the sensor's back bracket to give it a 15 degree angle. The sensor is mounted 16in above the ground on the rail so this angle puts the 60in max range of the sensor on the driveway which should minimize random glints of light or shiny object falsely activating the sensor.
Next (last) Step
I'm getting a problem with the latching sometimes such that the car parks, the lights are on for 10 seconds, they turn off for a second, then come back on thinking there is a new car in the way. The latch is either not taking or it's incorrectly becoming unlatched before re-latching and doing another 10 seconds. But this better be the last of it! I'll aim to have video showing it off next time working right.
I'm getting a problem with the latching sometimes such that the car parks, the lights are on for 10 seconds, they turn off for a second, then come back on thinking there is a new car in the way. The latch is either not taking or it's incorrectly becoming unlatched before re-latching and doing another 10 seconds. But this better be the last of it! I'll aim to have video showing it off next time working right.