AI Society 2 – The Hardware

Now that we have an understanding of the goal of the experiment, lets take a look at the parts.

Parts list

To start I’ve put together a table of all the items. I’ve included the part names, useful information, data-sheet if available and the price per unit. The prices are the amount I paid and may have changed since I wrote this. As some purchases had more than one piece per order I have entered the price per unit so we get an accurate idea of the price per module. I’m not hugely worried about the quality of the parts, seeing as this isn’t critical. As such I mostly ordered the cheapest I could find.

Part ID/Data Datasheet Link Price
Mini D1 ESP32 ESP32 Espressif.com eBay £5.99
Thermistor MF52-103 (10k ohms) Electronic Alliance eBay £0.37
Photoresistor GL5528 Gate eBay £0.09
Solar Panel 1 5V 1W 200Ma (110x65mm) N/A eBay £4.29
Solar Panel 2 2V 0.18W 90Ma (58.5×30.5mm) N/A eBay £2.29
Charging board Micro USB 5V 1A N/A eBay £0.35
LiPo battery 3.7v 1000mAh N/A eBay £8.45
Li-Ion 18650 battery 3.7v 9800mAh (x3 29,400mAh) N/A eBay £3.05*
18650 battery case Holds 3 N/A eBay £0.74
Adjustable Step down board 3v-40v to 1.3v-35v Buck converter N/A eBay £0.54
Total 1 With Solar panel 1 (Large) £15.42
Total 2 With Solar panel 2 (Small) £13.07

*This is the price for three of these batteries as this is what each node will use.

Note: I will probably need to use some other bits and pieces when connecting all this together, I will figure out exactly what when I create the circuit diagrams and other mock ups.

At the time of writing I am still waiting for the ESP32 boards, 18650 batteries, battery cases and buck converters to arrive. Of the cheaper components I ordered enough parts to make 5-10 nodes. I ordered two identical ESP32s and one of each size solar panel.

ESP32 – The heart and brain of the experiment

So, what do we have here? Lets start with the heart of it all, the ESP32. A very impressive little system on chip. It features a 32 bit dual core processor (240MHz max clock speed), 4MB of flash storage, WiFi, bluetooth, and most importantly for this experiment: a deep sleep mode with ultra low power co-processor, as well as various other sleep modes and a plethora of power saving options.All this in a chip only 7x7mm! The ESP32 is essentially a miniature computer, which will be used to handle the processing of the social interactions and the environment variables, connected through the GPIO pins (General Purpose Input/Output). Not much else to say about it really. Espressif have managed to cram everything I could want for this onto a tiny chip.In order to leave these guys lying around without needing to maintain them, I will need to do everything possible to reduce the power consumption. This means playing around with the sleep modes, using BLE (Bluetooth low energy) and anything else I can figure out. When the boards arrive I will put them through their paces and do a write up on my findings.

Thermistor and Photoresitor – The senses

Next up, the other two key components: the thermistor and the photoresistor. The thermistor will provide the temperature reading and the photoresistor will provide the light reading, simple. As their names may imply these are resistors that are effected by external variables. When heat or light are applied, to the thermistor or photoresistor respectively, the resistance of the component increases, the ESP32 monitors this resistance in order to check the current temperature and light level, as well as the changes of each. These inputs will be used influence the nodes behavior as I have mentioned in the first post and will expand upon in later ones.

Powering her up – Hang on a minute…

The rest of the components are all related to powering the nodes. This is the trickiest area of the project. As I want each node to be self sufficient, they need to be powered indefinitely. To start I have chosen solar power. However, in England we don’t know what sunshine is and I doubt there would be very much under a couch, should I choose to put a node there. I may need to figure out some other power method for those nodes kept in the dark, probably charging them via USB every now and then.

How much power do we need?Reading this post on the MicroPython.com forums and the datasheet (see the image below from page 21), we get some idea of the potential power consumption. Although I am hoping to take advantage of the various sleep modes where possible, it is always a good idea to work from the worst case scenario.

I have left the following section unchanged after realising, halfway through writing, the 1000mAh battery won’t hack it. I have addressed this at the end of the paragraph.

So, our LiPo batteries store 1000mAh of charge, whilst transmitting over bluetooth uses 130mA and receiving 95~100mA. I will use constant transmitting in my calculations as it is the higher value we get: 1000mAh/130mA=7.7 hours of run time. That doesn’t sound like much! However, as we won’t be constantly transmitting and receiving it will last a bit longer. Going back to the table we see Modem-sleep at normal speed (80MHz) uses 20~25mAh and deep sleep with the ULP coprocessor a measly 150uA! (150 micro amps, which is 0.15mA). Only using the deep sleep mode, which obviously we won’t, means that in a best case scenario the batteries would last for 6666.67 hours, approximately 278 days. That’s quite a range, almost less then a quarter of a day to just over quarter of a year! Enough fooling around now, what are we actually going to be using? To get full accuracy we obviously need to have the finished product ready and hooked up to a multimeter. For now we need to have a best guess at the average draw. Even that is tricky, and means taking into consideration how often the nodes might be communicating and processing. For now, I’m going to guess 75mA. I am certain this is way off but we do need something to start with. This gives us 1000mAh/75mA=13.3 hours. Hmm, I really do not want to be charging these up every day. Time to put these LiPos aside for another project and rethink! Hopping back onto eBay I had a look for Li-Ion batteries. I found and ordered some 18650 type batteries (think slightly longer AA batteries) with 9800mAh and battery cases that hold three in series. Now the capacity is a whopping 29,400mAh. Therefore: 29400mAh/75mA = 392 hours or 16.3 days. Much better! And they cost much less than the LiPo bringing the overall cost of each node down.

I bought two solar panels to experiment with the size needed and the placement of the nodes relative to the amount of power the panels produce. If this experiment used ATTinys minimal light and a small panel would be fine. However, with the ESP32, putting the panels in a dark spot is not likely to provided anywhere near enough power. I’m interested to see the results. Especially as there is a drastic difference in the size of the two panels.

As the ESP32 board I ordered only supports a maximum of 3.3V input, we need to decrease the voltage from the batteries (+-), this is what the adjustable buck converter will be used for. The charging board purports to be “smart”, claiming to have protection against over charging, over voltage and low voltage cut off. I certainly hope this is the case, but it isn’t likely to be much of an issue. Helpfully, it has a micro USB port, which can be used to charge the batteries, in case the solar panels aren’t providing enough current. The solar panels and battery cases will be directly connected to these boards.And that’s all the hardware, for now.

Want to know when I post? Why not subscribe!

Recent Posts

chris.holdt Written by:

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *