MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "Selfmade_Computer",
        "continue": "gapcontinue||"
    },
    "query": {
        "pages": {
            "102": {
                "pageid": 102,
                "ns": 0,
                "title": "Realistic Fire Simulation",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "In this page is described how to create a realistic flickering fire effect with LEDs and an Arduino board. In this case I used a [[Digispark]] due to its small size. \n\nThe intention is to give some light to a small clay decoration house, one of those prepared for lighting a small candle inside and evaporate water with essence. Instead of using a candle I put a battery with some LEDs inside but it looked too boring so I tried to imitate the movement of a candle inside it. Here it is described the design and process followed.\n\nThe concept is similar, with red and yellow LEDs illuminating inside the clay house, but with a flickering effect imitating a candle. The flickering effect can be created with an Arduino handling the LEDs power. The power for each LED is determined randomly with an update time that is also random (see the code later in this page). \n\n== Component Schematics ==\nThe three LEDs (two reds and one yellow - I guess one red and two yellows would also look nice) are connected to the PWM ports of the arduino (Digispark, which has exactly 3 PwM pins). The LEDs are connected logically inverted (the LED is powered when the pin is at LOW status and it is off when the pin is at HIGH status) because it is safer for most integrated circuits to drain power than to provide it (although for this microcontroller we are in the safe range).\n\n[[File:Fire_led_schema1.png]]\n\nThe pin P1 of the Digispark board already has red LED attached to it, so there is no need to add a new one, or to remove the current one. For this reason the new schematics is:\n\n[[File:Fire_led_schema2.png]]\n\n\n== Building ==\n\nIn the next picture the connections for the LEDs in pins 0 and 4 have been soldered. Each pin has two 470 ohm resistors in parallel that make a total of 235 ohm (I did not have 220 ohm or similar). As the system is powered by 4.8v that makes a maximum of a bit more of 20 mA per LED, which should be bright enough and safe for the microcontroller. Visit the next section to have a look at code running in the board.\n\n[[File:firesimled01.jpg]]\n\n\nThe next picture shows the system already assembled, the two conventional LEDs plus the one included in the board, with a 4x AAA 1.2v battery pack (giving a total of 4.8v). The battery pack has to be connected to the 5v and GND connector of the Digispark board (4.8v is enough). The Digispark board has a power on red LED that has been removed with a sharp knife because the continuous red light was spoiling the fire effect.\n\n[[File:firesimled02.jpg]]\n\n\nThis picture shows the powered on system inside the bottom of the clay house, with the three lights already flickering.\n\n[[File:firesimled03.jpg]]\n\nThe average power consumption is around 45-50mA with peaks that can be a bit higher (due to the random LED powers), which should power the system for about 20 hours with 1000 mAh batteries, or 10 hours with chaper 500 mAh ones, which is enough for our purposes.\n\n== Code ==\n\nFor schematic 1, with all LEDs logically inverted:\n<pre>\nint p1 = 0; // Set the 3 pins with PWM\nint p2 = 1;\nint p3 = 4;\n\nvoid setup() {\n  pinMode(p1, OUTPUT); // Set the pins as output\n  pinMode(p2, OUTPUT);\n  pinMode(p3, OUTPUT);\n}\n\nvoid loop() {\n  int v1, v2, v3;\n\n  v1 = random(155) + 100; // Calculate the new light\n  v2 = random(155) + 100; // intensity values for each LED\n  v3 = random(155) + 100;\n\n  analogWrite(p1, 255 - v1); // Apply the light intensity\n  analogWrite(p2, 255 - v2); // to each LED\n  analogWrite(p3, 255 - v3);\n\n  delay(20 + random(80)); // Wait some random time for next udpate\n}\n</pre>\n\n\nFor schematic 2 (reusing the LED attached to Pin 1, which is not \"logically inverted\"):\n<pre>\nint p1 = 0; // Set the 3 pins with PWM\nint p2 = 1;\nint p3 = 4;\n\nvoid setup() {\n  pinMode(p1, OUTPUT); // Set the pins as output\n  pinMode(p2, OUTPUT);\n  pinMode(p3, OUTPUT);\n}\n\nvoid loop() {\n  int v1, v2, v3;\n\n  v1 = random(155) + 100; // Calculate the new light\n  v2 = random(155) + 100; // intensity values for each LED\n  v3 = random(155) + 100;\n\n  analogWrite(p1, 255 - v1); // Apply the light intensity to each  LED\n  analogWrite(p2, v2);       // This LED is not \"logically inverted\"\n  analogWrite(p3, 255 - v3);\n\n  delay(20 + random(80)); // Wait some random time for next udpate\n}\n</pre>\n\n\n== Final Result ==\n\nI have to say that I am very satisfied with the result, keep in mind that in real is nicer than in the recorded video:\n\n{{#evt:\nservice=youtube\n|id=https://youtu.be/a-6UNgORXR8\n|alignment=left\n}}"
                    }
                ]
            },
            "86": {
                "pageid": 86,
                "ns": 0,
                "title": "Roller Robot",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "Roller Robot\n\n== Chassis and Motors ==\n\n[[File:roller_chassis_01.jpg]]\n\n[[File:roller_chassis_02.jpg]]\n\n[[File:roller_chassis_03.jpg]]\n\n[[File:roller_chassis_04.jpg]]\n\n\n== Sensors ==\n\n=== Motor Encoders ===\n\n=== IR Object Detection ===\n\n== Battery Package ==\nThe energy is supplied using two 18650 LiON Batteries using a protection board:\n* 2x 18650 LiON Batteries (~7.4v and ~2200 mAh in total)\n* LiON Protection Board provides:\n** Over charge protection\n** Over discharge protection\n** Over current protection\n** Short circuit protection \n\n=== Using the Protection Board ===\nThe back size of the protection board is designed for two LiON cells and has the five connectors (B+, B-, BM, P+ and P-).\n\n[[File:lipo_protection_back.jpg|500px]]\n\nThe front size has the ICs and other passive elements.\n\n[[File:lipo_protection_front.jpg|500px]]\n\n\nThe schematics of connection is like this:\n\n[[File:lion-protection.png]]\n\n\nBattery pack from the front:\n\n[[File:BatteryPackFront.jpg]]\n\nBattery pack from the top:\n\n[[File:BatteryPackTop.jpg]]\n\n== Voltage Regulators ==\n\nThe energy provided by the battery pack is then regulated into two independent circuits."
                    }
                ]
            }
        }
    }
}